numpoly.derivative¶
- numpoly.derivative(poly: numpoly.typing.PolyLike, *diffvars: Union[numpoly.baseclass.ndpoly, str, int]) → numpoly.baseclass.ndpoly[source]¶
Polynomial differential operator.
- Args:
- poly:
Polynomial to differentiate.
- diffvars:
Singleton variables to take derivative off.
- Return:
Same as
poly
but differentiated with respect todiffvars
.- Example:
>>> q0, q1 = numpoly.variable(2) >>> poly = numpoly.polynomial([1, q0, q0*q1**2+1]) >>> poly polynomial([1, q0, q0*q1**2+1]) >>> numpoly.derivative(poly, "q0") polynomial([0, 1, q1**2]) >>> numpoly.derivative(poly, 0, 1) polynomial([0, 0, 2*q1]) >>> numpoly.derivative(poly, q0, q0, q0) polynomial([0, 0, 0])