Documentation

polyder

Polynomial differentiation

Syntax

Description

example

k = polyder(p) returns the derivative of the polynomial represented by the coefficients in p,

k(x)=ddxp(x).

example

k = polyder(a,b) returns the derivative of the product of the polynomials a and b,

k(x)=ddx[a(x)b(x)].

example

[q,d] = polyder(a,b) returns the derivative of the quotient of the polynomials a and b,

q(x)d(x)=ddx[a(x)b(x)].

Examples

collapse all

Differentiate Polynomial

Create a vector to represent the polynomial $p(x)=3x^5-2x^3+x+5$.

p = [3 0 -2 0 1 5];

Use polyder to differentiate the polynomial. The result is $q(x)=15x^4-6x^2+1$.

q = polyder(p)
q =

    15     0    -6     0     1

Differentiate Product of Polynomials

Create two vectors to represent the polynomials $a(x)=x^4-2x^3+11$ and $b(x)=x^2-10x+15$.

a = [1 -2 0 0 11];
b = [1 -10 15];

Use polyder to calculate

$$q(x)=\frac{d}{dx} \left[ a(x)b(x) \right].$$

q = polyder(a,b)
q =

     6   -60   140   -90    22  -110

The result is

$$q(x)=6x^5-60x^4+140x^3-90x^2+22x-110.$$

Differentiate Quotient of Polynomials

Create two vectors to represent the polynomials in the quotient,

$$\frac{x^4-3x^2-1}{x+4}.$$

p = [1 0 -3 -1];
v = [1 4];

Use polyder with two output arguments to calculate

$$\frac{q(x)}{d(x)}=\frac{d}{dx} \left[ \frac{p(x)}{v(x)} \right].$$

[q,d] = polyder(p,v)
q =

     2    12     0   -11


d =

     1     8    16

The result is

$$\frac{q(x)}{d(x)}=\frac{2x^3+12x^2-11}{x^2+8x+16}.$$

Input Arguments

collapse all

p — Polynomial coefficientsvector

Polynomial coefficients, specified as a vector. For example, the vector [1 0 1] represents the polynomial x2+1, and the vector [3.13 -2.21 5.99] represents the polynomial 3.13x22.21x+5.99.

For more information, see Create and Evaluate Polynomials.

Data Types: single | double
Complex Number Support: Yes

a,b — Polynomial coefficients (as separate arguments)row vectors

Polynomial coefficients, specified as two separate arguments of row vectors.

For more information, see Create and Evaluate Polynomials.

Example: polyder([1 0 -1],[10 2])

Data Types: single | double
Complex Number Support: Yes

Output Arguments

collapse all

k — Integrated polynomial coefficientsrow vector

Integrated polynomial coefficients, returned as a row vector.

q — Numerator polynomialrow vector

Numerator polynomial, returned as a row vector.

d — Denominator polynomialrow vector

Denominator polynomial, returned as a row vector.

See Also

| | |

Introduced before R2006a

Was this topic helpful?