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:

Coeff Calculator

Coeff

Function: coeff (<expr>, <x>, <n>)

Function: coeff (<expr>, <x>) Returns the coefficient of <x>^<n> in <expr>, where <expr> is a polynomial or a monomial term in <x>.

coeff(<expr>, <x>^<n>) is equivalent to coeff(<expr>, <x>, <n>). coeff(<expr>, <x>, 0) returns the remainder of <expr> which is free of <x>. If omitted, <n> is assumed to be 1.

<x> may be a simple variable or a subscripted variable, or a subexpression of <expr> which comprises an operator and all of its arguments.

It may be possible to compute coefficients of expressions which are equivalent to <expr> by applying expand or factor. coeff itself does not apply expand or factor or any other function.

coeff distributes over lists, matrices, and equations.

Examples:

coeff returns the coefficient <x>^<n> in <expr>.

          (%i1) coeff (b^3*a^3 + b^2*a^2 + b*a + 1, a^3);
                                          3
          (%o1)                          b

coeff(<expr>, <x>^<n>) is equivalent to coeff(<expr>, <x>, <n>).

          (%i1) coeff (c[4]*z^4 - c[3]*z^3 - c[2]*z^2 + c[1]*z, z, 3);
          (%o1)                         - c
                                           3
          (%i2) coeff (c[4]*z^4 - c[3]*z^3 - c[2]*z^2 + c[1]*z, z^3);
          (%o2)                         - c
                                           3

coeff(<expr>, <x>, 0) returns the remainder of <expr> which is free of <x>.

          (%i1) coeff (a*u + b^2*u^2 + c^3*u^3, b, 0);
                                      3  3
          (%o1)                      c  u  + a u

<x> may be a simple variable or a subscripted variable, or a subexpression of <expr> which comprises an operator and all of its arguments.

          (%i1) coeff (h^4 - 2*%pi*h^2 + 1, h, 2);
          (%o1)                        - 2 %pi
          (%i2) coeff (v[1]^4 - 2*%pi*v[1]^2 + 1, v[1], 2);
          (%o2)                        - 2 %pi
          (%i3) coeff (sin(1 + x)*sin(x) + sin(1 + x)^3*sin(x)^3, sin(1 + x)^3);
                                          3
          (%o3)                        sin (x)
          (%i4) coeff ((d - a)^2*(b + c)^3 + (a + b)^4*(c - d), a + b, 4);
          (%o4)                         c - d

coeff itself does not apply expand or factor or any other function.

          (%i1) coeff (c*(a + b)^3, a);
          (%o1)                           0
          (%i2) expand (c*(a + b)^3);
                           3          2        2        3
          (%o2)           b  c + 3 a b  c + 3 a  b c + a  c
          (%i3) coeff (%, a);
                                          2
          (%o3)                        3 b  c
          (%i4) coeff (b^3*c + 3*a*b^2*c + 3*a^2*b*c + a^3*c, (a + b)^3);
          (%o4)                           0
          (%i5) factor (b^3*c + 3*a*b^2*c + 3*a^2*b*c + a^3*c);
                                            3
          (%o5)                      (b + a)  c
          (%i6) coeff (%, (a + b)^3);
          (%o6)                           c

coeff distributes over lists, matrices, and equations.

          (%i1) coeff ([4*a, -3*a, 2*a], a);
          (%o1)                      [4, - 3, 2]
          (%i2) coeff (matrix ([a*x, b*x], [-c*x, -d*x]), x);
                                    [  a    b  ]
          (%o2)                     [          ]
                                    [ - c  - d ]
          (%i3) coeff (a*u - b*v = 7*u + 3*v, u);
          (%o3)                         a = 7

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

(%o1)                                true
(%i2) 

Coeff Example

Related Examples

coeff-cos-depends-diff-sin

depends(F,[U,V]);

u:a*sin(x)+b*cos(y);

v:a*cos(x)+b*sin(y);

Calculate

coeff-denom-expand-rhs-solve

eq1: u*(1+ki/(z-1)) -...

eq2: solve(eq1, y);

eq2_1: denom(rhs(eq2));

Calculate

coeff-denom-expand-solve-sqrt

jednacine: [U1*C1*S-C...

promenljive: [U1,U2];

odziv: solve(jednaci...

Calculate

coeff-expand-resultant

f:x^4+4*a*x+b ;

g:x^3+(p*k+u)*x^2+(q*...

h: expand(resultant(f...

Calculate

coeff-expand-remainder-resultant

A:u^3+p*u+q;

B:expand((u+a)*A);

C:u^3+k*u^2+m*u+n;

Calculate

coeff-diff-expand-mat_trace-matrix-subst-trace-transpose

H: matrix ([h11, h12]...

B: matrix ([b1, 0], [...

D: matrix ([d1, 0], [...

Calculate

coeff-expand-factor-remainder-resultant-subst

A:u^3+p*u+q;

B:u^2+a*u+b;

C:expand(A*B);

Calculate