# Derivation of definite integral

Just a basic question to do with the derivation of the definite integral.

When using the areas of n rectangles to approximate the area under a given curve, why does the sum of the areas of n+1 rectangles give a more accurate approximation?

I can see it visually,I'm just not sure why it is so.

• This is unclear. More accurate than what? In general, the more rectangles the more accurate the approximation, at least for smooth functions (there may be pathological counterexamples). – Ethan Bolker Oct 24 '18 at 23:02
• But why exactly does the decrease in area caused by thinner rectangles outweigh the increase in area caused by an increase in the number of rectangles? – stochasticmrfox Oct 25 '18 at 20:18
• Why must more rectangles make more area? When there are more of them their bases are smaller. Thinner rectangles have smaller error in the variable height of the function. – Ethan Bolker Oct 25 '18 at 21:19

## 2 Answers

Here is a derivation of the error bound for approximating the integral using the midpoint rule.

If the integrand has a bounded second derivative, the bound on the absolute error diminishes as $$\mathcal{O}(n^{-2})$$ as $$n \to \infty$$.

For any given function, the actual error for a given $$n$$ might fluctuate in a non-monotonic fashion as we increment $$n$$ by $$1$$. Nevertheless, the error is bounded by a function $$E(n)$$ that diminishes like $$1/n^2$$.

The error on the area is due to the fact that the rectangles have an horizontal top size, which doesn't match the curve exactly. The error on each rectangle is roughly the area of a triangle.

When you use narrower rectangles, there are more triangles but the area of the triangles decreases faster because both the base and height decrease.

• But why exactly does the decrease in area caused by thinner rectangles outweigh the increase in area caused by an increase in the number of rectangles? – stochasticmrfox Oct 25 '18 at 20:18
• @stochasticmrfox: because of the faster, as explained. – Yves Daoust Oct 25 '18 at 20:19