$$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.}$$
I have one short note related to this problem:
If the difference $r_1-r_2$ between the roots of the indicial equation is a positive integer, it is sometimes possible to obtain the general solution using the smaller root alone, without bothering to find explicitly the solution corresponding to the larger root. Indeed, if the difference $r_1-r_2$ is a positive integer, it is a worthwhile practice to work with the smaller root first, in the hope that this smaller root by itself may lead directly to the general solution.
Please for further reading read chapter 6 in Differential equation by "Shepley L.Ross".
I think this will help a lot in these types of problems.
Best Answer
Let $y(x)=\sum_{n=0}^\infty c_nx^{n+r}$ be a solution. Then $$y''(x)=\sum_{n=0}^\infty (n+r)(n+r-1)c_nx^{n+r-2}.$$ Therefore $$xy''(x)=\sum_{n=0}^\infty(n+r)(n+r-1)c_nx^{n+r-1}.$$ Hence $$xy''(x)+y(x)=r(r-1)c_0x^{r-1}+\sum_{n=0}^\infty (n+r)(n+r+1)c_{n+1}x^{n+r}+\sum_{n=0}^\infty c_nx^{n+r}.$$ This requires $r(r-1)=0$ and $$(n+r)(n+r+1)c_{n+1}=-c_n\tag{1}$$ for all $n\ge 0$.
The roots $r=0$ and $r=1$ of $r(r-1)=0$ differ by an integer. Therefore, there exist two linearly independent solutions $$y_1(x)=\sum_{n=0}^\infty c_n x^{n+1}$$ and $$y_2(x)=ky_1(x)\ln x+\sum_{n=0}^\infty b_n x^{n+0}.$$ If $c_0=1$, then from $(1)$ with $r=1$, we conclude that $$c_n=\frac{(-1)^n}{n!(n+1)!}$$ for all $n\ge 0$. That is, $$y_1(x)=\sum_{n=0}^\infty\frac{(-1)^n}{n!(n+1)!}x^{n+1}.$$
We now want to find $y_2(x)$. Up to rescaling, we may assume $k=1$. Note that $$y_2'(x)=\frac{y_1(x)}{x}+y'_1(x)\ln x+\sum_{n=0}^\infty nb_nx^{n-1}$$ and $$y_2''(x)=-\frac{y_1(x)}{x^2}+\frac{2y'_1(x)}{x}+y_1''(x)\ln x+\sum_{n=0}^\infty n(n-1)b_nx^{n-2}.$$ Hence $$0=xy_2''(x)+y_2(x)=-\frac{y_1(x)}{x}+2y'_1(x)+xy_1''(x)\ln x+\sum_{n=0}^\infty n(n-1) b_nx^{n-1}+y_1(x)\ln x+\sum_{n=0}^\infty b_n x^n.$$ But $xy_1''(x)+y_1(x)=0$, so $$0=xy_2''(x)+y_2(x)=-\frac{y_1(x)}{x}+2y_1'(x)+\sum_{n=0}^\infty \big((n+1)nb_{n+1}+b_n\big)x^n.$$ Note that $$\frac{y_1(x)}{x}=\sum_{n=0}^\infty\frac{(-1)^n}{n!(n+1)!}x^n$$ and $$y_1'(x)=\sum_{n=0}^\infty\frac{(-1)^n}{n!n!}x^n.$$ Therefore we have $$\sum_{n=0}^\infty\left((n+1)nb_{n+1}+b_n-\frac{(-1)^n}{n!(n+1)!}+\frac{2(-1)^n}{n!n!}\right)x^n=0.$$ Thus $$(n+1)nb_{n+1}+b_n=\frac{(-1)^{n+1}(2n+1)}{n!(n+1)!}$$ for all $n=0,1,2,\ldots$. This shows that $b_0=-1$.
For $n\ge 2$, $$b_{n}=\frac{(-1)^{n}(2n-1)}{(n-1)n!n!}-\frac{b_{n-1}}{n(n-1)}.$$ Let $B_n=(-1)^nn!(n-1)!b_n$, so $B_n=\frac{2n-1}{n(n-1)}+B_{n-1}$. Thus $$B_n-B_{n-1}=\frac{1}{n-1}+\frac{1}{n}$$ for $n\ge 2$. Hence $$B_n-B_1=\left(1+\frac12\right)+\left(\frac12+\frac13\right)+\ldots+\left(\frac1{n-1}+\frac1n\right).$$ Wlog, we can set $B_1=1$ (otherwise we add an appropriate multiple of $y_1(x)$ to $y_2(x)$). Therefore, $$B_n=2H_n-\frac1n,$$ where $H_n=\sum_{j=1}^n\frac1j$ is the $n$th Harmonic number (with $H_0=0$). This shows that $$b_n=\frac{(-1)^n}{n!n!}\left(2nH_n-1\right).$$ Observe that this formula works for $n=0$ as well. That is $$y_2(x)=\sum_{n=0}^\infty \frac{(-1)^n}{n!(n+1)!}x^{n+1}\ln x+\sum_{n=0}^\infty \frac{(-1)^n}{n!n!}\left(2nH_n-1\right)x^n.$$ All solutions $y(x)$ to $xy''(x)+y(x)=0$ are linear combinations of $y_1(x)$ and $y_2(x)$.