Sponsored links: Algebra eBooks ### The Maxima on-line user's manual

Algebra Calculator

#### Search: #### Part

Function: part (<expr>, <n_1>, ..., <n_k>) Returns parts of the displayed form of `expr`. It obtains the part of `expr` as specified by the indices <n_1>, ..., <n_k>. First part <n_1> of `expr` is obtained, then part <n_2> of that, etc. The result is part <n_k> of ... part <n_2> of part <n_1> of `expr`. If no indices are specified `expr` is returned.

`part` can be used to obtain an element of a list, a row of a matrix, etc.

If the last argument to a `part` function is a list of indices then several subexpressions are picked out, each one corresponding to an index of the list. Thus `part (x + y + z, [1, 3])` is `z+x`.

`piece` holds the last expression selected when using the `part` functions. It is set during the execution of the function and thus may be referred to in the function itself as shown below.

If `partswitch` is set to `true` then `end` is returned when a selected part of an expression doesnt exist, otherwise an error message is given.

See also `inpart`, `substpart`, `substinpart`, `dpart`, and `lpart`.

Examples:

```          (%i1) part(z+2*y+a,2);
(%o1)                                 2 y
(%i2) part(z+2*y+a,[1,3]);
(%o2)                                z + a
(%i3) part(z+2*y+a,2,1);
(%o3)                                  2```

`example (part)` displays additional examples.

There are also some inexact matches for `part`. Try `?? part` to see them.

```(%o1)                                true
(%i2) ```

### Related Examples

##### part

part(3*x^2*(x+3),2);

Calculate

##### part-solve

eq1:x*a+y-b=y;

eq2:x+c=y;

eq3: solve([eq1,eq2],...

Calculate

##### part-ratsimp-solve

eg: f*(a-x)/(x+L*(a-x...

u:ratsimp(eg,x);

l:part(u,1);

Calculate

##### part-solve-sqrt-subst

eq1:1/(1+5*a+2*x+2*d)...

eq2:1/(1-5*a+2*y+2*d)...

eq3:1/(1+5*a+2*x+2*d)...

Calculate

##### part-sqrt

a:sqrt(e^((x^2)+4));

part(part(part(sqrt(e...

Calculate

##### part

part(3*x*(x+5),1);

part(-3*x*(x+5),1);

part(x*(-3*x-15),1);

Calculate

##### part-ratsimp

c:a+1/a;

c:ratsimp(c);

part(c,1);

Calculate

##### part-reveal

reveal(part(not M(x,y...

Calculate

##### part-rat

p(z):= a*z^2+b;

q(z):= c*z^2+d;

nxt(ns) := rat(ns^...

Calculate

##### part

expr:1/(k^2+k);

part(expr, 1);

part(expr, 2);

Calculate 