integral {PolynomF} | R Documentation |
Performs calculus operations on polynomial objects: differentiation and indefinite or definite integration.
## S3 method for class 'polynom': integral(expr, limits = NULL, ...) ## S3 method for class 'polylist': integral(expr, ...) ## S3 method for class 'polynom': deriv(expr, ...) ## S3 method for class 'polylist': deriv(expr, ...)
expr |
A polynom or polylist object. |
limits |
Either NULL , implying an indefinite integral, or
a numeric (or complex) vector of length two, implying a definite
integral between two fixed real of complex limits. |
... |
Not used, except in the case of integral.polylist
where it may pass on common limits of integration to all
integrals in the list. |
integral
is a local generic function. The generic function
deriv
is already defined in the stats
package.
A polynom
or numeric object giving the result of the calculus
operation, or list of such results. If the result is polynom
the list is a polylist
.
None
p <- poly.from.zeros(-2:5) ip <- integral(p) ipv <- integral(p, limits = c(-2, 5)) plot(polylist(p, deriv(p))) x <- polynom() H <- polylist(1, x) for(n in 2:10) H[[n+1]] <- x * H[[n]] - (n-1)*H[[n-1]] solve(deriv(H))