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?



Poincaré inequality in dimension one with mixed boundary condition
We want to show that
$$\int\_0^{\pi/2} u(x)^2\,dx \le \int\_0^{\pi/2} u'(x)^2\,dx \tag{1}\label{1}$$
for all $u\in C^1[0,\pi/2]$ such that $u(0)=0$ and $u'(\pi/2)=0$.


Let us show that **\eqref{1} holds even without any condition on $u'(\pi/2)$**.


We have the [Poincaré inequality](https://en.wikipedia.org/wiki/Poincar%C3%A9_inequality#The_Poincar%C3%A9_constant)
$$\int\_0^\pi w(x)^2\,dx \le \int\_0^\pi w'(x)^2\,dx \tag{2}\label{2}$$
for all $w\in W\_{0}^{{1,2}}(0,\pi)$.


Take any $u\in C^1[0,\pi/2]$ such that $u(0)=0$. For $x\in[0,\pi]$, let
$$w(x):=u(x)\,1(x\le\pi/2)+u(\pi-x)\,1(x>\pi/2). \tag{3}\label{3}$$
Then $w\in W\_{0}^{{1,2}}(0,\pi)$. So, by \eqref{3} and \eqref{2},
$$\int\_0^{\pi/2} u(x)^2\,dx
=\frac12\int\_0^\pi w(x)^2\,dx \le \frac12\int\_0^\pi w'(x)^2\,dx=\int\_0^{\pi/2} u'(x)^2\,dx,$$
which proves \eqref{1}. $\quad\Box$




---


*Remark 1:* That the condition $u'(\pi/2)=0$ can be dropped should be clear from the very beginning, because any $u\in C^1[0,\pi/2]$ such that $u(0)=0$ can be however closely approximated in $ W^{{1,2}}(0,\pi/2)$ by a function $v\in C^1[0,\pi/2]$ such that $v(0)=0$ and $v'(\pi/2)=0$.


*Remark 2:* In view of what has been said here, your statement "As you can see, the constant $1$ (better than $\pi^2/8$) can not be obtained by using only the condition $u(0)=0$" cannot be true. The "reason" why this statement of yours does not follow from your reasoning is that the Cauchy--Schwarz inequality in your reasoning and the inequality resulting from dropping $-\frac{s^2}2$ in the integrand cannot both turn into the corresponding equalities, for any nonzero $u\in C^1[0,\pi/2]$. Indeed, the equality in the Cauchy--Schwarz inequality in your reasoning holds only if $u'$ is almost everywhere equal to a constant $c$, and $c=0$ together with the condition $u(0)=0$ would imply $u=0$.


