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>)

f:x^4+a*x+b ;
g:x^2+(p+y)*x+k*y ;
                                      h:resultant(f,g,x);
 j:coeff(h,y,1);

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-expand-factor-resultant

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

g:x^3+p*x^2+(q-l*y)*x...

h: expand(resultant(f...

Calculate

coeff-rat-remainder-resultant-solve-subst

A:u^4+p*u^2+q*u+r;

B:v^2+b-u*(c*v^2+e);

C:v^4+k*v+m;

Calculate

coeff-expand-kill

kill(x);

poly : expand( 3/x+1 ...

coeff( poly, x, 2 );

Calculate

coeff-expand-rat-resultant-subst

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

g:x^3+p*x^2+(b*k*p+a/...

g1: subst([k=k,l=l,m=...

Calculate

coeff-ev-expand-linsolve-nterms-part-while

gout:(ev(Iout,linsolv...

numerator:expand(num(...

expand(coeff(numerato...

Calculate

coeff-diff-rat

f: p3(x)*diff(%e^(k*x...

f1: -diff(p3(x)*%e^(k...

g:rat((f1-f)/%e^(k*x));

Calculate

coeff-expand-rat-resultant

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

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

h:expand(resultant(f,...

Calculate

coeff-expand-resultant

g1:z^4+4*a*z+b ;

g2:z^3+p*z^2+q*z+r ;

h:expand(resultant(g1...

Calculate

coeff-expand-subst

f:3*x+2*y-1;

nf:[coeff(f,x,1),coef...

ng:[coeff(f,y,1),-coe...

Calculate