<s>[INST] Solving $xy''-y'+4x^3y=0$ I need to solve
$$xy''-y'+4x^3y=0$$
by reduction or order, knowing one solution is $y=\sin x^2$. That's what I did:
$y_2 = v(x)\sin x^2\implies \\y_2' = v'\sin x^2+2xv\cos x^2\implies\\y_2'' = v''\sin x^2+2xv'\cos x^2+2(-2vx^2\sin x^2+v'x\cos x^2+v\cos x^2)$
Then, 
$$xy_2''-y_2'+4x^3y_2 = \\xv''\sin x^2+2x^2v'\cos x^2-4vx^3\sin x^2+2x^2v'\cos x^2+2xv\cos x^2-v'\sin x^2-2vx\cos x^2+4x^3v\sin x^2 = \\$$
$$xv''\sin x^2+4v'x^2\cos x^2-v'\sin x^2$$
which seems like a difficult equation to solve, so I guess it's wrong. Also, wolfram alpha says the solution for $v$ is $c_1\cot x^2+c_2$, but my book says that $y_2$ is $\cos x^2$. What did I do wrong?
 [/INST] $y=\sin x^2 \int v(x) dx $
$y' =2x \cos x^2 \int v(x) dx +v(x)\sin x^2 $
$y''=2\cos x^2 \int v(x) dx -4x^2 \sin x^2 \int v(x) dx +2x v(x)\cos x^2 +v'(x)\sin x^2 +2xv(x) \cos x^2 $
so 
$xy'' -y' +4x^3 y =x\left(2\cos x^2 \int v(x) dx -4x^2 \sin x^2 \int v(x) dx +2x v(x)\cos x^2 +v'(x)\sin x^2 +2xv(x) \cos x^2\right) - \left(2x \cos x^2 \int v(x) dx +v(x)\sin x^2\right) +4x^3 \sin x^2 \int v(x) dx =4x^2 v(x)\cos x^2 +xv'(x) \sin x^2 -v(x) \sin x^2$
hence 
$\frac{v'}{v} =\frac{1}{x} +4x\cot x^2 $
thus 
$\ln v = \ln x +2\ln |\sin x^2 |+ \ln C$
</s>