polyder

Polynomial differentiation

Description

example

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

$k\left(x\right)=\frac{d}{dx}p\left(x\right)\text{\hspace{0.17em}}.$

example

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

$k\left(x\right)=\frac{d}{dx}\left[a\left(x\right)b\left(x\right)\right]\text{\hspace{0.17em}}.$

example

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

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

Examples

collapse all

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

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

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

q = polyder(p)
q = 1×5

15     0    -6     0     1

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

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

Use polyder to calculate

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

q = polyder(a,b)
q = 1×6

6   -60   140   -90    22  -110

The result is

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

Create two vectors to represent the polynomials in the quotient,

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

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

Use polyder with two output arguments to calculate

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

[q,d] = polyder(p,v)
q = 1×5

3    16    -3   -24     1

d = 1×3

1     8    16

The result is

$\frac{q\left(x\right)}{d\left(x\right)}=\frac{3{x}^{4}+16{x}^{3}-3{x}^{2}-24x+1}{{x}^{2}+8x+16}.$

Input Arguments

collapse all

Polynomial coefficients, specified as a vector. For example, the vector [1 0 1] represents the polynomial ${x}^{2}+1$, and the vector [3.13 -2.21 5.99] represents the polynomial $3.13{x}^{2}-2.21x+5.99$.

Data Types: single | double
Complex Number Support: Yes

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

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

Data Types: single | double
Complex Number Support: Yes

Output Arguments

collapse all

Differentiated polynomial coefficients, returned as a row vector.

Numerator polynomial, returned as a row vector.

Denominator polynomial, returned as a row vector.