How to solve the differential equation: $x \frac{d^2y}{dx^2}+2(3x+1)\frac{dy}{dx}+3y(3x+2)=18x$ How to solve the differential equation $$x \frac{d^2y}{dx^2}+2(3x+1)\frac{dy}{dx}+3y(3x+2)=18x$$
I think I could let $u=xy$ but I don't know how to proceed it. 
 A: Your original idea is correct. If you substitute $u=xy$ you get $$\frac{du}{dx}=x\frac{dy}{dx}+y$$ and $$\frac{d^2u}{dx^2}=x\frac{d^2y}{dx^2}+2\frac{dy}{dx}$$
The original differential equation then becomes $$\frac{d^2u}{dx^2}+6\frac{du}{dx}+9u=18x$$
Can you finish this now?
A: Since a particular solution $e^{-3x}$ of the associated homogeneous ODE (i.e.: with term on the right $=0$ instead of $18x$), has already been found the problem is much simplified. 
This draw us to change of function : $\quad y(x)=f(x)e^{-3x}$
$y'=(f'-3f)e^{-3x}$
$y''=(f''-6f'+9f)e^{-3x}$
$x y'' +2(3x+1)y' +3y(3x+2)=\left( x(f''-6f'+9f)+2(3x+1)(f'-3f)+3(3x+2)f\right)e^{-3x}=18x$
After simplification :
$$\left( xf''+2f'\right)e^{-3x}=18x$$
Let $f'=u $
$$xu'+2u=18xe^{3x}$$
This is a first order, linear, non-homogeneous ODE that you can solve, I suppose.
You will obtain $u(x)$, without forgetting a constant of integration $c_1$ into it.
Then $\quad f(x) = \int u(x)dx +c_2$
And finally $\quad y(x)=f(x)e^{-3x}\quad$ with two constants $c_1$ and $c_2$ in it.
A: Letting $y=\frac{u(x)}{xe^{3x}}$ gives
$$ u''=18xe^{3x}. $$
Thus
$$ u'(x)=\int 18xe^{3x}dx=2(3x-1)e^{3x}+C_1$$
and hence
$$ u(x)=\int 2(3x-1)e^{3x}+C_1x+C_2=2e^{3x}(x-\frac23)+C_1x+C_2.$$
Therefore
$$ y=\frac{1}{xe^{3x}}(2e^{3x}(x-\frac23)+C_1x+C_2). $$
