# Euler-Maclaurin Formula

I need a simple proof for the identity

$$\int_a^{b} f(x)dx=(b-a)\frac{f(a)+f(b)}{2} + (b-a)^2\frac{f'(a)-f'(b)}{12}+O((b-a)⁴)$$

I do not want to use Bernoulli's numbers, as this is not the general formula. Taylor would be great, for example.

Thank you!

• Have you tried integration by parts? – Mhenni Benghorbal May 2 '14 at 5:56
• Yes, I've tried, it didn't work... maybe I'm missing something – Lessa121 May 2 '14 at 6:08
• You may need to do some manipulations to reach the desired form. – Mhenni Benghorbal May 2 '14 at 6:11

Firstly, as you may shift and translate by doing a linear change of variables in $x$, let's assume our bounds are from $0$ to $1$. We will integrate by parts three times (though I missed the third time, Robert Israel did not).

Typically when we integrate $\displaystyle \int u \mathrm d v$ by parts, although we recognize that we can take any antiderivative of $v$, we typically choose the constant to be $0$. But now we'll choose our constants so that when we perform the integration $\displaystyle \int_0^1 v \mathrm{d}x$, we get $0$.

We start with $\displaystyle \int_0^1 f(x)\mathrm{d}x$. I'll let $u = f(x)$ and $\mathrm{d}v = \mathrm{d}x$, so that $\mathrm{d}u = f'(x)$ and $v = x - \frac{1}{2}$. We get

\begin{align} \int_0^1 f(x) \mathrm{d}x &= f(x)\left(x-\frac 12\right) \biggr\rvert_0^1 - \int_0^1 f'(x)\left( x - \frac 12 \right) \mathrm{d}x \\ &= (1-0)\frac{f(1) + f(0)}{2} - \int_0^1 f'(x) \left( x - \frac 12 \right) \mathrm{d}x. \end{align}

We do this once more, but choosing the constant from integrating $x - \frac 12$ to be $\frac{1}{12}$, for the same reason as before. Then we see that

\begin{align} \int_0^1 f'(x)\left(x - \frac 12\right) \mathrm{d}x &= f''(x)\left( \frac{x^2}{2} - \frac{x}{2} + \frac{1}{12}\right)\biggr\rvert_0^1 - \int_0^1 f''(x) \left( \frac{x^2}{2} - \frac{x}{2} + \frac{1}{12}\right)\mathrm{d}x \\ &= (1-0)^2\frac{f'(1) - f'(0)}{12} - \int_0^1 f''(x) \left( \frac{x^2}{2} - \frac{x}{2} + \frac{1}{12}\right)\mathrm{d}x. \end{align}

It just so happens to be that when we integrate by parts a third time, the next term vanishes. Because this has become routine, I omit this calculation. Putting these together, we get the expansion of they type that you want.

$$\int_0^1 f(x) \mathrm{d}x = (1-0)\frac{f(1) + f(0)}{2} + (1 - 0)^2 \frac{f'(0) - f'(1)}{12} - \int_0^1 f'''(x)\left( \frac{x^3}{6} - \frac{x^2}{4} + \frac{x}{12}\right)\mathrm{d}x.$$

Now $f$ is smooth, and so $f'''(x)$ is bounded on $[0,1]$. So the error is of size $\displaystyle O \left[ \int_0^1 \left(\frac{x^3}{6} - \frac{x^2}{4} + \frac{x}{12}\right)\mathrm{d}x\right] = O \left[\int_0^1 x^3 \mathrm{d}x \right] = O[(1-0)^4],$ where here and throughout I've left the bounds to the correct powers they would appear if we hadn't shifted our bounds to $[0,1]$. As a final note, this is in fact with Bernouilli polynomials, but without ever using their theory or words.

• Probably better to do it from $-r$ to $r$ rather than $0$ to $1$. Symmetry is your friend. Also you'll want to do one more integration by parts. – Robert Israel May 2 '14 at 6:34
• I'm solving it with -r and r, but I do not understand why one more integration by parts would help... – Lessa121 May 2 '14 at 6:58