Sub-expression of an expression: part

### 6.12.24 Sub-expression of an expression: part

The part command finds subexpressions of an expression. (See Section 4.3.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.

- Input:
  part(x^2+x+1,2)
  Output:

  x

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

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

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

  y−2