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

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

g:x^2+(p+y)*x+q+ky ;

...

Calculate

coeff-expand-resultant

f:x^5+5*a*x^3+b*x+c ;

g:k*y*x^2+p*x+2*a+y;

h:expand(resultant(f,...

Calculate

coeff

a:5*x+5;

coeff(a,x);

Calculate

coeff-factor-rat-remainder-resultant

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

B:v^2-d^2*p-u*(d*v+e);

C:resultant(A,B,u);

Calculate

coeff-expand-resultant

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

g2:z^3-b*z^2+(u*q+v)*...

h:expand(resultant(g1...

Calculate

coeff-tan

coeff (2*a*tan(x) + t...

coeff (y + x*%e^x + ...

Calculate

coeff-factor-rat-resultant-solve-subst

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

B:a0*v^2+a1*v+a2-u*(b...

C:rat(resultant(A,B,u...

Calculate

coeff-expand-factor-rat-resultant-solve-subst

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

B:a0*v^2+a1*v+a2-u*(b...

C:rat(resultant(A,B,u...

Calculate

coeff

coeff (1/(1-x)*( 1/(1...

Calculate

coeff-remainder-resultant

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

B:v^3+a*v^2+b*v-u*(d*...

C:v^4-k;

Calculate