proof $ \lvert\int_a^bf(t)dt\rvert\le\frac{(b-a)^2M}{4} $ Let $ f \in C^1([a,b],\Bbb R)$ such that $f(a)=f(b)=0$ with $a \lt b $.
If $M=\sup\limits_{x\in[a,b]}\lvert f'(x)\rvert $, show that:
$$ \left|\int_a^bf(t)dt\right|\le\frac{(b-a)^2M}{4}  $$
I tried this
for the MVT: $f'(t)=\frac{f(t)-f(a)}{t-a}  $
then $f'(t)(t-a)=f(t)$
 then $$ \left|\int_a^bf(t)dt\right| =\left|\int_a^bf'(x)(t-a)dt\right|\le \left|\int_a^bM(t-a)dt\right|=\left|M\int_a^b(t-a)dt\right|=\left|\frac{(b-a)^2M}{2}\right|$$
now
$$\left|\frac{(b-a)^2M}{2}\right|=\frac{(b-a)^2M}{2} $$
Maybe I made some mistake in development. I don't understand why I reached 2.

There's nothing wrong with what you've done. $\frac{(b - a)^2M}2$ is the best you can do if $|f'(x)| \le M$ and $f(a) = 0$. Because the MVT says that $|f(x)| \le M(x - a)$ and the integral of that will give you $M(b - a)^2/2$.
To get $\frac14$ you need to use the fact that $f(b) = 0$ as well. Then MVT will give you
$$ |f(x)| \le \min\{M(x - a), M(b - x)\} = \begin{cases} M(x - a) & a \le x \le \frac{a + b}2 \\
M(b - x) & \frac{a + b}2 \le x \le b \end{cases}, $$
which has a sort of triangle shape.
