<s>[INST] Solve $(1+x^2) f''(x) + 4x f'(x) + 2 f(x)=0$ via power series method. I have trouble finding a closed expression for the following problem:

$$(1+x^2) f''(x) + 4x f'(x) + 2 f(x)=0$$ where also $f'(0)=0$ and $f(0)=1$
Solve this via a power series method, so suppose $f(x)= \sum_{n=0} ^{\infty}a_n x^n$. Find its radius of convergence and a closed expression.

I tried solving this, but I get a really nasty expression. We first plug in our Ansatz into the differential eqution, with the usual derivatives:
$$ (1+x^2)\sum_{n=0} ^{\infty}n (n-1)a_n x^{n-2}+ 4x\sum_{n=0} ^{\infty}n a_n x^{n-1} + 2 \sum_{n=0} ^{\infty}a_n x^{n}=0$$
We now multiply out the factors:
$$ \sum_{n=0} ^{\infty}n (n-1)a_n x^{n-2} +\sum_{n=0} ^{\infty}n (n-1)a_n x^{n} + \sum_{n=0} ^{\infty}4n a_n x^{n} +  \sum_{n=0} ^{\infty}2a_n x^{n}=0$$
We apply a shift to the first sum:
$$ \sum_{n=0} ^{\infty}(n+2) (n+1)a_{n+2} x^{n} +\sum_{n=0} ^{\infty}n (n-1)a_n x^{n} + \sum_{n=0} ^{\infty}4n a_n x^{n} +  \sum_{n=0} ^{\infty}2a_n x^{n}=0$$
We now use the identity theorem for power series to compare coefficients and get for $n \geq 2$:
$$ (n+2)(n+1)a_{n+2} + n(n-1)a_n + 4n a_n +2a_n=0$$
After rewriting, we get:
$$ (n+2)(n+1)a_{n+2} + (n+2)(n+1)a_{n}=0$$
$$ a_{n+2} = - a_n$$
Which is not a nice expression, since $a_0=1$ and $a_1=0$ this tells me that $a_2=-1$, $a_4 =1$, $a_6=-1$  and all odd terms are $0$.
What am I missing here?
 [/INST] We recognise this to be:
$$ 1 - x^2 + x^4 - x^6  +x^8\dots$$
Notice that:
$$ \frac{1}{1 - (-x^2)}= 1- x^2 + x^4 - x^6 +x^8 \dots $$
So our closed expression is the geometric series variation $$\frac{1}{1+x^2}$$
Its radius of convergence follows from the geometric series to be $|x^2|<1$ so $|x|<1$. This means the series has radius of convergence $1$.
</s>