Elementary inequality generalizing convexity of a function on a segment

Here's another argument using Sturm-Liouville theory.

Given $b - \pi < a \le x \le b$, let $$ f(x) = \sin (x - b + \pi). $$ Observe that $f > 0$ and $f'' + f = 0$ on $[a,b)$, $f(a) > 0$, $f(b) = 0$, and $f'(b) = -1$.

Since \begin{align*} (fg'-f'g)' &= (g'' + g)f - (f''+f)g \le 0\\ (fg'-f'g)(b) &= f(b)g'(b) - f'(b)g(b) = g(b) \ge 0, \end{align*} it follows that, on $[a,b]$, $$ fg' - f'g \ge 0. $$ and therefore, on $[a,b)$, \begin{align*} \left(\frac{g}{f}\right)' &= \frac{fg' - gf'}{f^2} \ge 0. \end{align*} Since $$ \frac{g(a)}{f(a)} \ge 0, $$ it follows that, on $[a,b)$, $$ \frac{g}{f} \ge 0. $$


Write $g=g^+-g^-$ in $[0,\ell]$, multiply $g''+g \le 0$ by $g^-$ (which vanishes at the the endpoints) and integrate. Then we get with $v=g^-$ $$ \int_0^l v'^2- \int_0^l v^2 \le 0.$$ Since the first eigenvalue of the Dirichlet laplacian in $[0,\ell]$ is $\pi^2/\ell^2 $ we have also $$ \int_0^l v^2 \le \frac{\ell^2}{\pi^2} \int_0^l v'^2 $$ and then $v=g^-=0$, since $\ell <\pi$.


Suppose the contrary, so that $g(s)<0$ for some $s\in(a,b)$. Replacing now $a$ and $b$ by $\max\{t\in[a,s)\colon g(t)\ge0\}$ and $\min\{t\in(s,b]\colon g(t)\ge0\}$, respectively, we see that without loss of generality (wlog) \begin{equation} g(a)=0=g(b). \end{equation} Also, by a horizontal shift, wlog \begin{equation} a=0,\quad b\in(0,\pi). \end{equation}

Let \begin{equation} h:=-(g''+g)\ge0. \end{equation} Then \begin{equation} G(t):=G_b(t):=g(t)\sin b=\sin t\,\int_0^b du\,h(u)\sin(b-u) -\sin b\,\int_0^t du\,h(u)\sin(t-u). \end{equation} We have to show that $G\ge0$ on $[0,b]$. Because the nonnegative function $h$ can be however closely approximated in $L^1$ by conical combinations of the indicators of intervals, wlog $h=1_{[c,d]}$ for some $c,d$ such that $0<c<d<b$, in which case \begin{equation} G(t)=\sin t\, (\cos (b-d)-\cos (b-c))-\sin b\, (\cos (t-\max (c,\min (d,t)))-\cos (c-t)). \end{equation} So, if $0\le t\le c$, then $G(t)=\sin t\, (\cos (b-d)-\cos (b-c))\ge0$. The case $d\le t\le b$ is similar, by the left-to-right symmetry.

It remains to consider the case when $c\le t\le d$. Then \begin{equation} G''(t)=\sin t\, (\cos b\, (\cos c-\cos d)-\sin b\, \sin d)-\sin b \cos c\,\cos t =A\sin(t+C)=:f(t), \end{equation} where $A,C$ depend only on $b,c,d$. The function $f$ will be $\le0$ on the interval $[c,d]$ of length $<\pi$ iff $f(c)\le0$ and $f(d)\le0$. In our case, we have \begin{equation} 2f(c)=\sin (b-c-d)-\sin (b+c-d)-\sin (b-2 c)-\sin (b) \end{equation} and hence $(f(c))'_d=-\sin c\, \sin (b-d)\le0$, so that $f(c)$ decreases in $d$. So, wlog $d=c$, in which case $f(c)=-\sin b\le0$. Thus, $f(c)\le0$ always, that is, for all $d\in[c,b]$. Similarly, by the left-to-right symmetry, $f(d)\le0$, which completes the proof.