# Need Ideas for Solving Differential Equation

I need to solve a differential equation on the following form

$$\frac{d^2 f(x)}{dx^2}=A\sin(f(x))+B\cos(f(x))$$

Where $A$ and $B$ are constants. I am not sure how to approach this, which method to use etc. And I am not even sure if it is possible to solve analytically.

-
Let $y=f(x)$. Multiply both sides by $\dfrac{dy}{dx}$. This is a general trick. With these particular functions one can undoubtedly do better. – André Nicolas Oct 17 '12 at 20:24
Ok, where does that lead me? $\frac{d^3 y}{dx^3}=\frac{d y}{dx}(Asin(y)+Bcos(y))$ – gamma4 Oct 17 '12 at 20:30
Will this be a good way to approach this? $d^2 y=(Asin(y)+Bsin(y))dx^2$ don't think so.. – gamma4 Oct 17 '12 at 20:36
Robert Israel has given some of details. When you multiply both sides by $\frac{dy}{dx}$, the left side is the derivative of $(1/2)\left(\frac{dy}{dx}\right)^2$, the right is the derivative of $-A\cos y+B\sin y$. So we get $(1/2)\left(\frac{dy}{dx}\right)^2=-A\cos y+B\sin y +C$. – André Nicolas Oct 17 '12 at 21:37

With $y = f(x)$ and $v = df/dx$, this autonomous second-order DE becomes $$\dfrac{dv}{dy} = \frac{A \sin(y) + B \cos(y)}{v}$$ and that is separable, so $$\frac{v^2}{2} = \int (A \sin(y) + B \cos(y)) \ dy = - A \cos(y) + B \sin(y) + C$$
Yes, I did something similar and came this far $\int (2(Bsin(y)-Acos(y)+C_1)^{-1/2} \ dy=x+C_2$ Is this correct? – gamma4 Oct 17 '12 at 21:01
@gamma4: What Robert did was: $y=f(x)$ and $y'=v$ so when the variable is not included in your second order equation, you can use the chain rule to set your equation to $y$ and $y'$. So you have $\frac{d^2y}{dx^2}=\frac{dy'}{dx}=\frac{dy'}{dy}.\frac{dy}{dx}$. This means that $y''=vv'$. Now continue from the first fraction he made above (+1). – Babak S. Oct 17 '12 at 21:19
Yes. You might also note that $B \sin(y) - A \cos(y) = K \sin(y-y_0)$ for appropriate constants $K$ and $y_0$. The antiderivative is not elementary: it is related to an incomplete elliptic integral. – Robert Israel Oct 17 '12 at 23:47