COEFFN INDEX

COEFFN _ _ _ _ _ _ _ _ _ _ _ _ operator

The coeffn operator takes three arguments: an expression, a kernel, and a non-negative integer. It returns the coefficient of the kernel to that integer power, appearing in the expression.

syntax:

coeffn(<expression>,<kernel>,<integer>)

<expression> must be a polynomial, unless ratarg is on which allows rational expressions. <kernel> must be a kernel, and <integer> must be a non-negative integer.

examples:



ff := x**7 + sin(y)*x**5 + y**4 + x + 7; 


                5     7         4
  FF := SIN(Y)*X   + X   + X + Y   + 7 


coeffn(ff,x,5); 

  SIN(Y) 


coeffn(ff,z,3); 

  0 


coeffn(ff,y,0); 

          5     7
  SIN(Y)*X   + X   + X + 7 



rr := 1/y**2+y**3+sin(y); 

                2     5
        SIN(Y)*Y   + Y   + 1
  RR := -------------------- 
                  2
                 Y


on ratarg; 


coeffn(rr,y,-2); 

  ***** -2 invalid as COEFFN index 



coeffn(rr,y,5); 

  1
  ---
   2
  Y

If the given power of the kernel does not appear in the expression , coeffn returns 0. Negative powers are never detected, even if they appear in the expression and ratarg are on. coeffn with an integer argument of 0 returns any terms in the expression that do not contain the given kernel.