TITLE: Solve second order DE: $\sin^2 x\frac{d^2y}{dx^2} = 2y$
QUESTION [6 upvotes]: Solve:
$$\sin^2 x \frac{d^2y}{dx^2} = 2y $$

So what I did was separation of variables, it got me $$\frac{y''} {2y}= \csc^2 x$$
and integrating both sides will give
$$\frac{y'}{2y}= -\cot x+ C $$
On another integration we will get
$$\frac{\ln y}{2} = -\ln(\sin x) + Cx + K$$
then we get
$$\ln y = -2\ln(\sin x) + 2Cx + 2K$$
and so my answer is
$$y = e^{-2\ln(\sin x) + 2Cx}$$
but I believe it is wrong.

REPLY [3 votes]: The ODE is $$\frac{d^2y(x)}{dx^2}-2\csc^2x~~ y(x)=0$$
$y_1(x)=\cot x$ can be checked to satisfy this ODE.
The other solution of this ODE can be found as $y+2(x)=y_1(x) z(x)$,
where $$z(x)=\int \frac{dx}{y_1^2(x)}-\int \tan^2 x dx=\sec x-x$$
So $$y_2(x)=\cot x(\tan x-x)=1-x\cot x$$
So two linearly independent solutions of the given ODE are:
$$y_1(x)=\cot x,~~ y_2(x)=1-x \cot x$$