If $f''(x)+f(x)>0$ and $f(x)>0$ $\forall x\in(a,b)$; $f(a)=f(b)=0$; prove that $b-a>\pi$. Please help me to solve this question:

Suppose $f:[a,b] \to \Bbb R$ satisfies:

*

*$f''(x)+f(x)>0$ and $f(x)>0$ for all $x\in(a ,b)$;

*$f(a)=f(b)=0$.

Prove that $b-a>\pi$.

Thanks in advance.
 A: I think I have a solution when $f''$ is assumed to be continuous. 
When $x\in (a,b)$, we have that $\sin\left(\frac{x-a}{b-a}\pi\right)>0$ so using the first assumption,
$$0<\int_a^bf(x)\sin\left(\frac{x-a}{b-a}\pi\right)dx+\int_a^bf''(x)\sin\left(\frac{x-a}{b-a}\pi\right)dx=I_1+I_2\tag{1}.$$
We have, integrating by parts and using $f(a)=f(b)=0$ that 
$$I_1=-\frac{\pi}{b-a}\left(\int_a^b-f'(x)\cos\left(\frac{x-a}{b-a}\pi\right)dx.\right)$$
Doing the same for $I_2$, we finally get 
$$\small 0<\left(\frac{(b-a)^2}{\pi^2}-1\right)\int_a^bf'(x)\cos\left(\frac{x-a}{b-a}\pi\right)=\left(\frac{(b-a)^2}{\pi^2}-1\right)\int_a^bf(x)\sin\left(\frac{x-a}{b-a}\pi\right)dx.$$
As $\int_a^bf(x)\sin\left(\frac{x-a}{b-a}\pi\right)dx>0$, we are done.
A: My answer is under the assumption that $f$ and $f'$ are continuous on $[a,b]$ and $f''$ exists on $(a,b)$. 
Define
$$g:[a,b]\to \mathbb{R}, \quad x\mapsto f'(x)\sin(x-a)-f(x)\cos(x-a).$$
By definition, $g$ is continuous on $[a,b]$ and differentiable on $(a,b)$. Moreover, since $f(a)=f(b)=0$, $g(a)=0$ and $g(b)=f'(b)\sin(b-a)$. Then by mean value theorem, there exists $c\in(a,b)$, such that
$$\frac{f'(b)\sin(b-a)}{b-a}=\frac{g(b)-g(a)}{b-a}=g'(c)=(f''(c)+f(c))\sin(c-a).\tag{1}$$
On the one hand, beacause $f(x)>0$ on $(a,b)$ and $f(b)=0$, $f'(b)\le 0$; on the other hand, $f''(c)+f(c)>0$. Combing these facts with $(1)$, we can conclude that $b-a>\pi$.
Edit: After reading Sanchez's answer, I realized that without assuming that $f$ is differentiable at $a,b$, the proof can be modified as follows.
Assume that $b-a\le \pi$. Then $g$ is differentiable on $(a,b)$ and 
$$g'(x)=(f''(x)+f(x))\sin(x-a)>0.$$ 
Therefore, $g$ is strictly increasing on $(a,b)$. As a result, both 
$$g(a^+):=\lim_{x\to a^+} g(x)=\lim_{x\to a^+}f'(x)\sin(x-a)$$
and
$$g(b^-):=\lim_{x\to b^-} g(x)=\lim_{x\to b^-}f'(x)\sin(x-a)$$
exist, and $g(b^-)>g(a^+)$.
However, since $f(x)>0$ on $(a,b)$ and $f(a)=f(b)=0$, by mean value theorem, 
$$\limsup_{x\to a^+}f'(x)\ge\liminf_{x\to a^+}\frac{f(x)-f(a)}{x-a}\ge 0 $$
and 
$$\liminf_{x\to b^-}f'(x)\le\limsup_{x\to b^-}\frac{f(x)-f(b)}{x-b}\le 0 .$$
It follows that $g(a^+)\ge 0\ge g(b^-)$, a contradiction.
A: Some information is missing in the question, otherwise there are some counterexamples:


*

*Let $a = b = 0$ and $f(0) = 0$. This function has the desired properties (there is no $x \in (a,b)$, but $b - a = 0$. Note that this function is even continuous...

*Let $f(a) = f(b) = 0$ and $f(x) = 1$ for $x \in (a,b)$. Of course, this function lacks continuity in $a$ and $b$, but it is smooth in $(a,b)$. Now, $a$ and $b$ can be chosen arbitrarily.
A: Edit: This answer requires that all integrals are well defined, which will be the case if $f''$ is continuous, as in Davide's answer.
Edit 2: Switched back to the original bounds $a$ and $b$ after comment of OP.
By partial integration (twice) we have $$\int_a^b f''(x)\sin(x - a)dx = f'(b) \sin(b-a) - \int_a^b f(x) \sin(x-a) dx$$ and so $$\int_a^b\left(f(x) + f''(x)\right) \sin(x-a) dx = f'(b) \sin(b-a).$$  Since $f'(b) \leq 0$ this is impossible if $b-a < \pi$.
A: Clearly, the statement can only be true if $a < b$ and $f$ is continuous on $[a,b]$. We will work with this assumption.
Lemma 1 $\liminf_{x \to a^+} f'(x)$ is bounded below.
Lemma 2 $\liminf_{x \to b^-} f'(x) \leq 0$.
Proof of the problem assuming the lemma
Assume the contrary that $b-a \leq \pi$. Consider $g(x) = \sin (x-a)f'(x) - f(x) \cos (x-a)$. Then $\lim_{x \to a^+} g(x) \ge 0$ by lemma 1, and for $x \in (a,b)$,
$$g'(x) = (f(x) + f''(x)) \sin(x-a) > 0$$
since $b-a \leq \pi$. Therefore $g$ is increasing on $(a,b)$, so $g > 0$ on this interval, which implies that $\displaystyle \lim_{u \to b^-} g(u) > 0$. But if $u_n \to b^-$, $lim_{n \to \infty} f'(u_n) \leq 0$, then
$$\lim_{n \to \infty} g(u_n) = \lim_{n \to \infty} \sin(u_n - a)f'(u_n) - \lim_{n \to \infty} f(u_n) \cos (u_n - a) \leq 0$$
by lemma 2. Contradiction.
Proof of Lemma 1
For the sake of contradiction assume that $\liminf_{x \to a^+} f'(x) = -\infty$. 

Sublemma This implies that $\lim_{x \to a^+} f'(x) = -\infty$.
Proof Let $f(x) < M$ on $[a,b]$. The condition $f''(x) > -f(x)$ on $(a,b)$ gives that for $u < v \in (a,b)$,
  $$f'(v) - f'(u) = \int_u^v f''(x)dx > -\int_u^v f(x)dx > -M(v-u)$$
  Let $1 > \epsilon > 0$ be suitably small. If the limit does not exist, then there exists  $u_n \in (a,a+\epsilon)$, $u_n \to a^+$ satisfies $\lim_{n \to \infty} f'(u_n) > C$ for some constant $C$. Then for any $v \in (a,a+\epsilon)$, for large enough $n$ we have $u_n < v$, then 
  $$f'(v) - f'(u_n) > -M(v - u_n) > -M\epsilon$$
  which implies that $f'(v) > C - M\epsilon$ for $v$ close to $a$, contradicting $\liminf_{x \to a^+} f'(x) = -\infty$.

Now suppose that for $1 > \epsilon > 0$, and $x \in (a,a+\epsilon)$, $f'(x) < N \ll 0$. Then for $x < y \in (a,a+\epsilon)$, 
$$f(y) - f(x) = f'(c)(y-x) < N(y-x) < N\epsilon < 0$$
for some $c$ between $x,y$. By continuity at $a$, $f(y) = f(y) - f(a) \leq N\epsilon < 0$, contradicting $f(y) > 0$ for all $y \in (a,b)$.
Proof of Lemma 2
For the sake of contradiction, assume that for $u \in (b - \epsilon, b)$, $f'(u) > N > 0$ where $N$ is a constant, and $\epsilon > 0$ is sufficiently small. Then for $u < v \in (b-\epsilon, b)$, 
$$f(v) - f(u) = f'(c)(v-u) > N(v-u)$$
for some $c$ between $u$ and $v$. Fix $u$, and let $v \to b^-$, we then get
$$0 > -f(u) = f(b) - f(u) \ge N(b-u) > 0$$
Contradiction. 
