# Question on a proof of Wirtinger's Inequality

I've been looking for a proof of Wirtinger's Inequality that does not use Fourier Analysis (I have not learned Fourier Analysis yet). I found a proof online that I don't quite understand. I'll sketch out the details below.

Theorem: Let $f(x):[0,\pi] \to \mathbb{R}$ be a $C^1$ function. If $f(0)=0$ and $f(\pi)=0$, then $\displaystyle\int_0^{\pi} f'(t)^2dt\geq\int_0^{\pi}f(t)^2dt$.

Proof: Consider $g(t)=\displaystyle \frac{f(t)}{\sin(t)}$.

We notice that $g(t)$ is differentiable at the end points by L'Hopital's Rule. So we have $f'(t)=g(t)\cos(t)+g'(t)\sin(t)$.

Thus, $$\int_0^\pi f'(t)^2dt=\int_0^\pi\left[ g(t)^2\cos^2+2g(t)g'(t)\cos(t)\sin(t)+g'(t)^2\sin^2(t)\right]dt$$

Using Integration by parts, we have $$2\int_0^{\pi}g(t)g'(t)\cos(t)\sin(t)dt=-\int_0^\pi g(t)^2\left(\cos(t)^2-\sin(t)^2\right)dt$$

Ergo \begin{align} \int_0^\pi f'(t)^2dt &= \left(g(t)^2+g'(t)^2\right)\sin(t)^2dt\\ &=\int_0^{\pi}f(t)^2dt+\int_0^\pi g'(t)^2\sin^2(t)dt\\ &\geq \int_0^{\pi}f(t)^2dt \end{align}

Equality is only achieved when $f(t)=c\sin(t+d)$ for some constants $c$ and $d$.

There are two parts of this proof I don't get. First, how can we derive that $g(t)$ is differentiable at the endpoints using l'Hopital's Rule, and why is it necessary?

Second, I don't understand the intermediate step using integration by parts. I was only able to get that $$2\int_0^{\pi}g(t)g'(t)\cos(t)\sin(t)dt=g(t)^2\sin(t)\cos(t)\Big|_0^{\pi}-\int_0^\pi g(t)^2\left(\cos(t)^2-\sin(t)^2\right)$$

If anyone could explain this proof for me, or provide another one that does not use Fourier Analysis, I would greatly appreciate it.

Actually, given only that $f(0) = f(\pi) = 0$ and $f$ is continuously differentiable on $[0,\pi]$ you can't "use l'Hopital's rule" to prove that $g(t) = \frac{f(t)}{\sin t}$ is differentiable at $t=0$ because it is not necessarily true.
For example, consider $$f(t) = t^3 \sin\left(\frac{\pi^2}{t}\right)$$ At $t=0$ (and everywhere else) this $f(t)$ is differentiable and the derivative is continuous, so $f(t) \in C^1$. (Note, however, that it is not twice differentiable at $t=0$.) Now consider $$g(t) = \frac{f(t)}{\sin t} = \frac{t^3}{\sin t} \sin\left(\frac{\pi^2}{t}\right)$$ At $t=0$, if $g(t)$ were differentiable, then $$\lim_{t\to 0} \frac{dg(t)}{dt} = \lim_{t\to 0} \left[ \frac{\left(3t^2 -t^3 \cot t\right) \sin \frac{\pi^2}{t} -\pi^2 t \cos\frac{\pi^2}{t} }{\sin t} \right]$$ would have to exist. But that function takes on every value in $(-\pi^2,\pi^2)$ in every interval, no matter how small, that includes $t=0$, so the limit does not exist.
Of course, differentiability of $\frac{f(t)}{\sin t}$ is actually stronger than what you need to prove Wirtinger's inequality.
But the tools needed to prove the inequality are so similar to the steps needed to embark on Fourier analysis that I know of nobody who proves the identity without relying on Dirichlet's conditions and/or Parseval's identity. The proof on Wikipedia (second version, taking $a=\pi$) does not come right out and say they use Fourier analysis, but that is clearly what is happening.