Let $u \in H_0^1(a,b)$, then I know that $$||u||_{0,2}\leq\frac{b-a}{\sqrt{2}} |u|_{1,2}^2 $$
How can I show that I can improve the constant in the inequality to $\frac{b-a}{\pi}$?
I feel like proving the inequality above where I first show that $|u(x)|^2 \leq (x-a)|u|_{1,2}^2$ by using the Cauchy-Schwartz inequality and then conclude $$||u||_{0,2}^2=\int_a^b|u(x)|^2 \ dx \leq \int_a^b (x-a) \ dx |u|_{1,2}^2 =\frac{(b-a)^2}{2} |u|_{1,2}^2 $$ does not hint me to any improvements of the constant. Any suggestions?
I now found out that we get equality by chosing $u(x)=\sin(\frac{x-a}{b-a}π)$