bundles / numpy 2.4.4 / numpy / polyint
_ArrayFunctionDispatcher
numpy:polyint
Signature
def polyint ( p , m = 1 , k = None ) Summary
Return an antiderivative (indefinite integral) of a polynomial.
Extended Summary
The returned order m antiderivative P of polynomial p satisfies and is defined up to m - 1 integration constants k. The constants determine the low-order polynomial part
of P so that .
Parameters
p: array_like or poly1dPolynomial to integrate. A sequence is interpreted as polynomial coefficients, see
poly1d.m: int, optionalOrder of the antiderivative. (Default: 1)
k: list of `m` scalars or scalar, optionalIntegration constants. They are given in the order of integration: those corresponding to highest-order terms come first.
If
None(default), all constants are assumed to be zero. Ifm = 1, a single scalar can be given instead of a list.
Examples
The defining property of the antiderivative:import numpy as np
✓p = np.poly1d([1,1,1]) P = np.polyint(p)✓
P np.polyder(P) == p✗
P = np.polyint(p, 3)
✓P(0) np.polyder(P)(0) np.polyder(P, 2)(0)✗
P = np.polyint(p, 3, k=[6,5,3])
✓P
✗np.polyder(P, 2)(0) np.polyder(P, 1)(0) P(0)✗
See also
- poly1d.integ
equivalent method
- polyder
derivative of a polynomial
Aliases
-
numpy.polyint