TITLE: Why is the solution of $y''=\cos(x)/y$ increasing?
QUESTION [5 upvotes]: I am studying the equation:

$$ y''=\frac {\cos(x)}y$$

, with y(0)>>1 and y'(0)=0. I can't find an exact solution so I calculated it using Runge-Kutta. Intuitively I expect an oscillatory function where the average value remains constant, since y" is oscillatory. However, the solution I get is increasing. It looks roughly like

$$y(x)= y_0+x+\cos(x)$$

Am I doing something wrong or is this the real behavior? And if so, can anyone try to find an explanation of why it would be increasing? I also found that it seems extremely sensitive to the initial value y'(0). If this is negative then the solution is decreasing (this is intuitively so), but I don't get why it is so sensitive, i.e. y'(0)=-0.001 and y(0)=10 will make the solution decreasing.
Thank you for any help.

REPLY [2 votes]: Suppose we restrict to an interval on which $y > 0$, so we may write
$$  y'' y = \cos x  $$
then recognize $(y' y)' = y'' y + (y')^2$ and add $(y')^2$ to both sides, producing
$$  (y' y)' = \cos x + (y')^2  \text{.}  $$
Now let us look at the average behaviour over any one period of cosine.  \begin{align*}
\frac{1}{2\pi} & \int_x^{x+2\pi} \; (y'(t) y(t))' \,\mathrm{d}t  \\
&= \frac{1}{2\pi}\left( y(x+2\pi)y'(x+2\pi) - y(x)y'(x) \right)  \text{,}  \\
\frac{1}{2\pi} & \int_x^{x+2\pi} \; \cos(t) + (y'(t))^2 \,\mathrm{d}t  \\
&= \frac{1}{2\pi} \left( 0 + \int_x^{x+2\pi} \; (y'(t))^2 \,\mathrm{d}t \right)  \\
&\geq 0  \text{.}
\end{align*}
Putting these together, 
$$  y(x+2\pi)y'(x+2\pi) \geq y(x)y'(x)  \text{.}  $$
Your intuition tells you $y'$ is (approximately) oscillatory with period $2\pi$, giving $y(x+2\pi) \gtrsim y(x)$, so you expect $y$ oscillates with amplitude $1/y$ and slowly trends upwards.
This is what we see in the solution.  For instance, with $y(0) = 100$,