polyint
Polynomial integration
Syntax
polyint // example Q = polyint(P) Q = polyint(P, Const)
Arguments
- P, Q
- arrays (from scalars to hypermatrices) of polynomials with real or complex coefficients, of same size.
- Const
- Set of real or complex constants of integration.
length(Const)
sets the number of consecutive integrations to perform. By default, 0 is used.Const
can be one of the following:- a scalar: then only the first antiderivatives are computed, and all use
the same
Const
value. - an array of size size(P): then only the first antiderivatives are computed,
with the respective
Const(i)
forQ(i)
. - a list that can mix scalars, arrays of size size(P), or undefined elements.
Then
Const(i)
is used for the ith antiderivatives. Undefined elements are equivalent to 0.
- a scalar: then only the first antiderivatives are computed, and all use
the same
Description
polyint(..) computes the first or any nth antiderivative of each polynomial of the input array.
Examples
Single integration (first order):
s = %s; P = [-2, s ; s^2-3, s-2*s^3] polyint(P) polyint(P, 1) polyint(P, [1 2 ; 3 4])
--> P = [-2, s ; s^2-3, s-2*s^3] P = -2 s -3 +s² s -2s³ --> polyint(P) ans = -2s 0.5s² -3s +0.3333333s³ 0.5s² -0.5s⁴ --> polyint(P, 1) ans = 1 -2s 1 +0.5s² 1 -3s +0.3333333s³ 1 +0.5s² -0.5s⁴ --> polyint(P, [1 2 ; 3 4]) ans = 1 -2s 2 +0.5s² 3 -3s +0.3333333s³ 4 +0.5s² -0.5s⁴
Multiple integrations:
s = %s; polyint(1-3*s, list(-1,1)) P = [3 ; 1-s ; 6*s^2-2] polyint(P, list(2, [-2 1 0])) polyint(P, list(, [-2 1 0])) k = list(); k(5) = 0; polyint(1+0*s, k) 1 / factorial(5)
--> polyint(1-3*s, list(-1,1)) ans = 1 -s +0.5s² -0.5s³ --> P = [3 ; 1-s ; 6*s^2-2] P = 3 1 -s -2 +6s² --> polyint(P, list(2, [-2 1 0])) ans = -2 +2s +1.5s² 1 +2s +0.5s² -0.1666667s³ 2s -s² +0.5s⁴ --> polyint(P, list(, [-2 1 0])) ans = -2 +1.5s² 1 +0.5s² -0.1666667s³ -s² +0.5s⁴ --> k = list(); k(5) = 0; --> polyint(1+0*s, k) ans = 0.0083333s⁵ --> 1 / factorial(5) ans = 0.0083333
See also
- derivat — derivative of polynomials or of rationals
History
Version | Description |
6.1.1 | polyint() introduced. |
Report an issue | ||
<< polyDisplay | Polynomials | residu >> |