Lyapunov inequality for BVPs In some papers, it is said that Lyapunov [1, p. 406] proved the following result.
Let $p:[a,b]\to\mathbb{R}$ be a continuous nonnegative function.
If the BVP
\begin{align}
y^{\prime\prime}+p(t)y=0,\quad{}t\in[a,b]\\
y(a)=0\quad\text{and}\quad{}y(b)=0
\end{align}
has a nontrivial solution,
then
\begin{equation}
(b-a)\int_{a}^{b}p(s)\mathrm{d}s>4.
\end{equation}
Further, $4$ is the best possible constant.
I have no problem with the inequality
but the best possible constant $4$.
Can you show me or redirect me to a proof showing that
$4$ is the best possible?

Reference
[1]  A. Lyapunov, Probleme General de la Stabilite du Mouvement, Ann. Math. Studies 17, Princeton Univ. Press (1949) (reprinted from Ann. Fac. Sci. Toulouse, 9 (1907) 203--474, Translation of the original paper published in Comm. Soc. Math. Kharkow, 1892).
 A: Consider the following function
\begin{equation}
y(t):=
\begin{cases}
\frac{1}{1-\delta}(1-|1-2t|),&0\leq{}t\leq\frac{1}{2}-\delta\ \text{or}\ \frac{1}{2}+\delta\leq{}t\leq1\\
1-\frac{(1-2t)^{2}}{4\delta(1-\delta)},&\frac{1}{2}-\delta\leq{}t\leq\frac{1}{2}+\delta,
\end{cases}\label{eqn1}\tag{1}
\end{equation}
where $\delta\in(0,\frac{1}{2})$ (see Figure 1).

From \eqref{eqn1}, we see that $y$ satisfies
\begin{equation}
\left\{
\begin{gathered}
y^{\prime\prime}(t)+p(t)y(t)=0\quad\text{for}\ 0\leq{}t\leq1\\
y(0)=0\ \text{and}\ y(1)=0,
\end{gathered}
\right.\nonumber
\end{equation}
where
\begin{equation}
p(t):=
\begin{cases}
0,&0\leq{}t\leq\frac{1}{2}-\delta\ \text{or}\ \frac{1}{2}+\delta\leq{}t\leq1\\
\frac{2}{t^{2}-t+(\frac{1}{2}-\delta)^{2}},&\frac{1}{2}-\delta\leq{}t\leq\frac{1}{2}+\delta.
\end{cases}\label{eqn2}\tag{2}
\end{equation}
From \eqref{eqn2}, we compute that
\begin{equation}
\begin{aligned}[]
1\int_{0}^{1}p(s)\mathrm{d}s
={}&\frac{1}{\sqrt{\delta(1-\delta)}}\ln\Biggl(\frac{t-\frac{1}{2}\bigl(1-2\sqrt{\delta(1-\delta)}\bigr)}{t-\frac{1}{2}\bigl(1+2\sqrt{\delta(1-\delta)}\bigr)}\Biggr)\Biggr|_{\frac{1}{2}-\delta}^{\frac{1}{2}+\delta}\\
={}&\frac{1}{\sqrt{\delta(1-\delta)}}\ln\Biggl(\frac{1+2\sqrt{\delta(1-\delta)}}{1-2\sqrt{\delta(1-\delta)}}\Biggr)=:\ell(\delta).
\end{aligned}\nonumber
\end{equation}

Readily, $\ell(\delta)>4$ for $\delta\in(0,\frac{1}{2})$, and $\ell(\delta)\searrow4$ as $\delta\searrow0$ (see Figure 2),
which proves that $4$ is the best possible constant. $\blacksquare$
