# 6.2: The Power Series Method

- Page ID
- 106835

We will use the series method to solve

\[\dfrac{dy}{dx}+y=0 \label{Eq1}\]

This equation is a first order separable differential equation, and can be solved by direct integration to give \(ce^{-x}\) (be sure you can do this on your own). In order to use the series method, we will first assume that the answer can be expressed as

\[y(x)=\displaystyle\sum_{n=0}^{\infty}a_n x^{n}. \nonumber\]

Again, instead of obtaining the actual function \(y(x)\), in this method we will obtain the series

\[\displaystyle\sum_{n=0}^{\infty}a_n x^{n}. \nonumber\]

We will use the expression

\[y(x)=a_0+a_1 x + a_2 x^2...a_n x^n \label{Eq5}\]

to calculate the derivatives we need and substitute in the differential equation. Given our initial assumption that the solution can be written as:

\[y(x)=a_0+a_1 x + a_2 x^2+a_3x^3+...+a_n x^n \nonumber\]

we can write the first derivative as:

\[y'(x)=a_1 + a_2\times 2 x+a_3\times3 x^2+...+a_n\times n x^{n-1} \nonumber\]

We’ll substitute these expressions in the differential equation we want to solve (Equation \ref{Eq1}):

\[\begin{array}{c} \dfrac{dy}{dx}+y =0 \\[4pt] \left(a_1 + a_2\times 2 x+a_3\times3 x^2 + ... + a_n\times n x^{n-1}\right)+\left(a_0+a_1 x + a_2 x^2+a_3x^3+...+a_n x^n\right) =0 \end{array} \nonumber\]

and group the terms that have the same power of \(x\):

\[(a_1+a_0) + (2a_2+a_1) x+(3a_3+a_2) x^2+(4a_4+a_3) x^3+...=0 \nonumber\]

This expression needs to hold for all values of \(x\), so all terms in parenthesis need to be zero:

\[(a_1+a_0)= (2a_2+a_1)=(3a_3+a_2)=(4a_4+a_3)=...=0 \nonumber\]

The equations above give relationships among the different coefficients. Our solution will look like Equation \ref{Eq5}, but we know now that these coefficients are all related to each other. In the next step, we will express all the coefficients in terms of \(a_0\).

\[\begin{array}{c} \left( a_1+a_0 \right) \rightarrow a_1=-a_0 \\ \left( 2a_2+a_1 \right) \rightarrow a_2=-a_1/2=a_0/2 \\ \left( 3a_3+a_2 \right) \rightarrow a_3=-a_2/3=-a_0/6 \\ \left( 4a_4+a_3 \right) \rightarrow a_4=-a_3/4=a_0/24 \end{array} \nonumber\]

We can continue, but hopefully you already see the pattern: \(a_n=a_0(-1)^n/n!\). We can then write our solution as:

\[y(x)=\displaystyle\sum_{n=0}^{\infty}a_n x^{n}=\displaystyle\sum_{n=0}^{\infty}a_0\dfrac{(-1)^n}{n!} x^{n}=a_0\displaystyle\sum_{n=0}^{\infty}\dfrac{(-1)^n}{n!} x^{n} \nonumber\]

We got our solution in the shape of an infinite series. Again, in general, we will be happy with the result as it is, because chances are the series does not represent any combination of known functions. In this case, however, we know that the solution is \(y(x)=ce^{-x}\), so it should not surprise you that the series

\[\displaystyle\sum_{n=0}^{\infty}\dfrac{(-1)^n}{n!} x^{n} \nonumber\]

is the Maclaurin series of \(e^{-x}\). The constant \(a_0\) is an arbitrary constant, and can be calculated if we have an initial condition.

The same procedure can be performed more elegantly in the following way:

\[\begin{align*} y(x) &= \sum_{n=0}^{\infty}a_n x^{n} \\[4pt] y'(x) &= \sum_{n=1}^{\infty}na_n x^{n-1} \\[4pt] y'(x) + y(x) &=0\rightarrow \sum_{n=1}^{\infty}na_n x^{n-1}+ \sum_{n=0}^{\infty}a_n x^{n}=0 \end{align*}\]

changing the ‘dummy’ index of the first sum:

\[\displaystyle\sum_{n=0}^{\infty}(n+1)a_{n+1} x^{n}+\displaystyle\sum_{n=0}^{\infty}a_n x^{n}=0 \nonumber\]

and combining the two sums:

\[\displaystyle\sum_{n=0}^{\infty}\left[(n+1)a_{n+1}+a_n\right] x^{n}=0 \nonumber\]

Because this result needs to be true for all values of \(x\):

\[(n+1)a_{n+1}+a_n=0\rightarrow \dfrac{a_{n+1}}{a_n}=-\dfrac{1}{n+1} \nonumber\]

The expression above is what is known as a recursion formula. It gives the value of the second coefficient in terms of the first, the third in terms of the second, etc.

\[\dfrac{a_{n+1}}{a_n}=-\dfrac{1}{n+1}\rightarrow \dfrac{a_{1}}{a_0}=-1; \;\dfrac{a_{2}}{a_1}=-\dfrac{1}{2};\;\dfrac{a_{3}}{a_2}=-\dfrac{1}{3};\;\dfrac{a_{4}}{a_3}=-\dfrac{1}{4}.... \nonumber\]

We know we want to express all the coefficients in terms of \(a_0\). We can achieve this by multiplying all these terms:

\[\begin{array}{c} \dfrac{a_{1}}{a_0}\dfrac{a_{2}}{a_1}\dfrac{a_{3}}{a_2}...\dfrac{a_{n}}{a_{n-1}}...=\dfrac{a_{n}}{a_0} \\ \dfrac{a_{n}}{a_0}=-1\times \left(-\dfrac{1}{2}\right)\times \left(-\dfrac{1}{3}\right)\times \left(-\dfrac{1}{4}\right)...\times \left(-\dfrac{1}{n}\right)=\dfrac{(-1)^n}{n!} \end{array} \nonumber\]

and therefore, \(a_n=a_0\dfrac{(-1)^n}{n!}\)

Note: You do not need to worry about being ’elegant’. It is fine if you prefer to take the less ’elegant’ route!

Example \(\PageIndex{1}\)

Solve the following equation using the power series method:

\[\dfrac{d^2y}{dx^2}+y=0 \nonumber\]

**Solution**

We start by assuming that the solution can be written as:

\[y(x)=a_0+a_1 x + a_2 x^2+a_3x^3+a_4x^4...\nonumber\]

and therefore the first and second derivatives are:

\[\begin{align*} y'(x) &=a_1+ 2a_2 x+3a_3x^2+4a_4x^3+5a_5x^4... \\[4pt] y''(x) &=2a_2+2\times 3a_3x+3\times 4a_4x^2+4\times 5a_5x^3+5\times 6a_6x^4...\end{align*} \nonumber\]

Notice that up to this point, this procedure is independent of the differential equation we are trying to solve.

We now substitute these expressions in the differential equation:

\[(2a_2+2\times 3a_3x+3\times 4a_4x^2+4\times 5a_5x^3+5\times 6a_6x^4...)+(a_0+a_1 x + a_2 x^2+a_3x^3+a_4x^4...)=0\nonumber\]

and group the terms in the same power of \(x\):

\[(2a_2+a_0)+(2\times3a_3+a_1)x+(3\times 4a_4+a_2)x^2+(4\times 5a_5+a_3)x^3+(5\times 6a_6+a_4)x^4...=0\nonumber\]

Because this needs to be true for all values of \(x\), all the terms in parenthesis need to equal zero.

\[(2a_2+a_0)=(2\times 3a_3+a_1)=(3\times 4a_4+a_2)=(4\times 5a_5+a_3)=(5\times 6a_6+a_4)...=0\nonumber\]

We have relationships between the odd coefficients and between the even coefficients, but we see that the odd and the even are not related. Let’s write all the odd coefficients in terms of \(a_1\), and the even coefficients in terms of \(a_0\):

\(a_2=-\dfrac{a_0}{2}=-\dfrac{a_0}{2!}\) | \(a_3=-\dfrac{a_1}{(2\times3)}=-\dfrac{a_1}{3!}\) |

\(a_4=-\dfrac{a_2}{(3\times 4)}=\dfrac{a_0}{(2\times 3\times 4)}=\dfrac{a_0}{4!}\) | \(a_5=-\dfrac{a_3}{(4\times 5)}=\dfrac{a_1}{(2\times3\times 4\times5)}=\dfrac{a_1}{5!}\) |

\(a_6=-\dfrac{a_4}{(5\times 6)}=-\dfrac{a_0}{(2\times 3 \times 4\times 5\times 6)}=-\dfrac{a_0}{6!}\) | \(a_7=-\dfrac{a_5}{(6\times 7)}=-\dfrac{a_1}{(2\times 3\times 4\times 5\times 6\times 7)}=-\dfrac{a_1}{7!}\) |

Substituting these relationships in the expression of \(y(x)\):

\[\begin{align} y(x) &=a_0+a_1 x + a_2 x^2+a_3x^3+a_4x^4... \\[4pt] &=a_0+a_1 x-\dfrac{a_0}{2!}x^2-\dfrac{a_1}{3!}x^3+\dfrac{a_0}{4!}x^4+\dfrac{a_1}{5!}x^5-\dfrac{a_0}{6!}x^6-\dfrac{a_1}{7!}x^7+... \\[4pt] &=a_0(1-\dfrac{1}{2!}x^2+\dfrac{1}{4!}x^4-\dfrac{1}{6!}x^6...)+a_1(x-\dfrac{1}{3!}x^3+\dfrac{1}{5!}x^5-\dfrac{1}{7!}x^7+...) \end{align} \nonumber\]

which can be expressed as:

\[\displaystyle{\color{Maroon}y(x)=a_0\sum_{n=0}^{\infty}\dfrac{(-1)^n}{(2n)!}x^{2n}+a_1\sum_{n=0}^{\infty}\dfrac{(-1)^n}{(2n+1)!}x^{2n+1}} \nonumber\]

This is the solution of our differential equation.

If you check Chapter 3, you will recognize that these sums are the Maclaurin expansions of the functions cosine and sine. This should not surprise you, as the differential equation we just solved can be solved with the techniques we learned in Chapter 5 to obtain:

\[y(x)=c_1\cos{x}+c_2\sin{x} \nonumber\]

Again,we used this example to illustrate the method, but it does not make a lot of sense to use the power series method to solve a ODE that can be solved using easier techniques. This method will be useful when the solution of the ODE can be only expressed as a power series.