Solve boundary value problem $x^2y'' + 3xy' + y = x^2$ Problem
$x^2y'' + 3xy' + y = x^2$ 
BC: $y(1) = 0, y(e) = 0$
I tried to first solve for the homogenous solution, but I get a really weird equation to solve for values of r. How do you solve the above equation?
My Work
$y=e^{rx} \\
x^2r^2 + 3xr + 1 = x^2 \\
x^2r^2 + 3xr + 1-x^2 = 0 \\
r = \frac{-3x \pm \sqrt{9x^2-4(1-x^2)x^2}}{2x^2}
$

$$x^2\frac{d^2y}{dx^2} +3x\frac{dy}{dx} + y = x^2$$
This is known as an Euler Equation - differential equations where the degree of $x$ matches the order of the derivative. They can be solved using  the change of variable $x= e^z$
So we get $$x\frac{dy}{dx} = \frac{dy}{dz}$$
and $$x^2\frac{d^2y}{dx^2}= \frac{d^2y}{dz^2} -\frac{dy}{dz}$$
Substituting this in, you should find that the coefficients of $x$ cancel out, and you get a more easily solved ODE. 
You should end up with this ODE:
$$\frac{d^2y}{dz^2} -\frac{dy}{dz} + 3\frac{dy}{dz} + y = e^{2z}$$
$$\frac{d^2y}{dz^2} + 2\frac{dy}{dz} + y = e^{2z}$$
Auxilliary equation:
$$\lambda ^2 +2\lambda + 1 = 0$$
$$\implies \lambda = -1$$
So $$y_{CF} = c_{1}e^{-z}+c_{2}ze^{-z}$$
Then we try $$y_{PI} = Ae^{2z}$$
Substituting into our ODE:
$$\implies (4A+4A+A)e^{2z} = e^{2z} \implies A=\frac{1}{9}$$
$$y_{GS} = c_{1}e^{-z}+c_{2}ze^{-z} + \frac{1}{9}e^{2z}$$
Changing back in terms of $x$, we have $z = \ln x$
$$y_{GS} = c_{1}e^{\ln(x^{-1})}+c_{2}\ln (x)e^{\ln (x^{-1})} + \frac{1}{9}e^{\ln (x^{2})}$$
$$y_{GS} = \frac{c_{1}}{x} + \frac{c_{2}\ln x}{x} + \frac{x^2}{9}$$
$$y(1) = 0 \implies  c_{1} + \frac{1}{9} = 0 \implies c_{1} = - \frac{1}{9}$$
$$y(e) = 0 \implies -\frac{1}{9e} +\frac{c_{2}}{e} +\frac{e^2}{9} = 0$$
$$c_{2} = \frac{1}{9}(1-e^3)$$
So $$y_{PS} = -\frac{1}{9x} + \frac{1}{9}(1-e^3)\cdot \frac{\ln x}{x} + \frac{x^2}{9}$$
$$y_{PS} = \frac{1}{9}(-\frac{1}{x} + \frac{(1-e^3)\ln x}{x} + x^2)$$
