Here is a proof not involving Fourier Series at all.

Since $f(a) = 0$ we can write, using the fundamental theorem of calculus: $$ f(t) = \int_a^t \frac{\mathrm{d}f(\tau)}{\mathrm{d}\tau}\mathrm{d}\tau,\ \ \ t\in[a,b], $$ hence $$ \left|f(t)\right| \le \int_a^t \left|\frac{\mathrm{d}f(\tau)}{\mathrm{d}\tau}\right|\mathrm{d}{\tau}. $$ Cauchy-Schwarz inequality ensures: $$ \int_a^t \left|\frac{\mathrm{d}f(\tau)}{\mathrm{d}\tau}\right|\mathrm{d}{\tau} \le \left(\int_a^t \left|\frac{\mathrm{d}f(\tau)}{\mathrm{d}\tau}\right|^2\mathrm{d}{\tau}\right)^{1/2}\cdot \left(\int_a^t\mathrm{d}\tau\right)^{1/2}\\ \hspace{2.7cm}\le \left(\int_a^b \left|\frac{\mathrm{d}f(\tau)}{\mathrm{d}\tau}\right|^2\mathrm{d}{\tau}\right)^{1/2}\cdot \left(\int_a^b\mathrm{d}\tau\right)^{1/2} \\ \hspace{2cm} =(b-a)^{1/2}\left(\int_a^b \left|\frac{\mathrm{d}f(\tau)}{\mathrm{d}\tau}\right|^2\mathrm{d}{\tau}\right)^{1/2}. $$ Thus $$ \left|f(t)\right|^2 \le (b-a)\int_a^b \left|\frac{\mathrm{d}f(\tau)}{\mathrm{d}\tau}\right|^2\mathrm{d}{\tau} $$

$$ \int_a^b\left|f(t)\right|^2\mathrm{d}t \le (b-a)^2 \int_a^b \left|\frac{\mathrm{d}f(\tau)}{\mathrm{d}\tau}\right|^2\mathrm{d}{\tau} $$ $$ \int_a^b \left|\frac{\mathrm{d}f(\tau)}{\mathrm{d}\tau}\right|^2\mathrm{d}{\tau} \ge \frac{1}{(b-a)^2}\int_a^b \left|f(t)\right|^2\mathrm{d}t, $$ which is a slightly less strong result.

EDIT: The fact that $f(a)=0=f(b)$ can be incorporated as follows. Let us first assume for simplicity that $a=0$ and $b=1$ and denote $||\varphi||^2=\int_0^1 \varphi(t)^2 dt$. $$ \varphi(t)=\sum_{\mathbb Z} e^{i2\pi n t} c_n\,,\qquad c_n=\int_0^1 \varphi(t) e^{-i2\pi nt}dt\,, $$ then $$ ||\varphi||^2=\sum_{\mathbb Z} |c_n|^2= |c_0|^2 + \sum_{\mathbb Z\setminus \{0\}} |c_n|^2\,,\qquad ||\dot \varphi||^2=4\pi^2 \sum_{\mathbb Z\setminus\{0\}} n^2 |c_n|^2\ge 4\pi^2 \sum_{\mathbb Z\setminus \{0\}} |c_n|^2\,. $$ On the other hand $\varphi(0)=0=\varphi(1)$ requires $$ 0=\sum_{\mathbb Z} c_n = c_0 + \sum_{\mathbb Z\setminus\{0\}} c_n $$ and using this equation to get rid of $c_0$ we obtain $$ ||\varphi||^2 = \Big|\sum_{\mathbb Z\setminus\{0\}} c_n \Big|^2+\sum_{\mathbb Z\setminus \{0\}} |c_n|^2 \le 2 \sum_{\mathbb Z\setminus \{0\}} |c_n|^2\,. $$ Comparing the two inequalities $$ ||\dot\varphi||^2 \ge 2\pi^2 ||\varphi||^2\,. $$ More generally, reinstating the dependence on the interval, $$ \int_a^b \dot f(t)^2 dt \ge \frac{2\pi^2}{(b-a)^2}\int_a^b f(t)^2dt\,. $$ Curiously enough, this approach gives an extra factor of two, unless I am missing something.


The standard Wirtinger's inequality requires that $\int_a^b f\,dx=0$, which implies that $c_0=0$, and hence the difficulty you are encounter does not exist.

If instead we assume that $f(a)=f(b)=0$, then we exploit this by expanding $f$ in a sine series, i.e., for $a=0$ and $b=\pi$, $$ f(x)=\sum_{n=1}^\infty a_n\sin nx, $$ and hence $$ \int_0^\pi f^2= \frac{\pi}{2}\sum_{n=1}^\infty a_n^2 \qquad \text{while} \qquad \int_0^\pi (f')^2= \frac{\pi}{2}\sum_{n=1}^\infty n^2a_n^2, $$ and therefore $$ \int_0^\pi (f')^2\ge \int_0^\pi f^2, $$ with best constant $c=1$.

For arbitrary $b>a$, $$ f(x)=\sum_{n=1}^\infty a_n\sin \left(\frac{n\pi(x-a)}{b-a}\right), $$ and hence $$ \int_a^b\!\! f^2= \frac{b-a}{2}\sum_{n=1}^\infty a_n^2 \quad \text{while} \quad \int_a^b\!\! (f')^2= \frac{b-a}{2}\sum_{n=1}^\infty \left(\frac{\pi}{b-a}\right)^2n^2a_n^2, $$ and hence $$ \int_a^b\! (f')^2\ge \frac{\pi^2}{(b-a)^2}\int_0^\pi f^2. $$