Power Series Solution to Differential Equation The equation is 
$$y'' - xy' + y = 0$$
So far I have the recurrence relation -
$$a_{n+2} = \dfrac{(n-1)a_n}{(n+1)(n+2)} $$
From this - 
$a_2 = \dfrac{-a_0}{2!}$
$a_3 = 0$
$a_4 = \dfrac{-a_0}{4!}$
$a_5 = 0$
$a_6 = \dfrac{-3a_0}{6!}$
and so on..
The question asks for the first five non-zero terms of a general series solution of the d.e, seperating out for $a_0$ and $a_1$
How do I compute this? 
Thanks
 A: The differential equation 
\begin{align}
y^{''} - x y^{'} + y = 0
\end{align}
can be solved via a power series of the form
\begin{align}
y(x) = \sum_{k=0}^{\infty} a_{n} x^{n} = a_{0} + a_{1} x + a_{2} x^{2} + \cdots .
\end{align}
It is fairly evident that
\begin{align}
\sum_{k=0}^{\infty} k(k-1) a_{k} x^{k} = \sum_{k=0}^{\infty} (k-1) a_{k} x^{k}
\end{align}
which yields the equation for the coefficients
\begin{align}
a_{k+2} = \frac{ (k-1) a_{k} }{ (k+1) (k+2) }.
\end{align}
It is discovered that $a_{3} = 0 \cdot a_{1}$. Since, for $k$ being odd, say $k \rightarrow 2k+1$, 
\begin{align}
a_{2k+3} = \frac{k a_{2k+1} }{(k+1)(2k+3)}
\end{align}
it is clear that all the odd coefficients depend of $a_{3}$ for $k \geq 1$ and leads to $a_{2k+1} = 0$ for $k \geq 1$. The even $k$ values are
\begin{align}
a_{2} &= - \frac{a_{0}}{2!} \\
a_{4} &= - \frac{a_{0}}{4!} \\
a_{6} &= - \frac{(1 \cdot 3) a_{0}}{6!} \\
a_{8} &= - \frac{(1\cdot 3 \cdot 5)a_{0}}{8!} 
\end{align}
which has the general form
\begin{align}
a_{2k} = - \frac{a_{0}}{2^{k} k! (2k-1)}.
\end{align}
The series for $y(x)$ now be seen in the form
\begin{align}
y(x) = a_{0} + a_{1} x - a_{0} \sum_{k=1}^{\infty} \frac{ x^{2n} }{2^{k} k! (2k-1)}.
\end{align} 
The power series discovered can be evaluated as follows. Consider
\begin{align}
\partial_{x} \left( \sum_{k=1}^{\infty} \frac{ x^{2n-1} }{2^{k} k! (2k-1)} \right) &= \sum_{k=1}^{\infty} \frac{ x^{2n-2} }{2^{k} k!} = \frac{1}{x^{2}}( e^{x^{2}/2} -1). 
\end{align}
Integrating both sides
\begin{align}
\sum_{k=1}^{\infty} \frac{ x^{2n} }{2^{k} k! (2k-1)} &= x \int^{x} \frac{e^{u^{2}/2} -1}{u^{2}} du = x \left[ \sqrt{\frac{\pi}{2} } erfi\left( \frac{x}{\sqrt{2}} \right) - \frac{e^{x^{2}/2}}{x} + \frac{1}{x} \right] \\
&= \sqrt{\frac{\pi}{2} } \cdot x \cdot erfi\left( \frac{x}{\sqrt{2}} \right) - e^{x^{2}/2} + 1.  
\end{align}
With this series the general solution of $y(x)$ can be sen by
\begin{align}
y(x) &= a_{0} + a_{1} x - \sum_{k=1}^{\infty} \frac{ x^{2n} }{2^{k} k! (2k-1)} \\
&= a_{1} x  - a_{0} \left[ \sqrt{\frac{\pi}{2} } \cdot x \cdot erfi\left( \frac{x}{\sqrt{2}} \right) - e^{x^{2}/2} \right], 
\end{align}
where $erfi(x)$ is the imaginary error function (erfi(x) = -i erf(ix)). 
