Estimating Poincare constant for unit interval

I want to show that the Poincare constant for the $W^{1,2}_0(0,1)$ is smaller than $1$. More specifically, I want to show that there is a constant $C<1$ such that for any $f\in C^\infty_c(0,1)$ (compactly supported smooth) we have the inequality $$ \lVert f\rVert\leq C\lVert f'\lVert $$ where $\lVert\cdot\rVert$ is the $L^2$ norm.

The proof of Poincare inequality that I know (using Cauchy-Schwarz) gives an estimate of $C=2$, while the Wikipedia article seems to say that optimally $C\leq \pi^{-1}$. I'm looking for a simple proof for this special case. I don't need a very sharp estimate, just smaller than $1$, and would appreciate a hint or a reference.


The constant you are looking for is the following: $$\frac{1}{C^2}=\inf\left\{ \int_0^1 \left(f'\right)^2\, dx\ :\ \int_0^1 (f)^2\, dx=1\right\}. $$ Since $$\int_0^1 \left(f'\right)^2\, dx = \langle -f'', f\rangle, $$ you are in fact looking for the first eigenvalue of the following Sturm-Liouville problem: $$\begin{cases} -\frac{d^2 f}{dx^2}=\lambda f \\ \\f(0)=f(1)=0 \end{cases}$$ This problem can be integrated explicitly and you find that the first eigenvalue is $\pi^2$ with eigenfunction $\sin(\pi x)$ (and scalar multiples of it). Therefore $$C=\frac{1}{\pi}<1.$$