$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}[1]{\| #1 \|}$$ $$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$

# 6.2: Series Solutions to Second Order Linear Differential Equations

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

We have fully investigated solving second order linear differential equations with constant coefficients. Now we will explore how to find solutions to second order linear differential equations whose coefficients are not necessarily constant. Let

$P(x)y'' + Q(x)y' + R(x)y = g(x)$

Be a second order differential equation with $$P$$, $$Q$$, $$R$$, and $$g$$ all continuous. Then $$x_0$$ is a singular point if $$P(x_0) = 0$$, but $$Q$$ and $$R$$ do not both vanish at $$x_0$$. Otherwise we say that $$x_0$$ is an ordinary point. Below, we will investigate only ordinary points.

Example $$\PageIndex{1}$$

Find a solution to $$y'' + xy' + y = 0$$ with $$y(0) = 0$$ and $$y'(0) = 1$$.

Solution

Since the differential equation has non-constant coefficients, we cannot assume that a solution is in the form $$y = e^{rt}$$. Instead, we use the fact that the second order linear differential equation must have a unique solution. We can express this unique solution as a power series

$y= \sum_{n=0}^\infty a_n\, x^n.$

If we can determine the $$a_n$$ for all $$n$$, then we know the solution. Fortunately, we can easily take derivatives

$y'= \sum_{n=1}^{\infty} n\,a_n\,x^{n-1}$

$y''= \sum_{n=2}^{\infty} n\,(n-1)a_n\,x^{n-2}.$

Now we plug these into the original differential equation

$\sum_{n=2}^{\infty} n\,(n-1)\,a_n\,x^{n-2} + x\sum_{n=1}^{\infty} n\,a_n\,x^{n-1} + \sum_{n=0}^\infty a_n\, x^n = 0.$

We can multiply the $$x$$ into the second term to get

$\sum_{n=2}^{\infty} n\,(n-1)\,a_n\,x^{n-2} + \sum_{n=1}^{\infty} n\,a_n\,x^{n} + \sum_{n=0}^\infty a_n\, x^n = 0.$

We would like to combine like terms, but there are two problems. The first is the powers of $$x$$ do not match and the second is that the summations begin differently. We will first deal with the powers of $$x$$ and shift the index of the first summation by letting

$u = n - 2 \;\;\; \text{so} \;\;\; n = u + 2.$

We arrive at

$\sum_{u=0}^{\infty} (u+2)(u+1)\,a_{u+2}\,x^{u} + \sum_{n=1}^{\infty} n\,a_n\,x^{n} + \sum_{n=0}^\infty a_n\, x^n = 0.$

Since $$u$$ is a dummy variable, we can call it $$n$$ instead to get

$\sum_{n=0}^{\infty} (n+2)(n+1)\,a_{n+2}\,x^{n} + \sum_{n=1}^{\infty} n\,a_n\,x^{n} + \sum_{n=0}^\infty a_n\, x^n = 0.$

Next we deal with the second issue. The second summation begins at 1 while the first and third begin at 0. We deal with this by pulling out the 0th term. We plug in 0 into the first and third series to get

$(0 + 2)(0 + 1)a_{0+2}x_0 = 2a_2$

and

$a_0x^0 = a_0.$

We can write the series as

$2a_2+a_0+ \sum_{n=1}^{\infty} (n+2)(n+1)\,a_{n+2}\,x^{n} + \sum_{n=1}^{\infty} n\,a_n\,x^{n} + \sum_{n=1}^\infty a_n\, x^n = 0$

$2a_2+a_0+ \sum_{n=1}^{\infty} \left[ (n+2)(n+1)\,a_{n+2} + n\,a_n + a_n\,\right] x^n = 0.$

The initial conditions give us that

$a_0 = 0 \text{and } a_1 = 1$

Now we equate coefficients. The terms in the series begin with the first power of $$x$$, hence the constant term gives us

$2a_2 + a_0 = 0.$

Since $$a_0 = 0$$, so is $$a_2$$. Now the coefficient in front of $$x^n$$ is zero for all $$n$$. We have

$(n + 2)(n + 1)a_{n+2} + (n + 1)a_n = 0 .$

Solving for $$a_{n+2}$$ gives

$a_{n+2}= \dfrac{-a_n}{n+2} .$

We immediately see that $$a_n = 0$$ for $$n$$ even. Now compute the odd $$a_n$$

$a_1 = 1$

$a_3=\dfrac{-1}{3}$

$a_5=\dfrac{1}{3 \cdot 5}$

$a_7=\dfrac{-1}{3 \cdot 5 \cdot 7}.$

In general

$a_{2n+1} = \dfrac{(-1)^n}{3 \cdot 5 \cdot 7 ... (2n+1)} = \dfrac{2^n(n!)(-1)^n}{(2n + 1)!}.$

The final solution is

$y = \sum _{n=0}^\infty \dfrac{(-1)^n\, 2^n \, n! \, x^{2n+1}}{(2n+1)!} .$

This cannot be written in terms of elementary functions, however a computer can graph or calculate a value with as many decimal places as needed.

Example $$\PageIndex{2}$$

Find the the first three nonzero terms of two linearly independent solutions to $$xy'' + 2y = 0$$.

Solution

Notice that 0 is a singular point of this differential equation. We will not be able to find a solution in the form $$\sum a_ny^n$$, since the solution will not be differentiable at zero. Alternatively, we find a solution in the form

$y = \sum_{n=0}^{\infty} a_n(x-1)^n.$

This is the power series centered about $$x = 1$$, which is not a singular point. Now take derivatives

$y' = \sum_{n=1}^{\infty} n\,a_n(x-1)^{n-1}$

$y'' = \sum_{n=2}^{\infty} (n)(n-1)\,a_n(x-1)^{n-2}.$

Plugging into the differential equation gives

$x\sum_{n=2}^{\infty} (n)(n-1)\,a_n(x-1)^{n-2} + 2\sum_{n=0}^{\infty} a_n(x-1)^n = 0.$

Writing

$x = (x - 1) + 1$

and multiplying through gives

$\sum_{n=2}^{\infty} (n)(n-1)\,a_n(x-1)^{n-1} + \sum_{n=2}^{\infty} (n)(n-1)\,a_n(x-1)^{n-2} + 2\sum_{n=0}^{\infty} a_n(x-1)^n = 0.$

Let $$u = n - 2$$ in the first summation, $$u = n - 2$$ in the second and then changing the index variable back to $$n$$ gives

$\sum_{n=1}^{\infty} (n+1)n\,a_{n+1}(x-1)^{n} + \sum_{n=0}^{\infty} (n+2)(n+1)\,a_{n+2}(x-1)^{n} + \sum_{n=0}^{\infty} 2a_n(x-1)^n = 0.$

Now plugging in $$n = 0$$ into the second and third series (to establish shared indices) we get

$2a_2 + 2a_0 + \sum_{n=1}^{\infty} (n+1)n\,a_{n+1}(x-1)^{n} + \sum_{n=1}^{\infty} (n+2)(n+1)\,a_{n+2}(x-1)^{n} + \sum_{n=1}^{\infty} 2a_n(x-1)^n = 0.$

Now we can equate coefficients to find

$2a_2 + 2a_0 = 0$

$(n + 1) n \, a_{n+1} + (n + 2)(n + 1)\, a_{n+2} + 2 a_n = 0.$

The first equation says that

$a_2 = -a_0.$

The recursion relationship says

$a_{n+2} = \dfrac{ -(n + 1)\, n\, a_{n+1} - 2a_n}{(n + 2)(n + 1)} .$

We want to find two linearly independent solutions. To do this, we can choose the first two terms of the series. The easiest choices are

$a_0 = 0 \;\;\; \text{and} \;\;\; a_1 = 1$

or

$a_0 = 1 \;\;\; \text{and} a_1 = 0$

Plugging the first pair, we get

$a_0 = 0$

$a_1 = 1$

$a_2 = 0$

$a_3 = \dfrac{-2(0) - 2(1)}{6} = -\dfrac{1}{3}$

$a_4 = \dfrac{-2(3)(-1/3) - 2(0)}{12} = \dfrac{1}{6} .$

Plugging in the second pair, we get

$a_0 = 1$

$a_1 = 0$

$a_2 = -1$

$a_3 = \dfrac{-2(-1) - 2(0)}{6} = \dfrac{1}{3}.$

We can write

$y_1 = (x - 1) - 1/3 (x - 1)^3 + 1/6 (x - 1)^4 + \, ...$

$y_2 = 1 - (x - 1)^2 + 1/3 (x - 1)^3 + \, ...$

Example $$\PageIndex{3}$$

Solve

$(x^2-1)y''+xy'-y=0$

Solution

Let

$y = \sum_{n=0}^{\infty} a_n\,x^n$

then

$y' = \sum_{n=1}^{\infty} n\,a_n\,x^{n-1}$

and

$y'' = \sum_{n=2}^{\infty} n(n-1)\, a_n\,x^{n-2}$

We can write the original differential equation as

$x^2 y'' - y'' + xy' -y =0$

Substituting back into this differential equation

$(x^2-1)\sum_{n=2}^{\infty} n(n-1)\, a_n\,x^{n-2}+x\sum_{n=1}^{\infty} n\,a_n\,x^{n-1}-\sum_{n=0}^{\infty} a_n\,x^n=0$

and multiplying the $$x^2$$ through gives

$\sum_{n=2}^{\infty} n(n-1)\, a_n\,x^{n} - \sum_{n=2}^{\infty} n(n-1)\, a_n\,x^{n-2} + \sum_{n=1}^{\infty} n\,a_n\,x^{n}-\sum_{n=0}^{\infty} a_n\,x^n=0$

We next need to make the second term has the nth power of $$x$$ instead of $$n-2$$. For this term, we let

$$u = n – 2$$ and $$n = u + 2$$

The second term becomes

$\sum_{u=0}^{\infty} (u+2)(u+1) a_{u+2}x^u$

now changing this back to $$n$$ and placing the term back into the differential equation gives

$\sum_{n=2}^{\infty} n(n-1)\, a_n\,x^{n} - \sum_{n=0}^{\infty} (n+2)(n+1)\, a_{n+2}\,x^{n} + \sum_{n=1}^{\infty} n\,a_n\,x^{n}-\sum_{n=0}^{\infty} a_n\,x^n=0$

Since they sums do not all start at the same number, we pull out the $$n = 0$$ and $$n = 1$$ terms to get

$-2a_2 - 6a_3\, x + a_1\, x - a_0 - a_1\, x + \sum_{n=2}^{\infty} n(n-1)a_n \, x^n - \sum_{n=0}^{\infty} (n+2)(n+1)a_{n+2}, x^n + \sum_{n=1}^{\infty} n\,a_n\, x^n - \sum_{n=0}^{\infty} a_n\, x^n = 0$

or

$-2a_2 - 6a_3\,x - a_0 + \sum_{n=2}^{\infty} n(n-1)a_n \, x^n - \sum_{n=2}^{\infty} (n+2)(n+1)a_{n+2}, x^n + \sum_{n=2}^{\infty} n\,a_n\, x^n - \sum_{n=2}^{\infty} a_n\, x^n = 0$

We can now combine the series to get

$-2a_2 - 6a_3\, x - a_0 + \sum_{n=2}^{\infty} \left[ n(n-1)a_n - (n+2)(n+1)a_{n+2} + n\,a_n - a_n \right] = 0$

We are looking for two linearly independent solutions, so we let the first one be such that

$$y(0) = 0$$ and $$y’(0) = 1$$

this implies that

$$a_0 = 0$$ and $$a_1 = 1$$

from our last equation we have

$0 = -2a_2 – a_0 = -2a_2$

or

$a_2 = 0$

We also have

$0 = - 6a_3$

or

$a_3 = 0$

The terms from the series must all be zero, since that is what it means for a polynomial to be zero. Hence

$n(n-1)\,a_n -(n+2)(n+1)\,a_{n+2} + n\,a_n - a_n = 0$

$(n+2)(n+1)\,a_{n+2} = \left[ n(n-1)+n-1 \right] a_n = (n-1)(n+1)a_n$

$a_{n+2} = \dfrac{n-1}{n+1} a_n$

Notice that since

$a_2 = a_3 = 0$

All of the rest of the coefficients must be zero, since they are each a multiple of the coefficient two before them. Therefore the first linear independent solution is

$y_1 = x$

For the second linearly independent solution, we let

$$y(0) = 1$$ and $$y’(0) = 0$$

this implies that

$$a_0 = 1$$ and $$a_1 = 0$$

from our last equation we have

$1 = -2a_2 – a_0 = -2a_2 - 1$

or

$a_2 = -1$

We also have

$0 = -6a_3$

or

$a_3 = 0$

we still have

$a_{n+2} =\dfrac{n-1}{n+1}a_n$

so notice that the odd terms are all zero. For the even terms, we have

\begin{align*} a_4 &= -\dfrac{1}{3} \\[5pt] a_6 &= \dfrac{3}{5}\dfrac{1}{3}= \dfrac{1}{5} \\[5pt] a_8 &= -\dfrac{5}{7}\dfrac{1}{5} = -\dfrac{1}{7} \\[5pt] a_{2n} &= \dfrac{(-1)^{n+1}}{2n-1} \end{align*}

This one has the series representation

$y_2 = \sum_{n=1}^{\infty} \dfrac{(-1)^{n+1}}{2n-1} x^{2n}$