A-level Mathematics/MEI/NM/Integration

Doing definite integrals can be seen as just finding the area under a curve on a graph. You may have met elsewhere the idea of finding the area of complicated shapes by splitting them up into simpler shapes that we can easily calculate the areas of. We use a similar technique for numerical integration - we approximate the curve by a series of simple shapes and add up the areas of these to get a value for the integral.

Mid-point rule

edit
 
Illustration of the midpoint rule.

This method approximates the curve using rectangles. The height of each rectangle is given by the value of the function in the middle of the rectangle, and all the rectangles have the same width.

We divide the interval [a, b] to integrate over into n strips of equal width. The width of each strip is then h = (b - a)/n.

We write the value of x at a as x0, at the end of the first rectangle as x1, at the end of the second as x2, and so on. xr is the value of x at the right hand side of r strips, so xr = a + r * h.

Also note that f(x) evaluated at x0 can be written as f0, at x1 as f1, and so on. The value of f(x) evaluated at xr is fr.

The area of each approximating rectangle is h multiplied by f(x) evaluated in the middle of the rectangle. Following on from the above notation, the value of f(x) evaluated halfway through the first strip is f0.5, so the area of the approximating rectangle for the first strip is h f0.5.

Therefore, for n strips, the total area is: