Inequality for $C^1$ function: $|f(x)|^2 \le \frac{1}{2}\tanh \frac{1}{2}\int_0^1 (|f(x)|^2+|f'(x)|^2)\,dx$ Prove for $f\in C^{1}[0,1]$ such that $f(0) = f(1) = 0$, the following inequality:
$$|f(x)|^2 \le \left(\frac{1}{2}\tanh \frac{1}{2}\right)\left(\int_0^1 (|f(x)|^2+|f'(x)|^2)\,dx\right)$$
This is Problem $4.157$ from Problems in Mathematical Analysis.
 A: We may assume that $f(x)$ has the following expansion:
$$ f(x) = \sum_{n=1}^{+\infty}c_n \sin(2\pi n x) \tag{1} $$
from which it follows that:
$$ \int_{0}^{1}f(x)^2\,dx = \frac{1}{2}\sum_{n=1}^{+\infty}c_n^2, \tag{2}$$
$$ \int_{0}^{1}f'(x)^2\,dx = \frac{1}{2}\sum_{n=1}^{+\infty}4\pi^2 n^2 c_n^2. \tag{3}$$
Obviously:
$$ |f(x)|\leq\sum_{n=1}^{+\infty}|c_n|=\sum_{n=1}^{+\infty}\frac{1}{\sqrt{1+4\pi^2 n^2}}\left(|c_n|\sqrt{1+4\pi^2 n^2}\right),\tag{4} $$
so, using the Cauchy-Schwarz inequality:
$$|f(x)|^2 \leq 2\left(\sum_{n=1}^{+\infty}\frac{1}{1+4\pi^2 n^2}\right)\cdot\left(\int_{0}^{1}f(x)^2+f'(x)^2\,dx\right)\tag{5}$$
leading to:
$$|f(x)|^2 \leq \left(-1+\frac{1}{2}\coth\frac{1}{2}\right)\left(\int_{0}^{1}f(x)^2+f'(x)^2\,dx\right).\tag{6}$$
The constant so found is smaller than $\frac{1}{2}\tanh\frac{1}{2}$: probably the original proof was designed by expanding $f$ with respect to a different base of $L^2([0,1])\cap\{f:f(0)=f(1)=0\}$.
A: Since, $f(0) = f(1) = 0$,
We have, $\displaystyle \int_0^1 |f(x)|^2+|f'(x)|^2\,dx = \int_0^1|f(x) - f'(x)|^2\,dx$
Since, $\displaystyle e^{-x}f(x) = \int_0^x (f'(t) - f(t))e^{-t}\,dt$ using Cauchy-Schwarz Inequality we get:
$$e^{-2x}f^2(x) \le \frac{1-e^{-2x}}{2}\int_0^x|f'(t) - f(t)|^2\,dt$$
and, similarly: $$e^{-2(1-x)}f^2(x) \le \frac{1-e^{-2(1-x)}}{2}\int_x^1|f'(t) - f(t)|^2\,dt$$
Combining the two inequalities we get:
$\displaystyle \begin{align} (e^{x}\operatorname{cosech} x + e^{1-x}\operatorname{cosech} (1-x))f^2(x) &\le \int_0^1 |f'(t) - f^2(t)|^2\,dt \\&= \int_0^1 |f(x)|^2+|f'(x)|^2\,dx \end{align}$
Now, $\displaystyle \min\limits_{x \in [0,1]} (e^{x}\operatorname{cosech} x + e^{1-x}\operatorname{cosech} (1-x)) = 2\coth \frac{1}{2}$
Thus, $$|f(x)|^2 \le \left(\frac{1}{2}\tanh \frac{1}{2}\right)\int_0^1 |f(x)|^2+|f'(x)|^2\,dx$$
Note: As @Jack D'Aurizio mentions, the inequality is not sharp in this form. However problem statement says otherwise (referring to the problem statement in the book) and asks to prove further that the constant above cannot be improved.
A: The following is just heuristics, but indicates that ${1\over2}\tanh{1\over2}$ is the best constant, and that there is some error in Jack d'Aurizios calculations.
On account of symmetry we have to minimize
$$J:=\int_0^{1/2}\bigl(f^2(t)+f'^2(t)\bigr)\>dt$$
under the constraints $f(0)=0$, $f\bigl({1\over2}\bigr)=c>0$. Let $f$ be the minimizing function and consider a variation $t\mapsto \epsilon u(t)$ of $f$ with $u(0)=u\bigl({1\over2}\bigr)=0$. We have to look at
$$J_\epsilon:=\int_0^{1/2}\bigl((f(t)+\epsilon u(t))^2+(f'(t)+\epsilon u'(t))^2\bigr)\>dt$$
and have to ensure that
$$\eqalign{{d\over d\epsilon} J_\epsilon\biggr|_{\epsilon=0}&=2\int_0^{1/2}\bigl(f(t)u(t)+f'(t)u'(t)\bigr)\>dt\cr&=2\int_0^{1/2}\bigl(f(t)-f''(t)\bigr)u(t)\>dt\cr  &=0\ ,\cr}$$
and this for any admissible $u$. It follows that the minimizing function $f$ satisfies the differential equation $f-f''=0$, and together with $f(0)=0$ we obtain $f(t)=\sinh t$, up to a scalar multiple. Computing $$\lambda:={f^2\bigl({1\over2}\bigr)\over 2J(f)}$$for this $f$ results in $\lambda={1\over2}\tanh{1\over2}\doteq0.231059$.
