Finding subexpressions in an expression

### 8.1.19 Finding subexpressions in an expression

The part command finds subexpressions of 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 |  |  |  |  |  |  |  |  |  |