Proving the positivity of a twice-differentiable real-valued function This is a problem from Berkeley prelim exams, Spring '99 

Suppose that $ f $ is a twice differentiable real-valued function on
  $\mathbb{R}$ such that $ f(0) = 0 $, $ f'(0) > 0 $, and $ f''(x) \geq f(x) $ for all $ x \geq 0 $. Prove that
  $ f(x) > 0 $ for all $ x > 0 $.

Are there general techniques to solve problems like this? 
 A: The basic intuition is that in a neighbourhood of $0$, $f$ is positive. This leads to $f'$ being increasing (as $f'' > f$), and thus $f$ is increasing. If you picked the "leftmost" point where $f$ is 0, then in that interval, you need $f'$ to become $0$ at some point.
To formalize this, an elementary proof:
Since $f(0) = 0$, and $f'(0) \gt 0$, there is a $\delta \gt 0$ such $f(x) \gt 0$ for all $x \in (0, \delta)$. 
This we can see by using the $\epsilon-\delta$ definition of derivative and choosing $\epsilon = \frac{f'(0)}{2}$.
Now assume there is some point $y \gt 0$ where $f(y) \le 0$. This implies there is some point $y' \gt 0$ such that $f(y') = 0$ 
Now let $S$ be the set defined by $S = \{ y: y \ge \delta, f(y) = 0\}$.
Since S is bounded below, $c = \inf S$ (greatest lower bound) is well defined. By continuity of $f$ we have that $f(c) = 0$ (we can pick a sequence $c_n \to c$ and $c_n \in S$). Note that $c \ge \delta \gt 0$.
Now for any $0 \lt x \lt c$, we have that $f(x) \gt 0$. This is because, for $x \lt c$, we cannot have $f(x) = 0$ (as $c = \inf S$), and if $f(d) \lt 0$ for some $d$, then by continuity, there is a point $e \lt d \lt c$ such that $f(e) = 0$.
Thus for $x \in (0,c)$, we have $f(x) \gt 0$ and $f(0) = f(c) = 0$.
In this interval $f''(x) \ge f(x) \gt 0$. Thus $f'(x)$ is increasing, and since $f'(0) \gt 0$, we have that $f'(x) \gt 0$ for all $x \in (0,c)$.
But since $f(0) = f(c)$, we must have that $f'(\eta) = 0$ for some $\eta \in (0,c)$, by Rolle's theorem. 
A contradiction.
Thus there is no $y \gt 0$ for which $f(y) \le 0$.
A: Here is a proof using some magic: 
Put $f''(x)-f(x)=: u(x)\geq0$. Then $f$ is the solution of the initial value problem
$$y''  -y = u(x)\ ,\quad y(0)=0\ ,\quad y'(0)=f(0)>0\ .$$
This solution can be written explicitly in the form
$$f(x)\ =\ \int_0^x \sinh(x-t)\ u(t)\ dt + f'(0)\sinh x\ ,$$
as is easily checked. It follows that
$$f(x)\ \geq\ f'(0)\sinh x\qquad(x\geq 0)\ .$$
A: This is a solution taken from the book Berkeley Problems in Mathematics :third edtion by Paulo Ney De Souza and Jorge-Nuno Silva.
Suppose to the contrary that $f(x) \leqslant 0$ for some positive value $x$. Then $a=\inf\{x>0 : f(x)\leqslant 0\}$ is positive. Since $f$ is continuous, $f(a)=0.$ Let $0<b<a$, then $f(b)>0$. So by the mean value theorem, $\exists ~c$ in $(b,a)$ such that $$ f'(c)=\frac{f(a)-f(b)}{a-b} <0.$$ 
Again, by the mean value theorem, $\exists~ d$ in $(0,c)$ such that $$f''(d)=\frac{f'(c)-f'(0)}{c} <0.$$ 
But then, $0<d<a$ and $f(d) >0$. However, this contradicts the supposition that $f''(x)\geqslant f(x)$ $\forall~ x$ in $(0,a)$.
A: Since you asked for a general method, here it is ! And the result proved is much stronger.
Let $g$ denote the function $f''-f$, and consider the differential equation
$$ y''-y=g $$
Obviously $f$ is a solution of this equation.
Assuming that $g$ is locally integrable and using the variation of constants method, one can easily compute the general form of the solutions :
$$ f(t) = C_1 \sinh(t) + C_2 \cosh(t) + \sinh(t)\int_0^tg(x)\cosh(x)dx- \cosh(t)\int_0^tg(x)\sinh(x)dx$$
with $C_1$ and $C_2$ constants.
Evaluating this general solution and its derivative at zero shows that $C_2 = f'(0)$ and $C_2=0$.
More over
$$ \sinh(t)\int_0^tg(x)\cosh(x)dx- \cosh(t)\int_0^tg(x)\sinh(x)dx = \int_0^t\underbrace{g(x) \sinh(t-x)}_{>0} dx$$
As a conclusion
$$ \forall t > 0, f(t) > f'(0)\sinh(t)$$
Problem — Is $g$ locally integrable ?
The answer is YES, for the following reason.
Consider the function $h$ defined by
$$ h(t) = f'(t) - \int_0^t f(x)dx. $$
The function $h$ is differentiable and we have $h' = f'' - f \geq 0$. So $h'$ is monotonic (by mean value theorem), and thus absolutely continuous. By theorem 7.18 in Rudin (R&C analysis), $h'$ is locally integrable. And so is $g$.
A: A bit about the abstract nonsense behind the arguments (since there have been several proofs already, and since you asked about "general technique"). 
Most proofs of statements of this type relies on some type of induction argument. The most basic form is the principle of mathematical induction: let $P\subseteq \mathbb{N}$ be a subset satisfying that $1\in P$ and $p\in P\implies p+1 \in P$, then $P = \mathbb{N}$. 
This can be extended to the principle of transfinite induction: let $(X,<)$ be a well ordered set. Let $P\subseteq X$ be a set with the property that 
$$ \beta\in P \forall \beta < \alpha \implies \alpha \in P$$ 
then $P = X$. (A quick proof: suppose not. Then $X\setminus P$ is nonempty, hence since $X$ is well-ordered $\min X\setminus P$ exists. But that element satisfies $\beta < \min X\setminus P \implies \beta\not\in X\setminus P \implies \beta\in P$. This gives a contradiction. Note that trivially $\min X$ is in $P$ since the set of its predecessors is empty, and hence the induction hypothesis is vacuously true.)
Most sets we play with in real analysis, however, are not well-ordered (by the natural ordering). So we need to use some additional structure. A commonly used one is
Continuity argument
Let $(X,\tau)$ be a connected topological space (where $\tau$ is the topology). Then if $P\subseteq X$ satisfies


