Finding the solution to $xy'' +2y' +xy=0$ around $x_{0}=0$using the method of Frobenius. We know that the solution of this ODE is like:
$$ y=\sum_{n=0}^{\infty}C_nx^{n+r}$$
Them derivative $y$ and $y'$.
$$y'=\sum_{n=0}^{\infty}(n+r)C_nx^{n+r-1}$$
$$y''=\sum_{n=0}^{\infty}(n+r-1)(n+r)C_nx^{n+r-2}$$
Replace $y$ , $y'$ and $y''$ in the ODE.
$$\sum_{n=0}^{\infty}(n+r-1)(n+r)C_nx^{n+r-1}+\sum_{n=0}^{\infty}2(n+r)C_nx^{n+r-1} +\sum_{n=0}^{\infty}C_nx^{n+r+1}=0 $$
Now in the first and second summations if $k=n-1$ and in the third summation if $k=n+1$. We have:
$$\sum_{k=-1}^{\infty}(k+r)(k+r+1)C_{k+1}x^{k+r}+\sum_{n=-1}^{\infty}2(k+r+1)C_{k+1}x^{k+r} +\sum_{n=1}^{\infty}C_{k-1}x^{k+r}=0 $$
Now I separed the $k=-1$ and $k=0$ in the first and second summantions.
$$r(r-1)C_0x^{r-1}+(r+1)(r)C_1x^{r} + 2rC_0x^{r-1} +2(r+1)C_1x^r + \sum_{k=1}^{\infty}[(k+r)(k+r+1)C_{k+1}x^{k+r}+2(k+r+1)C_{k+1}x^{k+r}+C_{k-1}x^{k+r}]=0$$
After that I equalized the right side with the left and I have this 2 equation to find $r$:
$$(r^2 +r)C_0=0$$
and
$$(r^2+3r+2)C_{1}=0$$
If you solve the quadratic equations you have:
$$r_1=0$$
$$r_{2,3}=-1$$
$$r_4=-2$$
And that's all that I did please help me.
 A: $$xy'' +2y' +xy=0\qquad ......(1)$$
$~x=0~$ is a regular singular point of equation $(1)$.
So the equation admits of a Frobenius series of the form $$y=\sum_{n=0}^{\infty}C_n~x^{n+r},\qquad C_0\neq 0 \qquad ..........(2)$$ 
which converges for all $~x~$.
From $(2)$,
$$y'(x)=\sum_{n=0}^{\infty}(n+r)C_n~x^{n+r-1};\qquad \qquad y''(x)=\sum_{n=0}^{\infty}(n+r-1)(n+r)C_n~x^{n+r-2}\qquad .....(3)$$
Substituting $(2)$ and $(3)$ in $(1)$ we get,
$$x~\sum_{n=0}^{\infty}(n+r-1)(n+r)C_n~x^{n+r-2}+2~\sum_{n=0}^{\infty}(n+r)C_n~x^{n+r-1}+x~\sum_{n=0}^{\infty}C_n~x^{n+r}=0$$
$$\implies \sum_{n=0}^{\infty}(n+r)~(n+r+1)~C_n~x^{n+r-1}~+~\sum_{n=0}^{\infty}C_n~x^{n+r+1}=0\qquad .....(4)$$
Lowest power of $~x~$ in equation $(4)$ is $~{r-1}~$, so coefficient of $~x^{r-1}~=0$ gives the  indicial equation $~r~(r+1)~=0\implies r=0,~-1$
From equation $(4)$ we have the following recursive formula,
$$(n+r+1)~(n+r+2)~C_{n+1}~+~C_{n-1}=0$$
$$\implies C_{n+1}=-\frac{1}{(n+r+1)~(n+r+2)}~C_{n-1}\qquad ........(5)$$
From $(5)$ we have $C_1=C_3=C_5=\cdots =0$
$C_2=-\frac{1}{(r+2)~(r+3)}~C_{0}$
$C_4=-\frac{1}{(r+4)~(r+5)}~C_{2}=\frac{1}{(r+2)~(r+3)~(r+4)~(r+5)}~C_{0}$
$\cdots$
Therefore 
$$y(x)=C_0~x^r \left[1-\frac{1}{(r+2)~(r+3)}~x^2+\frac{1}{(r+2)~(r+3)~(r+4)~(r+5)}~x^4-\cdots\right]$$
For $~r=0~$, $$y_1(x)=C_0~ \left[1-\frac{x^2}{6}+\frac{x^4}{120}-\cdots\right]$$
$$\implies y_1(x)=C_0~ \left[1-\frac{x^2}{3!}+\frac{x^4}{5!}-\cdots\right]$$
Since $~0-(-1)=1,~$ an integer so the other independent solution of equation $(1)$ is  $$y_2(x)=\left[\frac{\partial y}{\partial r}\right]_{r=0}$$
$$\implies y_2(x)=y_1(x)~\log x~+~C_0~\left[\frac{5}{36}~x^2+\cdots\right]$$
General solution is $$y(x)=A~y_1(x)~+~B~y_2(x)\qquad \text{where $~A,~B~$are constants.}$$
A: You get the equations ($C_{k}=0$ for $k<0$, by construction)
$$
(k+r)(k+r+1)C_{k}=-C_{k-2}.
$$
The indicial equation for $k=0$ is $r(r+1)=0$. For $r=-1$, the equation for $k=1$ gives also $C_1$ free. All other coefficients are determined by the recursion
$$
C_k=-\frac{C_{k-2}}{k(k-1)}
$$
so that you get a basis solutions in the even indices
$$
y_1(x)=x^{-1}-\frac12x+\frac1{24}x^3-...=\frac{\cos x}{x}
$$
and in the odd indices
$$
y_2(x)=1-\frac16x^2+\frac1{120}x^4+...=\frac{\sin x}x.
$$
The case $r=0$ then just repeats one of these solutions, in that $C_1=0$ and the coefficient recursion
$$
C_k=-\frac{C_{k-2}}{k(k+1)}
$$
gives multiples of
$$
1-\frac16x^2+...=\frac{\sin x}x
$$
that is, of $y_2$.

Quick check: Setting $u(x)=xy(x)$ gives $u''(x)=xy''(x)+2y'(x)=-xy=-u$, which is indeed the harmonic oscillator equation.
