# Calculus/Integration techniques/Numerical Approximations

 ← Integration techniques/Irrational Functions Calculus Integration/Exercises → Integration techniques/Numerical Approximations

It is often the case, when evaluating definite integrals, that an antiderivative for the integrand cannot be found, or is extremely difficult to find. In some instances, a numerical approximation to the value of the definite value will suffice. The following techniques can be used, and are listed in rough order of ascending complexity.

## Riemann Sum

This comes from the definition of an integral. If we pick n to be finite, then we have:

${\displaystyle \int \limits _{a}^{b}f(x)dx\approx \sum _{i=1}^{n}f(x_{i}^{*})\Delta x}$

where ${\displaystyle x_{i}^{*}}$ is any point in the i-th sub-interval ${\displaystyle [x_{i-1},x_{i}]}$ on ${\displaystyle [a,b]}$ .

### Right Rectangle

A special case of the Riemann sum, where we let ${\displaystyle x_{i}^{*}=x_{i}}$ , in other words the point on the far right-side of each sub-interval on, ${\displaystyle [a,b]}$ . Again if we pick n to be finite, then we have:

${\displaystyle \int \limits _{a}^{b}f(x)dx\approx \sum _{i=1}^{n}f(x_{i})\Delta x}$

### Left Rectangle

Another special case of the Riemann sum, this time we let ${\displaystyle x_{i}^{*}=x_{i-1}}$ , which is the point on the far left side of each sub-interval on ${\displaystyle [a,b]}$ . As always, this is an approximation when ${\displaystyle n}$ is finite. Thus, we have:

${\displaystyle \int \limits _{a}^{b}f(x)dx\approx \sum _{i=1}^{n}f(x_{i-1})\Delta x}$

## Trapezoidal Rule

${\displaystyle \int \limits _{a}^{b}f(x)dx\approx {\frac {b-a}{2n}}\left[f(x_{0})+2\sum _{i=1}^{n-1}{\bigl (}f(x_{i}){\bigr )}+f(x_{n})\right]={\frac {b-a}{2n}}{\bigg (}{f(x_{0})+2f(x_{1})+2f(x_{2})+\cdots +2f(x_{n-1})+f(x_{n})}{\bigg )}}$

## Simpson's Rule

Remember, n must be even,

 ${\displaystyle \int \limits _{a}^{b}f(x)dx}$ ${\displaystyle \approx {\frac {b-a}{6n}}\left[f(x_{0})+\sum _{i=1}^{n-1}\left((3-(-1)^{i})f(x_{i})\right)+f(x_{n})\right]}$ ${\displaystyle ={\frac {b-a}{6n}}{\bigg [}f(x_{0})+4f{\bigl (}{\tfrac {x_{1}}{2}}{\bigr )}+2f(x_{1})+4f{\bigl (}{\tfrac {x_{3}}{2}}{\bigr )}+\cdots +4f{\bigl (}{\tfrac {x_{n-1}}{2}}{\bigr )}+f(x_{n}){\bigg ]}}$

## Maclaurin Approximation

A common technique of approximating common trigonometric functions is to use the Taylor-Maclaurin series. Term-by-term integration allows one to easy compute the value of the integral by hand, well up to 5 decimal places of precision, and up to 10 given a factorial table.

For example, using the Maclaurin series of ${\displaystyle \sin(x)}$, one can easily approximate its integral with a polynomial.

${\displaystyle \sum _{n=0}^{\infty }{\frac {(-1)^{n}x^{2n+1}}{(2n+1)!}}}$

We can then easily integrate each term, taking ${\displaystyle (-1)^{n}}$ and ${\displaystyle {\frac {1}{(2n+1)!}}}$ to be constants.

${\displaystyle {\displaystyle \sum _{n=0}^{\infty }{\int {\frac {(-1)^{n}x^{2n+1}}{(2n+1)!}}}}\implies c_{0}+{\displaystyle \sum _{n=0}^{\infty }{\frac {(-1)^{n}x^{2n+2}}{(2n+2)!}}}}$

We can easily find the constant term by inspecting the known principle integral, ${\displaystyle -\cos(x)}$, and the new series. This nets us the final equation.

${\displaystyle \int _{0}^{t}{\sin(x)\;\mathrm {d} x}+1={\displaystyle \sum _{n=0}^{\infty }{\frac {(-1)^{n}t^{2n+2}}{(2n+2)!}}}}$While this is a rather fast-converging series, converging at ${\displaystyle \log _{10}((2x+2)!)}$ digits of significance, it is relatively useless, since factorials are expensive to compute.

 ← Integration techniques/Irrational Functions Calculus Integration/Exercises → Integration techniques/Numerical Approximations