next | previous | forward | backward | up | index | toc

integrate -- numerical integration

Synopsis

• Usage:
integrate(f, a, b)
• Inputs:
• f, ,
• a, , , or an instance of the type Constant,
• b, , , or an instance of the type Constant,
• Outputs:
• ,

Description

Integrate f from a to b numerically, using Gaussian quadrature.

 i1 : integrate(sin, 0, pi) o1 = 2 o1 : RR (of precision 53)

For half-infinite intervals, 20-point Gauss-Laguerre quadrature is used.

 i2 : integrate(x -> exp(-x), 0, infinity) o2 = 1 o2 : RR (of precision 53)

For infinite intervals, 20-point Gauss-Hermite quadrature is used.

 i3 : integrate(x -> exp(-x^2), -infinity, infinity) o3 = 1.77245385090552 o3 : RR (of precision 53)

Ways to use integrate :

• "integrate(Function,Constant,Constant)"
• "integrate(Function,Constant,InfiniteNumber)"
• "integrate(Function,Constant,Number)"
• "integrate(Function,InfiniteNumber,Constant)"
• "integrate(Function,InfiniteNumber,InfiniteNumber)"
• "integrate(Function,InfiniteNumber,Number)"
• "integrate(Function,Number,Constant)"
• "integrate(Function,Number,InfiniteNumber)"
• "integrate(Function,Number,Number)"

For the programmer

The object integrate is .