Differentiate a polynomial.
Returns the polynomial cs differentiated m times. At each iteration the result is multiplied by scl (the scaling factor is for use in a linear change of variable). The argument cs is the sequence of coefficients from lowest order term to highest, e.g., [1,2,3] represents the polynomial 1 + 2*x + 3*x**2.
Parameters : | cs: array_like :
m : int, optional
scl : scalar, optional
|
---|---|
Returns : | der : ndarray
|
See also
Examples
>>> from numpy import polynomial as P
>>> cs = (1,2,3,4) # 1 + 2x + 3x**2 + 4x**3
>>> P.polyder(cs) # (d/dx)(cs) = 2 + 6x + 12x**2
array([ 2., 6., 12.])
>>> P.polyder(cs,3) # (d**3/dx**3)(cs) = 24
array([ 24.])
>>> P.polyder(cs,scl=-1) # (d/d(-x))(cs) = -2 - 6x - 12x**2
array([ -2., -6., -12.])
>>> P.polyder(cs,2,-1) # (d**2/d(-x)**2)(cs) = 6 + 24x
array([ 6., 24.])