# 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

• If you've come this far, I think you already have the solution. It is $y = a_0\left(1 - \frac{1}{2!}x^2 - \frac{1}{4!}x^4 - \frac{3}{6!}x^6 - \ldots\right) + a_1x$. (I'm trusting your calculation.) Commented Apr 27, 2014 at 21:53
• Where did the first 1 come from and also, where did the last $a_1x$ come from? Commented Apr 27, 2014 at 21:55
• When you try to solve an ODE with the power series method, you start with assuming $y = a_0 + a_1x + a_2x^2 + \ldots$. That is how you eventually get the recurrence and solve for $a_n$. Once you know all the $a_n$, you should put them back into the assumed form of the solution that you started with. Commented Apr 27, 2014 at 21:57
• Ok, but I still can't see where the first $a_0$ comes from, or the last $a_1$x? I didn't compute these? Commented Apr 27, 2014 at 22:01
• These are supposed to be unknown. Your ODE is second-order, so the solution is not uniquely determined unless you give it two conditions. Note that this is the same situation as when you solve a second-order linear ODE with constant coefficients. Commented Apr 27, 2014 at 22:03

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)).