$x^2y''-2xy'+(x^2+2)y=0, x>0, y_1(x)=xsinx$
I found
$y_2(x)=u(x)xsinx$
$y_2' =u'xsinx+usinx+uxcosx$
$y_2''=u''xsinx+2u'sinx+2u'xcosx+2ucosx-uxsinx$ (collected terms)
But when I substitute these back into the original differential equation, I get a REALLY messy answer. Have any idea if I did something incorrectly? I appreciate any help/walkthrough of this problem!
Maybe it will help to rewrite things as
$$y_2''=u''x\sin x+u'(2\sin x+2x\cos x)+u(2\cos x-x\sin x)$$ $$y_2'=u'x\sin x+u(\sin x+x\cos x)$$ $$x^2y_2''-2xy_2'+(x^2+2)y_2=u''x^3\sin x+u'(2x^2\sin x+2x^3\cos x-2x^2\sin x)+$$ $$u(2x^2\cos x-x^3\sin x-2x\sin x-2x^2\cos x+x^3\sin x+2x\sin x)=0$$
The $u$ term cancels out as it should since $kx\sin x$ is supposed to be a solution. All you are left with is
$$u''x^3\sin x+2u'x^3\cos x=0$$ $$u''+\frac{2\cos x}{\sin x}u'=0$$ Integrating factor should be relatively easy.
$$u''\sin^2x+2u'\sin x\cos x=0$$ $$u'\sin^2x=a,u'=a\csc^2x$$ $$u=a_2\cot x+k$$
So the complete solution should be $$y=(a_2\cot x+k)x\sin x=a_2x\cos x+kx\sin x$$