coeff - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Algebra : Polynomials : Extracting Parts : coeff

coeff

extract a coefficient of a polynomial

 

Calling Sequence

Parameters

Description

Thread Safety

Examples

Calling Sequence

coeff(p, x)

coeff(p, x, n)

coeff(p, x^n)

Parameters

p

-

polynomial in x

x

-

variable (expression)

n

-

(optional) integer

Description

• 

The coeff function extracts the coefficient of x^n in the polynomial p.

• 

If the third argument is omitted, it is determined by looking at the second argument. Thus coeff(p, x^n) is equivalent to coeff(p, x, n) for n <> 0.

• 

The cases of the second argument being a number or a product are disallowed since they do not make sense.

• 

The related functions lcoeff, tcoeff, and coeffs extract the leading coefficient, trailing coefficient and all the coefficients of p in x respectively.

Thread Safety

• 

The coeff command is thread-safe as of Maple 15.

• 

For more information on thread safety, see index/threadsafe.

Examples

p2x2&plus;3y35&colon;

coeff(p, x^n) is equivalent to coeff(p, x, n) for n<>0.

coeffp&comma;x&comma;2

2

(1)

coeffp&comma;x2

2

(2)

To find the constant term of the equation, let the exponent of x be zero.

coeffp&comma;x&comma;0

3y35

(3)

The command coeff works with any variable.

coeffp&comma;y3

3

(4)

However, the following form is not allowed:

rx2&plus;4x6xy&plus;9

r:=x26xy&plus;4x&plus;9

(5)

coeffr&comma;xy

Error, invalid input: coeff received x*y, which is not valid for its 2nd argument, x

A more difficult example: the polynomial does not need to be expanded for coeff(p, x^n) to work.

q3ax&plus;12&plus;sinax2yy2x&plus;xa

q:=3ax&plus;12&plus;sinax2yy2x&plus;xa

(6)

coeffq&comma;x

y2&plus;6a&plus;1

(7)

expandq

3ax2&plus;6ax&plus;2a&plus;sinax2yy2x&plus;x

(8)

See Also

coeffs

coeftayl

lcoeff

PolynomialTools[CoefficientVector]

sort

tcoeff

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam