An inequality in mathematical analysis Let $f\in C[a,b]$ and $f(x)$ has second-derivative in $(a,b)$,$$L(x)=\dfrac{f(b)-f(a)}{b-a}(x-a)+f(a)=\dfrac{f(b)-f(a)}{b-a}(x-b)+f(b),|f''(x)|\leq M$$so for each $x\in [a,b] $,prove that
$$|f(x)-L(x)|\leq\dfrac{M(b-a)^2}{8}$$
I used Mean Value Theorems and Taylor's Forluma,but they don't work.I also thought the tools in Numerical Analysis,but I failed.
 A: My original answer used Taylor's theorem incorrectly. Thank you to ZFR for pointing out the glaring error in my original answer. I am a bit embarrassed that the incorrect answer was upvoted twice and accepted.
The correct approach is essentially a derivation of the more general expression for the error term of Lagrange interpolating polynomials. Here is a derivation from scratch in this simpler setting.
Let $R(x) := f(x) - L(x)$ denote the remainder. Fix $x \in (a, b)$, and define
$$Y(t) := R(t) - \frac{R(x)}{(x-b)(x-a)} (t-b)(t-a).$$
Note that $R(a)=R(b)=0$, so $Y(a)=Y(x)=Y(b)=0$.
By Rolle's theorem, $Y'$ has two roots in $(a, b)$, and in turn $Y''$ has a root $\xi \in (a, b)$.
The second derivative of $Y$ is
$$Y''(t) = R''(t) - 2\frac{R(x)}{(x-b)(x-a)}.$$
Note that $R''(t) = f''(t) - L''(t) = f''(t)$ because $L$ is linear, so
$$Y''(t) = f''(t) - 2 \frac{R(x)}{(x-b)(x-a)}.$$
Plugging in $\xi$ for $t$ makes the left-hand side zero, and rearranging yields
$$R(x) = \frac{1}{2}f''(\xi)(x-b)(x-a).$$
Thus
$$|R(x)| \le \frac{M}{2}|(x-b)(x-a)| \le \frac{M}{8}(b-a)^2.$$
