Relation between the maximum of a function and mean value of integral I would like to prove that for a function $f$ which is $C^1$ defined on  $[a, b]$ compact
$$\max|f(x)|\leq \frac 1 {b-a}\left|\int_a^bf(x)\,dx\right| + \int_a^b|f'(x)|\,dx.$$
 A: Let $c\in [a,b]$ such that $|f(c)| = \max\{|f(x)|:a\le x \le b\}$. Use the mean value theorem to show that there is some $d\in (a,b)$ for which $$f(d) = \frac{1}{b-a}\int_a^b f(x)\, dx$$ By the fundamental theorem of calculus, $f(c) - f(d) = \int_d^c f'(t)\, dt$. Note $|f(c)| \le |f(d)| + |f(c) - f(d)|$.
A: \begin{align*}
f(x)-f(y)&=\int_{y}^{x}f'(t)dt\\
\int_{a}^{b}f(x)dy-\int_{a}^{b}f(y)dy&=\int_{a}^{b}\int_{y}^{x}f'(t)dtdy\\
f(x)(b-a)-\int_{a}^{b}f(y)dy&=\int_{a}^{b}\int_{y}^{x}f'(t)dtdy\\
f(x)&=\dfrac{1}{b-a}\int_{a}^{b}f(y)dy+\dfrac{1}{b-a}\int_{a}^{b}\int_{y}^{x}f'(t)dtdy,
\end{align*}
so
\begin{align*}
|f(x)|&\leq\left|\dfrac{1}{b-a}\int_{a}^{b}f(y)dy\right|+\dfrac{1}{b-a}\int_{a}^{b}\left|\int_{y}^{x}|f'(t)|dt\right|dy\\
&\leq\left|\dfrac{1}{b-a}\int_{a}^{b}f(y)dy\right|+\dfrac{1}{b-a}\int_{a}^{b}\int_{a}^{b}|f'(t)|dtdy\\
&=\left|\dfrac{1}{b-a}\int_{a}^{b}f(y)dy\right|+\dfrac{1}{b-a}\int_{a}^{b}dy\int_{a}^{b}|f'(t)|dt\\
&=\left|\dfrac{1}{b-a}\int_{a}^{b}f(y)dy\right|+\int_{a}^{b}|f'(t)|dt
\end{align*}
