Maxima Function
coeff (expr, x, n)
Returns the coefficient of x^n in expr. n may be
omitted if it is 1. x may be an atom, or complete subexpression of
expr e.g., sin(x), a[i+1], x + y, etc. (In the last case the
expression (x + y) should occur in expr). Sometimes it may be necessary
to expand or factor expr in order to make x^n explicit. This is not
done automatically by coeff.
Examples: