TITLE: How to prove $f\equiv 0$ $\forall x\in [a,b]$?$\quad$($f''＋pf'＋qf＝0$ with $f(a)＝f(b)＝0$)
QUESTION [5 upvotes]: Define $f \in C^{2}[a,b]$ satisfying $f''＋pf'＋qf＝0$ with $f(a)＝f(b)＝0$, where $p\in C^{0}[a,b]$ and $q\in C^{0}[a,b]$ are two functions. 
If $q\leq0$, can we prove $f\equiv 0$ $\forall x\in [a,b]$ ?
My try:
If $f\not\equiv 0$, without loss of generality, we assume that the maximum of $f$ on $[a,b]$ is greater than zero, while notating $f(x_0)＝\displaystyle\max_{[a,b]} f$.
Then we have $f(x_0) > 0$, $f'(x_0) ＝ 0$ and $f''(x_0) \leq 0$.
I figured out that if we alter the condition $q\leq0$ into $q(x)<0$ there evidently exists contradiction. 
But how to analyze further with the condition $q\leq0$? Can we still find contradiction if $q(x_0)＝0$ and $f''(x_0)＝0$ ?
Any ideas would be highy appreciated!

REPLY [2 votes]: The following is based on the classical proof of the maximum principle.
Let $L(f)=f''+p\,f'+q\,f$.  If $L(f)>0$, then your argument shows that $f$ must be identically $0$.
But we have $L(f)=0$, not $>0$. What can we do? Take $M>0$ such that $M^2+M\,p(x)+q(x)>0$ for all $x\in[a,b]$ and let $\epsilon>0$. Then
$$
L(f+\epsilon\,e^{Mx})=\epsilon\,e^{Mx}(M^2+M\,p(x)+q(x))>0\quad\forall x\in[a,b].
$$
Then
$$
\max_{a\le x\le b}(f+\epsilon\,e^{Mx})=\max\bigl(f(a)+\epsilon\,e^{Ma},f(b)+\epsilon\,e^{Mb}\bigr)=\epsilon\,e^{Mb}.
$$
Letting $\epsilon\to0$ gives the desired result.