$xy''-(2x^2+1)y'=x^5e^{x^2}$ $xy''-(2x^2+1)y'=x^5e^{x^2}$

Hi there,
needs help with the second order ODE.
I've tried (for the homogenous part) to substitute $\frac{dy}{dx} =u$ to get $ u'-(2x+\frac{1}{x})u=0$
solving for the first non trivial solution
$y_1=C_1 e^{x^2}$
however with $y_2$ and the particular solution i stuck.
asks for help.
 A: $$y'(x)=u(x)$$
$$x u'(x)-\left(2 x^2+1\right) u(x)=0$$
$$u(x)=c_1 e^{x^2} x$$
$$y(x)=\int c_1 e^{x^2} x\,dx=\frac{c_1 e^{x^2}}{2}+c_2$$
To solve the non homogeneous equation $$xy''-(2x^2+1)y'=x^5e^{x^2}$$
we guess the particular solution as $y_1(x)=(a x^4+b x^3+c x^2+d x+e)e^{x^2}$
$$y_1'(x)=2 e^{x^2} x \left(a x^4+b x^3+c x^2+d x+e\right)+e^{x^2} \left(4 a x^3+3 b x^2+2 c x+d\right)=\\=e^{x^2} \left(2 a x^5+4 a x^3+2 b x^4+3 b x^2+2 c x^3+2 c x+2 d x^2+d+2 e x\right)$$
$$y_1''(x)=2 e^{x^2} \left(2 a x^6+9 a x^4+6 a x^2+2 b x^5+7 b x^3+3 b x+2 c x^4+5 c x^2+c+2 d x^3+3 d x+2 e x^2+e\right)$$
So plugging this in the equation we get
$$8 a x^5+6 b x^4+ x^3 (8 a+4 c)+x^2 (3 b+2 d)-d\equiv x^5e^{x^2}$$
$a=\frac18;\;c=-\frac{1}{4}$ so the particular solution is
$$y_1=\frac{1}{8} e^{x^2} x^2 \left(x^2-2\right)$$
The general solution of the DE is
$$y=\frac{c_1 e^{x^2}}{2}+c_2+\frac{1}{8} e^{x^2} x^2 \left(x^2-2\right)$$
$$y=\frac{1}{8} e^{x^2} \left(x^4-2 x^2+4 c_1\right)+c_2$$
A: $$xy''-(2x^2+1)y'=x^5e^{x^2}$$
$$(xy''-y')-2x^2y'=x^5e^{x^2}$$
$$\dfrac {(xy''-y')}{x^2}-2y'=x^3e^{x^2}$$
$$\left (\dfrac {y'}{x}\right)'-2y'=x^3e^{x^2}$$
Better to substitute $u=x^2$:
$$\left (2 {y'}\right)'-2y'=\dfrac 12ue^{u}$$
$$\left ( {y'e^{-u}}\right)'=\dfrac u4$$
$$y'e^{-u}=\dfrac {u^2}8+c_1$$
$$y'=\dfrac {u^2}8e^u+c_1e^u$$
$$y(u)=\dfrac 18\int  {u^2}e^u \, du+c_1e^u+c_2$$

Edit1
$$\left (\dfrac {y'}{x}\right)'-2y'=x^3e^{x^2}$$
Note that:
$$y'=\dfrac {dy}{dx}=\dfrac {dy}{dx^2}\dfrac {dx^2}{dx}=2x\dfrac {dy}{du}$$
$$\implies \left (\dfrac {y'}{x}\right)=2\dfrac {dy}{du}$$
And:
$$\dfrac {d}{dx}\left (\dfrac {y'}{x}\right)=2\dfrac {d}{dx}\dfrac {dy}{du}$$
$$\dfrac {d}{dx}\left (\dfrac {y'}{x}\right)=2\dfrac {d}{du}\dfrac {dy}{du}\dfrac {du}{dx}$$
$$\dfrac {d}{dx}\left (\dfrac {y'}{x}\right)=2\dfrac {d^2y}{du^2}\dfrac {du}{dx}$$
And $\dfrac {du}{dx}=2x$ since $u=x^2$.
Now we have: $$
4x\dfrac {d^2y}{du^2}-4x\dfrac {dy}{du}=x^3e^{x^2}$$
Divide the equation by $x$ you have:
$$
4\dfrac {d^2y}{du^2}-4\dfrac {dy}{du}=x^2e^{x^2}$$
Substitute $u=x^2$
$$
4\dfrac {d^2y}{du^2}-4\dfrac {dy}{du}=ue^{u}$$
$$
\dfrac {d^2y}{du^2}e^{-u}-\dfrac {dy}{du}e^{-u}=\dfrac u 4$$
So that the differential equation is simply:
$$
\boxed {(y'e^{-u})'=\dfrac u 4}$$
And it's easy to solve it.
A: Set $z:=y^\prime$ so $z^\prime+Pz=Q$ with $P=-2x-1/x,\,Q=x^4e^{x^2}$. We may take the integration factor as $R=\exp(-x^2)/x$ so $(\ln R)^\prime=P$. Thegeneral solution is$$z=x\exp(x^2)\int x^3dx=(\tfrac14x^5+Ax)\exp(x^2),$$i.e.$$y=(\tfrac18x^4-\tfrac14x^2+\tfrac12A+\tfrac14)\exp(x^2)+B.$$
