Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Part Calculator

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.

expr: x . dx . dy + z . dy . dz + y . dx . dz;
expr2: x . [dx, dy] + z . [dy, dz] + y . [dx, dz];
expr3: x * [dx, dy] + z * [dy, dz] + y * [dx, dz];
expr4: [x, dx, dy] + [z, dy, dz] + [y, dx, dz];
expr5: [[x, dx, dy], [z, dy, dz], [y, dx, dz]];
expr6: x . del(x) . del(y) + z . del(y) . del(z) + y . del(x) . del(z);
part(expr, 1);
length(expr);
op(expr);
args(expr);
map(op, args(expr));
map(args, args(expr));
map(args, args(expr6));
diffform(vars, expr) := block(    [n, k],    0);
diff(x + y);

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) 

Part Example

Related Examples

part-rat

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

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

nxt(ns) := rat(ns[1]^...

Calculate

part

part((a+b),1);

Calculate

part

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

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

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

Calculate

part-random-substpart

signs:["+","-","*","/"];

a1:random(8);

a2:random(5);

Calculate

part-solve

e1:ib = s*Cpi*(vb-ve);

e2:s*Cpi*(vb-ve) + gm...

part(solve([e1,e2],[i...

Calculate

part

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

Calculate

part

answer:x=6;

part(answer,2);

Calculate

part-solve

eq1:r1^2=x^2+(z-e)^2;

solve([eq1],[x]);

solve([eq1],[z]);

Calculate

part-solve

answer: solve(x^2=1);

part(answer,1);

part(answer,2);

Calculate

part

answer: (x+1)*(x-2)=0;

aa : part(answer,1);

part(aa,0);

Calculate