Series Solution of ODEs
From biophysics wiki
Let us consider the linear homogenious second order ODE with $z \in \mathbb{C}$
\begin{align} y + p(z) y' +q(z)y=0 \label{ode} \end{align} If \ref{ode} the fucntions $p(z)$ and $q(z)$ are at some point $z=z_0$ finite, then they can be expressed as a power series \begin{align} p(z)=\sum_{n=0}^{\infty} p_n(z-z_0)^n \\ q(z)=\sum_{n=0}^{\infty} q_n(z-z_0)^n \\ \end{align} Functions for which a power series exists are called analytic at $z=z_0$ and $z_0$ is called an ordinary point. If a function $p(z)$ or $q(z)$ diverges at $z=z_0$, then $z_0$ is called a singular point.
Even if a function diverges at $z=z_0$ it may possess a nonsingular (finite) solution at $z_0$. The nessessary and sufficient condition of for existence is that the functions \begin{align} p(z)(z-z_0)\\ q(z)(z-z_0)^2 \end{align} are analytic at $z-z_0$. Such a point is called a regular singular point. Problems of this kind can be solved by the Method of Frobenius.
Series solution about an ordinary point
In the following discussion we make the transformiation $Z=z-z_0$, if $z_0$ is not zero already. Since any solution $y$ of equation \ref{ode} can be represented by a power series \begin{align} y(z)=\sum_{n=0}^{\infty} a_n \, z^n \label{power} \end{align} we take \ref{power} as an ansatz for \ref{ode}. The derivatives of \ref{power} is \begin{align} y'&=\sum_{n=0}^{\infty} n \cdot a_n \, z^{n-1}=\sum_{n=0}^{\infty} (n+1) \cdot a_{n+1} \, z^{n} \end{align} \begin{align} y&=\sum_{n=0}^{\infty} n(n-1) \cdot a_n \, z^{n-2}=\sum_{n=0}^{\infty} (n+2)(n+1) \cdot \, a_{n+2} z^{n} \end{align}
The solution to an ODE \ref{ode} is obtained by pluggin in the derivatives of $y(z)$ with the same power of $z$. This enables us to use only one summation sign and we can pull out $z^n$. From there we can go on and find a recurrence relation for the coefficients of the power series. This is best illustrated at an example.<br\><br\>
Example<br\>
Solve the ODE \begin{align} y + y=0 \end{align} We simply plug in the derivatives of $y$ \begin{align} \sum_{n=0}^{\infty} (n+2)(n+1) \cdot a_{n+1} \, z^{n} + \sum_{n=0}^{\infty} a_{n} \, z^{n} =0\\ \sum_{n=0}^{\infty} \left[ (n+2)(n+1) \cdot a_{n+1} + a_{n} \right] \, z^{n} =0 \end{align} This equation must be zero for every $n$. Since we assume $z^n$ not to be zero its coefficient must vanish. \begin{align} (n+2)(n+1) \cdot a_{n+1} + a_{n}=0 \end{align} So we find the recurrence relation \begin{align} a_{n+2}=\frac{-a_n}{(n+2)(n+1)} \end{align} If we choose one initial value zero and the other one e.g. $a_0=0$ and $a_1=1$ we get $a_{2k}=0$ for $k=0,1,2, \dots$ and \begin{align} a_{3}=\frac{-a_1}{(1+2)(1+1)}=- \frac{1}{6}\\ a_{5}=\frac{-a_3}{(3+2)(3+1)}=\frac{-a_3}{15}=\frac{a_1}{15 \cdot 6}=\frac{1}{90}\\ \vdots\\ a_{n+2}=(-1)^n \frac{1}{(2n+1)!} \end{align}
\begin{align} y_1(z)=z-\frac{z^3}{3!}+\frac{z^5}{5!}- \dots =\sum_{n=0}^{\infty} \frac{(-1)^n \, z^{2n+1}}{(2n+1)!} \end{align} Similarly for $a_1=0$ and $a_0=1$ we get \begin{align} y_2(z)=1-\frac{z^2}{2!}+\frac{z^4}{4!}- \dots =\sum_{n=0}^{\infty} \frac{(-1)^n \, z^{2n}}{(2n)!} \end{align}