# Proving an inequality involving integral

Let $g: [a,b]\mapsto [0,1]$, with $\int_a^b|g'(t)|^2\,\mathrm{d}t\leq 1$. Suppose $b-a<\delta$, and define $$\bar{g}=\frac{\int_{a}^{b}g\left(t\right)\,\mathrm{d}t}{b-a}$$

Show for $x\in\left[a,b\right]$, $$\left|g\left(x\right)-\bar{g}\right|^2\leq\delta^{2}\frac{\int_{a}^{b}\left|g'\left(u\right)\right|^{2}\,\mathrm{d}u}{b-a}.$$ I made the following progress: \begin{eqnarray*} \left|g\left(x\right)-\bar{g}\right| & = & \left|\frac{g\left(x\right)\int_{a}^{b}\,\mathrm{d}t}{b-a}-\frac{\int_{a}^{b}g\left(t\right)\,\mathrm{d}t}{b-a}\right|\\ & = & \left|\frac{\int_{a}^{b}g\left(x\right)\,\mathrm{d}t-\int_{a}^{b}g\left(t\right)\,\mathrm{d}t}{b-a}\right|\\ & = & \left|\frac{\int_{a}^{b}\left\{ g\left(x\right)-g\left(t\right)\right\} \,\mathrm{d}t}{b-a}\right|. \end{eqnarray*} We can write $g\left(x\right)-g\left(t\right)=g\left(\tilde{t}\right)\left(x-t\right)$ for some $\tilde{t}$ between $x$ and $t$. Then we have $$\left|g\left(x\right)-\bar{g}\right|=\left|\frac{\int_{a}^{b}g\left(\tilde{t}\right)\left(x-t\right)\,\mathrm{d}t}{b-a}\right|.$$ It seems we need some further transformation of $\int_{a}^{b}g\left(\tilde{t}\right)\left(x-t\right)\,\mathrm{d}t$, then use Jensen's inequality. But I don't how to manipulate this integral.