Q: $x^2y^{''}-(x^2+2)y=0$ [1]
Solving using frobenius
$y=\sum_{n=0}^{\infty}a_nx^{x+r}$ [2]
$ y'=\sum_{n=0}^{\infty}(n+r)a_nx^{x+r-1}$ [3]
$ y''=\sum_{n=0}^{\infty}(n+r)(n+r-1)a_nx^{x+r-2}$ [4]
inserting [2,4] into [1]
$x^2 \sum_{n=0}^{\infty}(n+r)(n+r-1)a_nx^{x+r-2}-(x^2+2)\sum_{n=0}^{\infty}a_nx^{x+r}$ [5]
Multiplying through but the cofficent I get
$\sum_{n=0}^{\infty}(n+r-1)(n+r)a_n x^{n+r}-\sum_{n=0}^{\infty}a_nx^{x+r+2}-2\sum_{n=0}^{\infty}a_nx^{n+r}$
setting n=0 I solve for r to get the values of $r=2 , r=-1$
Now this is where my confusion comes in
so for r=2 I rearnage the series like so
$x^2(\sum_{n=0}^{\infty}[(n+r-1)(n+r)a_n -2a_n]x^{n}-\sum_{n=0}^{\infty}a_nx^{n+2})=0$ [6]
So now what I did I want all x's to be of the same power so I did the following:
$k=n+2$
$k-2=n$
$\sum_{k=0}^{\infty}[(k+1)(k+2)a_n -2a_k]x^k-\sum_{k=2}^{\infty}a_{k-2}x^k=0$ [9]
expanding on the series $\sum_{k=0}^{\infty}[(k+1)(k+2)a_n - 2a_n]x^k$ so I can get the staring point of the series in the same postion I did the following
$k=0, 2a_0-2a_0=0 \rightarrow a_0=0$
$k=1, 6a_{1}-2a_{1} \rightarrow a_1=0$
$a_0=a_1=0$ is because [9] is equal to $0$
so now I have the equation
$\sum_{k=2}^{\infty}[(k+1)(k+2)a_n - 2a_n-a_{k-2}]x^k=0$
So I now have a recurrence relation of:
$(k+1)(k+2)a_n - 2a_n-a_{k-2}=0$
$a_n=\frac{a_{k-2}}{k(k+3)}$
Now in my book solution it has the solution of
$a_2=\frac{a_0}{2\cdot 5}$ $a_3=0$ $a_4=\frac{a_0}{2\cdot 5\cdot 4\cdot 7}$
but how is it $a_0$? I know I have gone somewhere wrong but just cant see where.
Your approach is fine. There is just a small mistake which causes the problem. In the following we use the coefficient of operator $[x^k]$ to denote the coefficient of $x^k$ in a series.
Comment:
In (1) we simplify $(k+1)(k+2)a_k-2a_k$ and observe the coefficient $a_0$ vanishes in the left-hand series since $(k+3)k=0$ if $k=0$.
In (2) we can therefore start the left series with $k=1$.