integral.polynomial: Integrate a Polynomial

View source: R/polyxtra.R

integral.polynomialR Documentation

Integrate a Polynomial

Description

Find the integral of a univariate polynomial.

Usage

## S3 method for class 'polynomial'
integral(expr, limits = NULL, ...)

Arguments

expr

an object of class "polynomial".

limits

numeric vector of length 2 giving the integration limits.

...

further arguments to be passed to or from methods.

Value

If limits is not given, the integral of p from 0 to ‘x’'. Otherwise, the integral with the given integration limits.

See Also

deriv.polynomial

Examples

p <- poly.calc(1:5)
p
## -120 + 274*x - 225*x^2 + 85*x^3 - 15*x^4 + x^5
deriv(p)
## 274 - 450*x + 255*x^2 - 60*x^3 + 5*x^4
integral(deriv(p)) - 120
## -120 + 274*x - 225*x^2 + 85*x^3 - 15*x^4 + x^5

polynom documentation built on April 11, 2022, 9:05 a.m.