Suppose that $u$ is $C^1$ in $[0,\pi/2]$ and $u(0)=u’(\pi/2)=0$. I want to derive the following Poincaré inequality $$ \int_0^{\pi/2} u(x)^2\,dx \leq \int_0^{\pi/2} u’(x)^2\,dx. $$
Since $u(0)=0$, we have that $u(x) = \int_0^x u’(s)\,ds$. Hence \begin{align} u^2(x) & \leq \biggl( \int_0^x u’(s)\,dx\biggr)^2 \\ & \leq x\int_0^x u’(s)^2\,ds \end{align} by Cauchy-Schwarz inequality. It follows that \begin{align} \int_0^{\pi/2} u^2(x)\,dx & \leq \int_0^{\pi/2} \int_0^x xu’(s)^2\,ds\,dx \\ & = \int_0^{\pi/2} \int_s^{\pi/2} xu’(s)^2\,dx\,ds \\ & = \int_0^{\pi/2} \biggl(\frac{\pi^2}{8} - \frac{s^2}{2}\biggr) u’(s)^2\,ds \\ & \leq \frac{\pi^2}{8} \int_0^{\pi/2} u’(s)^2\,ds. \end{align}
As you can see, the constant $1$ (better than $\pi^2/8$) can not be obtained by using only the condition $u(0)=0$.
My question is how to utilize the other boundary condition $u’(\pi/2)=0$ to derive this better constant. I have seen this conclusion in one paper and the author said that the constant can be obtained by considering the eigenvalue problem
\begin{cases} -u’’ = \lambda u \\ u(0)=u’(\pi/2)=0 \end{cases}
and calculating that $1$ is the minimal eigenvalue of the above equation. What’s the principle behind this?