Extracting subexpressions

### 9.1.19 Extracting subexpressions

The part command extracts subexpressions from an expression. (See Section 2.9.2.)

- part takes two arguments:
  - expr, an expression.
  - n, an integer.
- part(expr,n) evaluates expr and then returns the nth sub-expression of expr.

#### Examples

part(x^2+x+1,2)

x |  |  |  |  |  |  |  |  |  |

part(x^2+(x+1)*(y-2)+2,2)

| ⎛ ⎝ | x+1 | ⎞ ⎠ | ⎛ ⎝ | y−2 | ⎞ ⎠

part((x+1)*(y-2)/2,2)

y−2 |  |  |  |  |  |  |  |  |  |