Proof of Wirtinger inequality Quoting from Ana Cannas da Silva's book on Symplectic Geometry:
"As an exercise in Fourier series, show the Wirtinger inequality: for $f\in C^1([a,b])$, with $f(a)=f(b)=0$ we have
$$
\int_a^b\Big|\frac{\mathrm{d}f}{\mathrm{d}t}\Big|^2\mathrm{d}t \ge\frac{\pi^2}{(b-a)^2} \int_a^b\left|\ f\right|^2\mathrm{d}t."
$$
I already found a few questions about this topic in the site, but I couldn't actually grasp what's happening here. Also, I would very much like you to show me where I go wrong with my try, which is sketched below.
I know that, for $f\in \mathcal{L}^2([0,2\pi])\supset C^1([0,2\pi])$, I can expand:
$$
f(t)=\sum_{n=-\infty}^{+\infty}c_n e^{int},\ \ \ c_n=\frac{1}{2\pi}\int_0^{2\pi}\mathrm{d}t\ e^{-int}f(t).
$$
Rescaling  $t \to \omega (t - a)$, where $\omega = 2\pi/(b-a)$, we can get a more general form for $f\in C([a,b])$:
$$
f(t)=\sum_{n=-\infty}^{+\infty}c_n e^{in\omega t},\ \ \ c_n=\frac{1}{b-a}\int_a^{b}\mathrm{d}t\ e^{-in\omega t}f(t).
$$
Now, having:
$$
\frac{\mathrm{d}}{\mathrm{d}t}f(t) = \sum_{n=-\infty}^{+\infty}\tilde{c}_ne^{i\omega nt},\ \ \tilde{c}_n=\frac{1}{b-a}\int_a^b\mathrm{d}t\ e^{-i\omega nt}\frac{\mathrm{d}}{\mathrm{d}t}f(t).
$$
Using the fact that $\,f(a)=f(b)=0$ we get:
$$
\tilde{c}_0 = \frac{1}{b-a}\int_a^b\mathrm{d}t \frac{\mathrm{d}}{\mathrm{d}t}
f(t) = \frac{f(b)-f(a)}{b-a} =0 \longrightarrow 
\frac{\mathrm{d}}{\mathrm{d}t}f(t) = 
\sum_{n\in\mathbb Z\setminus\{0\}}\tilde{c}_n e^{i\omega nt}
$$
Now deriving the series expansion of $f$ yields:
$$
\frac{\mathrm{d}}{\mathrm{d}t}f(t) = \frac{\mathrm{d}}{\mathrm{d}t} \sum_{n=-\infty}^{+\infty}c_n e^{in\omega t} = \sum_{n=-\infty}^{+\infty}(in\omega)c_n e^{in\omega t}=\sum_{n\in\mathbb Z\setminus\{0\}}(in\omega)c_n e^{in\omega t}
$$
Comparing the two expressions we establish: $\tilde{c}_n = i\omega n c_n$, for $n\not= 0$. Parseval's Equality reads here for $\mathrm{d}f/\mathrm{d}t$:
$$
\int_a^b\left|\frac{\mathrm{d}f}{\mathrm{d}t}\right|^2\mathrm{d}t=
\sum_{n\in\mathbb Z\setminus\{0\}}  |\tilde{c_n}|^2 = 
\omega^2\sum_{n\in\mathbb Z\setminus\{0\}} n^2 |c_n|^2 \ge
\omega^2\sum_{n\in\mathbb Z\setminus\{0\}}  |c_n|^2 = 
\omega^2 \left(\int_a^b\mathrm{d}t\left|f(t)\right|^2-|c_0|^2\right)
$$
where in the last passage we used Parseval's Equality for $f$: $\int_a^b|f|^2\mathrm{d}t=\sum_{n=-\infty}^{+\infty}|c_n|^2$.
We are now left with finding a suitable way of estimating $|c_0|^2$:
$$
|c_0|^2 = \left|\frac{1}{b-a}\int_a^b\mathrm{d}t\ f(t)\right|^2,
$$ thus
$$
\int_a^b\left|\frac{\mathrm{d}f}{\mathrm{d}t}\right|^2\mathrm{d}t \ge \frac{4\pi^2}{(b-a)^2}\left(\int_a^b\left|f\right|^2\mathrm{d}t - \frac{1}{(b-a)^2}\left|\int_a^bf\mathrm{d}t\right|^2\right).
$$
Which is not exactly what I wanted.
Please lend me a hand!
 A: 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.
A: 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.
$$
