Prove that exists $c\in(a,b)$ such that: $\int_a^bf(x)dx = f(\frac{a+b}{2})(b-a)+\frac{f''(c)}{24}(b-a)^3$ 
Let $f\in C^2([a,b]). $ Prove that exists $c\in(a,b)$ such that:$$\int_a^bf(x)dx = f(\frac{a+b}{2})(b-a)+\frac{f''(c)}{24}(b-a)^3$$

Any hints on how to solve this? I've tried expanding the function near the point $x = \frac{a+b}{2}$ but it didn't seem a good way. Maybe a change of variables could help? or even the formulate which relates the taylor expansion with its integral remain is the key?
thanks in advance!
 A: Your approach does work. Let $d=(a+b)/2$, and we have
$$ f(x) = f(d) + f'(d) (x-d) + \frac{1}{2}f''(\xi(x))(x-d)^2, $$
where $\lvert \xi(x)-d \rvert < \lvert x-d \rvert$ by Taylor's theorem with the Lagrange remainder. Integrating over $[a,b]$ gives
$$ \int_a^b f(x) \, dx = f(d)(b-a) + 0 + \frac{1}{2} \int_a^b f''(\xi(x)) (x-d)^2 \, dx, $$
and we need to deal with the last term. The easiest way is probably to use the First Mean Value Theorem for Integrals, which says if $G$ is nonnegative, there is $C \in (a,b)$ so that
$$ \int_a^b F(x) G(x) \, dx = F(C) \int_a^b G(x) \, dx. $$
Applying this with $F=f'' \circ \xi$ and $G(x) = (x-d)^2$ gives
$$ \int_a^b (x-d)^2 \, dx = \frac{1}{3}((b-d)^3-(a-d)^3) = \dotsb = \frac{1}{12}(b-a)^3, $$
and hence
$$ \int_a^b f(x) \, dx = f(d)(b-a) - \frac{1}{24}(b-a)^3 f''(\xi(C)) = f(d)(b-a) + \frac{1}{24}(b-a)^3 f''(c) $$
for some $c \in (a,b)$, because $\xi(C) $ is closer to $d$ than $C$ is and hence still in $(a,b)$.
A: ... adding to Chappers answer, one still needs to make sure that such a $\xi(x)$ can actually be chosen as a continuous function.
This is not usually shown in the calculus lectures where I live, so I thought it might help to point that out.
The proof should be easy for the mean-value theorem in general: Start with a "narrow" interval and choose a $\xi$, then expand that interval by a small $\varepsilon$, show that for the expanded interval a $\tilde{\xi}$ "close" ($\varepsilon$-estimate) to the original one exists such that the mean value property holds for $\tilde{\xi}$...
