Initial value problem with $x^2u''-2xu'+2u=24/x^2$ I have some trouble finding the coefficients and powers of $x$ in the following problem.
Solve  $x^2u''-2xu'+2u=\frac{24}{x^2}$ with $u(1)=2$ and $u'(1)=-5$. 
I first set $$Lu_H=x^2u''-2xu'+2u=0$$ to find the homogeneous solution. After differentiating and substituting into the homogeneous equation I obtain $$Lu_H=\sum_{k=0}^{\infty}\left[x^k\left(A_{k+2}k(k-1)x^2-2A_{k+1}kx+2A_k\right)\right].$$ (This seems to be the problem as I get one coefficient correct later on but another one incorrect).
For the particular solution, I try $$u_P=\frac{C}{x^2}$$ for some constant $C$, which yields $C=2$. (By the way, this part seems to be correct as there is a term in the answers which matches up).
We now have $$u=u_H+u_P=\sum_{k=0}^{\infty}\left[x^k\left(A_{k+2}k(k-1)x^2-2A_{k+1}kx+2A_k\right)\right] +\frac{2}{x^2}.$$
Differentiating and substituting the initial values implies that $$\sum_{k=0}^{\infty}\left[A_{k+2}k(k-1)-2A_{k+1}k+2A_k \right]=0 \qquad (\ast)$$ and $$\sum_{k=0}^{\infty}A_{k+1}\left[k(k-1)(k-2)-2k(k+1)+2k \right]=-1.$$
I seem to have done something wrong somewhere, however, as the answers give $u=x-x^2+2x^{-2}$. The first thing is the equation $(\ast)$, which gives me the wrong value for the coefficient. The second thing I don't understand is where the terms in $x$ and $x^2$ come from in the answers. 
I can see where my coefficients should be going and that substituting this back in will solve the original equation, but if someone could explain why we know that these are the terms that go with the coefficients that would be just dandy. 
Many thanks.
 A: We are given:
$$\tag 1 x^2u''-2xu'+2u=\frac{24}{x^2},~u(1)=2, ~ u'(1)=-5.$$
This is a second-order linear ordinary differential equation with Cauchy-Euler form.
Lets choose $u = x^r$, so we have:
$$\tag 2 u = x^r, ~u' = rx^{r-1}, ~u'' = r(r-1)x^{r-2}$$
Substituting $(2)$ back into $(1)$ yields:
$x^2(r(r-1)x^{r-2}) -2x(rx^{r-1})+2x^r = \dfrac{24}{x^2}$
Simplifying yields:
$$(r^2 - 3r + 2)x^r = \dfrac{24}{x^2}$$
Lets solve for the homogeneous solution first, so we have:
$$r^2-3r+2 = 0 \rightarrow r = 1, ~ r = 2$$
So, our homogeneous solution is of the form:
$$u_h(x) = c_1 x + c_2 x^2$$
For the particular solution, we can guess at a solution of the form $\dfrac{c}{x^2}$ and solve for $c$ (like you did) or use Variation of Parameters, with:


*

*$w_1(x) = x, w_2(x) = x^2$

*This gives us a Wronskian, $W(x, x^2) = x^2$, which is nonzero.

*Following the approach on the Wiki, we get:


$w_1(x) = \dfrac{8}{x^3}, ~ w_2(x) = -\dfrac{6}{x^4}$, so the particular solution is given by:
$$u_p(x) = xw_1(x) + x^2w_2(x) = \dfrac{2}{x^2}$$
Our solution is then:
$$u(x) = u_h(x) + u_p(x) = c_1 x + c_2 x^2 + \dfrac{2}{x^2}$$
Using our initial conditions, we arrive at $c_1 = 1, c_2 = -1$., so our final solution is:
$$u(x) = x - x^2 + \dfrac{2}{x^2}$$
A: Easier way to see the solution:
$$\frac{d}{dx} \frac{u}{x} = \frac{u'}{x}-\frac{u}{x^2}$$
$$\frac{d^2}{dx^2} \frac{u}{x} = \frac{u''}{x}-2 \frac{u'}{x^2} + 2 \frac{u}{x^3}$$
So...divide both sides of the ODE by $x^3$ and get
$$\frac{u''}{x}-2 \frac{u'}{x^2} + 2 \frac{u}{x^3} = \frac{d^2}{dx^2} \frac{u}{x} = \frac{24}{x^5}$$
Integrate twice w.r.t $x$:
$$\frac{d}{dx} \frac{u}{x} = -\frac{6}{x^4} + C_1$$
$$\frac{u}{x} = \frac{2}{x^3}+C_1 x+C_2 \implies u(x) = \frac{2}{x^2}+C_1 x^2+C_2 x$$
Apply initial conditions:
$$u(1)=2 \implies C_1+C_2=0$$
$$u'(1) = -5 \implies 2 C_1+C_2 = -1 \implies C_1=-1 \quad C_2=1$$
Therefore
$$u(x) = \frac{2}{x^2}-x^2+x$$
