An ODE with trigonometric coefficients Anyone knows how to solve the following equation:
$\cos(x) V(x) + \sin(x) V'(x) - V''(x) = 0$
with an arbitrary initial condition, let's say $V(0)= 1$.
Thanks ;)
 A: Note that the first two terms form a product derivative to recognize that your ODE is equal to
$$
0=(\sin(x)V(x))'-V''(x)=-(V'(x)-\sin(x)V(x))'
$$
which can now be easily integrated, since the integrating factor $e^{\cos x}$ for the second, inner integration has already been guessed.
A: We can rewrite it as follows: $$(\sin(x)V(x))' - V''(x)=0.$$ Integrating, this gives us $$\sin(x)V(x)=V'(x)+C\tag{$\ast$}$$ where $C$ is a constant.
For $C=0$ (homogeneous case), this gives us $$\sin(x) = \frac{V'(x)}{V(x)}=\left(\log V(x)\right)',$$ which yields $$\log V(x) = -\cos(x)+\widetilde E,$$ or $$V(x)=Ee^{-\cos(x)}.$$ Now, use this solution to solve the inhomogeneous equation $(*)$: we will look for solutions of the form $V(x)=E(x)e^{-cos(x)}$. Plugging this into $(*)$, we get $$\sin(x)E(x)e^{-\cos(x)}=E'(x)e^{-\cos(x)}+E(x)e^{-\cos(x)}\sin(x)+C.$$ This gives us $$E'(x)=-Ce^{\cos x},$$ so $$E(x)=-C\int_0^xe^{\cos t}{\rm d}t+D$$ and (since we know from the theory that the solutions will form a two-dimensional vector space) the general solution of the equation is $$V(x)=\left(-C\int_0^xe^{\cos t}{\rm d}t+D\right)e^{-\cos x}.$$
