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

A:a*y^2+b*y+c;

B:coeff(A,y^1);

Calculate

coeff-denom-expand-solve-sqrt

jedn:[c1*s*u1-c1*u0+u...

prom:[u1,u2];

odziv: solve(jedn,prom);

Calculate

coeff-expand-factor-rat-remainder-resultant

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

B:u^3+k*u+m;

C:expand(A*B);

Calculate

coeff-expand-factor-resultant

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

g:(x+p)*z^2+(v*x+q)*z...

h:expand(resultant(f,...

Calculate

coeff-expand-resultant

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

g:(p*y+q*z)*x+u*p*y+v...

h:expand(resultant(f...

Calculate

coeff-psi-ratsimp-rhs-solve-subst

eq1: uD = iD*R -w*LQ*iQ;

eq2: uQ = iQ*R + w*LD...

eq3: u^2 = uD^2+uQ^2;

Calculate

coeff-expand-factor-resultant

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

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

h:expand(resultant(f,...

Calculate

coeff

f:7*x^3*y^2+x-7;

coeff(f,x,4);

Calculate