$$\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

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

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$$  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$$  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

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$$ and $$a_1 = 1$$

or

$$a_0 = 1$$ 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 + \, ...$