*

*$P$ is nonempty

*$P$ is open

*$P$ is closed


then $P = X$. 
Applied to your case, you have that $X = \mathbb{R}_+$ with the usual topology. Let $P := \{ x: f(x)>0\}$. Since $f$ is differentiable, it is continuous, and so $P := f^{-1}(\mathbb{R}_+)$ must be open. Using that $f'(0) > 0$ you have that $P$ is nonempty. Hence it remains to show that $P$ is closed. (To show directly that $P$ is closed is hard; what if $x_0$ is a limit point of $P$ approachable only from above? The actual proof given by Aryabhata and Nana via the intermediate value theorem is slightly different (and incorporates a refinement): noting that there exists some $a\in P$ such that $(0,a)\subset P$, in this case it is better to instead consider $P_0$, the connected component of $P$ containing $(0,a)$. Again we have that $P_0$ is open. So in the proof it suffices to show that $P_0$ is closed using the intermediate value theorem.)
(Note: the proof given by Aryabhata and Nana can also be phrased as an induction procedure based on order theory using that the topology and order of the real numbers are compatible, and where $P_0$ is naturally an initial segment, but I'll not go into details there: the basic idea, however, is still the same.)
A: Aryabhata posted an objection to Lierre's and Christian Blatter's answers. This is one way to fix the problem ... which still requires the mean value theorem. 


*

*The expression 
$$ f''(t) - f(t) = e^t\frac{d}{dt}\left( e^{-2t} \frac{d}{dt} e^t f\right) $$

*By the mean value theorem, if $u$ is differentiable with derivative $v$, then $u(b) - u(a) \geq (b-a) \inf_{[a,b]} v$; similarly $u(b) - u(a) \leq (b-a) \sup_{[a,b]} v$. 

*Therefore define $S_L(y,0;v)$ to be the lower Darboux sum of $v$ between $0$ and $y$, and similarly $S_U(y,0;v)$ to be the upper Darboux sum. We have that $S_L(y,0;y') \leq u(y) - u(0) \leq S_U(y,0;u')$ whenever $u$ is differentiable.  

*Using that the range of the exponential function is positive, we have that then if $f'' - f = g$ pointwise:
$$ f(x) - f(0) \geq \mathcal{G}_L(x,0;g,f') := e^{-x} S_L\left[ x,0; s \mapsto e^{2s} S_L\left( s,0; e^{-\cdot} g(\cdot)\right) + f'(0)\right] $$
Similarly defining $\mathcal{G}_U(x,0;g,f')$ using $S_U$ instead of $S_L$, we have that also
$$ f(x) - f(0) \leq \mathcal{G}_U(x,0;g,f')~.$$

*Using that Darboux sums are monotone (meaning that if $u \leq v$ then $S_L(y,0;u) \leq S_L(y,0;v)$ and similarly for the upper sum), we get the following result: if $f$ and $h$ are twice differentiable functions such that $f'' - f \geq h'' - h$ pointwise everywhere with $f'(0) \geq h'(0)$, then we have
$$ f(x) - f(0) \geq \mathcal{G}_L(x,0;h'' -h,h') $$
and
$$ h(x) - h(0) \leq \mathcal{G}_U(x,0;f'' -f,f') $$
In particular, if $h$ is twice continuously differentiable (or simply if $h'' - h$ is Riemann integrable), then the Darboux sums converge to the Riemann integral and which using the fundamental theorem of calculus we get that necessarily 
$$ f(x) - f(0) \geq h(x) - h(0)~. $$
The fact about comparing upper and lower Darboux sums against the "primitive" is standard. The key to being able to apply this result uses the fact that the linear differential equation can be formally solved by integrating factors, which is related to the fact that the ODE has signed Green's function. (In the study of linear partial differential equations, the fact that the Green's function has a sign is closely connected to the existence of some form of maximum principle. )
A: Integrating both sides of the inequality between $[0,t]$ gives $$ f'(t)-f'(0) \geq \int^t_0 f(x) dx. $$ Suppose there exists positive $y$ such that $f(y)\leq 0.$  There first two conditions imply that there exists some $t_0>0$ where $ f(t) > 0 $ holds for all $ t \in (0,t_0).$ Let $t_1$ be the supremum of all such $t_0.$ Since $f$ is positive but then goes back to $0$, $f'(t_2) < 0 $ for some $ t_2 \in (0,t_1) $. But this contradicts $$ f'(t_2) \geq f'(0) + \int^{t_2}_0 f(x) dx \geq 0. $$
