## The trapezoid rule

Hi. Need some guidance to make the trapezoid rule more effective.

Let $\displaystyle f:[a,b]\to\mathbb{R}$ be a function. I want to find an approximation to the integral

$\displaystyle \int_{a}^b f(x)dx$.

I know that the trapezoid rule is given by

$\displaystyle I_n =h\sum_{i=1}^{2^n} \frac{f(x_{i-1})+f(x_i)}{2}$ where $\displaystyle h=\frac{b-a}{2^n}$.
(Notice that I want $\displaystyle 2^n$ trapezoids/parts)

$\displaystyle I_n$ can be rewritten as

$\displaystyle I_n =h[\frac{f(a)+f(b)}{2}+\sum_{i=1}^{2^n -1}f(a+ih)]$.

Ok, now over to the problem. To make the method more effective I use the approximation to integral from $\displaystyle I_{n-1}$ in $\displaystyle I_n$ in this way

$\displaystyle I_n =\frac{I_{n-1}}{2}+h\sum_{i=1}^{2^{n-1}}f(a+(2i-1)h)$.

The part that I dont understand in this new formula is why you just can divide $\displaystyle \frac{I_{n-1}}{2}$? The other part I do understand, because in $\displaystyle I_{n-1}$ you have already calculated $\displaystyle f(x_i)$ where $\displaystyle i$ is even and $\displaystyle i\in[0,2^n]$, so in $\displaystyle I_n$ you only need to calculate $\displaystyle f(x_i)$ with odd indexes $\displaystyle i$.

I hope the problem is clear!? And I hope someone can help me explain and understand this formula. Maby it's a good idea to prove that it works? I dont know how, but maby a hint could help?