numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
polyder(p, m=1)
note

This forms part of the old polynomial API. Since version 1.4, the new polynomial API defined in :None:None:`numpy.polynomial` is preferred. A summary of the differences can be found in the :None:doc:`transition guide </reference/routines.polynomials>`.

Parameters

p : poly1d or sequence

Polynomial to differentiate. A sequence is interpreted as polynomial coefficients, see poly1d .

m : int, optional

Order of differentiation (default: 1)

Returns

der : poly1d

A new polynomial representing the derivative.

Return the derivative of the specified order of a polynomial.

See Also

poly1d

Class for one-dimensional polynomials.

polyint

Anti-derivative of a polynomial.

Examples

The derivative of the polynomial $x^3 + x^2 + x^1 + 1$ is:

>>> p = np.poly1d([1,1,1,1])
... p2 = np.polyder(p)
... p2 poly1d([3, 2, 1])

which evaluates to:

>>> p2(2.)
17.0

We can verify this, approximating the derivative with (f(x + h) - f(x))/h :

>>> (p(2. + 0.001) - p(2.)) / 0.001
17.007000999997857

The fourth-order derivative of a 3rd-order polynomial is zero:

>>> np.polyder(p, 2)
poly1d([6, 2])
>>> np.polyder(p, 3)
poly1d([6])
>>> np.polyder(p, 4)
poly1d([0])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.polynomial.polynomial.polyint numpy.polyint numpy.lib.polynomial.poly1d.deriv numpy.polymul numpy.polydiv numpy.polyadd

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/lib/polynomial.py#372
type: <class 'function'>
Commit: