Main Content

Numerical integration

`q = integral(`

specifies
additional options with one or more `fun`

,`xmin`

,`xmax`

,`Name,Value`

)`Name,Value`

pair
arguments. For example, specify `'WayPoints'`

followed
by a vector of real or complex numbers to indicate specific points
for the integrator to use.

The

`integral`

function attempts to satisfy:whereabs(q - Q) <= max(AbsTol,RelTol*abs(q))

`q`

is the computed value of the integral and`Q`

is the (unknown) exact value. The absolute and relative tolerances provide a way of trading off accuracy and computation time. Usually, the relative tolerance determines the accuracy of the integration. However if`abs(q)`

is sufficiently small, the absolute tolerance determines the accuracy of the integration. You should generally specify both absolute and relative tolerances together.If you are specifying single-precision limits of integration, or if

`fun`

returns single-precision results, you might need to specify larger absolute and relative error tolerances.

[1] L.F. Shampine “*Vectorized
Adaptive Quadrature in MATLAB ^{®}*,”