Three-term Recurrence Relation
In the last tutorial, we dealt with ODEs that take a very simple form of having only the dependent variable and its second derivative with some constant coefficients, hence resulting in a neat two-term recurrence relation. However, it will be seldom the case: if there is also the first derivative involved, the recurrence relation will generally consist of three terms that will be much harder to compute. Here, we will explore a more tractable case of the old second-order constant-coefficient ODEs, about how to retrieve a special expression for the coefficients in the series solution.
Let’s take a look at the ODE below:
\begin{align}
\frac{d^2y}{dx^2} -3\frac{dy}{dx} + 2y = x \tag{1}
\end{align}
We should have known that \( y_1 = e^x \) and \( y_2 = e^{2x} \) are the two complementary solutions from the usual approach. Now put the old (1)-(3) in the last tutorial to (1) above, to get
\begin{align}
\sum_{n=2}^{\infty} n(n-1) a_n x^{n-2} -3 \sum_{n=1}^{\infty} n a_nx^{n-1} + 2 \sum_{n=0}^{\infty} a_n x^n &= x \\
\sum_{n=0}^{\infty} (n+2)(n+1) a_{n+2} x^n -3 \sum_{n=0}^{\infty} (n+1) a_{n+1}x^n + 2 \sum_{n=0}^{\infty} a_n x^n &= x \tag{2}
\end{align}
As before, we shifted the indices in the first two summations by \( 2 \) and \( 1 \). Now we will address the homogeneous part first and ignore \( x \) on the R.H.S. to get the general recurrence relation first:
\begin{align}
(n+2)(n+1) a_{n+2} -3(n+1) a_{n+1} + 2 a_n = 0 \\
\Rightarrow a_{n+2} = \frac{3}{n+2}a_{n+1} -\frac{2}{(n+2)(n+1)} a_n \tag{3}
\end{align}
Due to the pattern of the denominators, it is natural to guess that the \( a_n \) should also contain a factor of \( 1/n! \) for (3) to hold throughout the iteration. To see this, suppose \( a_n = b_n / n! \) and we shall obtain
\begin{align}
\frac{b_{n+2}}{(n+2)!} &= \frac{3}{n+2}\frac{b_{n+1}}{(n+1)!} -\frac{2}{(n+2)(n+1)} \frac{b_n}{n!} \\
\frac{b_{n+2}}{(n+2)!} &= 3\frac{b_{n+1}}{(n+2)!} -2 \frac{b_n}{(n+2)!} \\
b_{n+2} &= 3b_{n+1} -2b_n \tag{4}
\end{align}
which looks much simpler. Borrowing the knowledge in Linear Algebra, we know that this translates to the matrix system
\begin{align}
\begin{bmatrix}
b_{n+2} \\
b_{n+1}
\end{bmatrix}
=
\begin{bmatrix}
3 & -2 \\
1 & 0
\end{bmatrix}
\begin{bmatrix}
b_{n+1} \\
b_n
\end{bmatrix} \tag{5}
\end{align}
This prompts us to compute the diagonalization of the matrix, essentially expressing the coefficients in a new basis so they only contain simple powers. We don’t actually have to compute that basis but only the eigenvalues:
\begin{align}
\begin{vmatrix}
3-\lambda & -2 \\
1 & -\lambda
\end{vmatrix} &= 0 \\
-(3-\lambda)\lambda -(-2) &=0 \\
\lambda^2 -3\lambda + 2 = (\lambda-1)(\lambda-2)&= 0 \tag{6}
\end{align}
This reminds us of the usual auxiliary equation. (Admittedly, we have the benefit of hindsight.) So \( \lambda = 1,2 \) and the \( b_n \) will take the form of \( c_1\lambda_1^n + c_2\lambda_2^n \), and
\begin{align}
a_n = \frac{c_1}{n!} + \frac{c_2 2^n}{n!} \tag{7}
\end{align}
Therefore, we arrive at the usual complementary solution of
\begin{align}
y_c &= \sum_{n=0}^{\infty} (\frac{c_1}{n!} + \frac{c_2 2^n}{n!}) x^n \\
&= \sum_{n=0}^{\infty} \frac{c_1x^n}{n!} + \sum_{n=0}^{\infty}\frac{c_2 (2x)^n}{n!} \\
&= c_1e^x + c_2e^{2x} \tag{8}
\end{align}
For the particular solution, we consider (2) again, but with \( x \) added back to R.H.S. Since \( x \) is only a finite polynomial with degree of \(1\), we only need to consider \( n = 0, 1 \):
\begin{align}
\left\{
\begin{aligned}
2a_2 -3a_1 + 2a_0 &= 0 \\
6a_3 -6a_2 + 2a_1 &= 1
\end{aligned}\right. \tag{9}
\end{align}
Moreover, since this will be the particular solution, the higher-degree coefficients must not depend on the previous ones, and here it implies that \( a_1 \) must be exactly \( 1/2 \) by the second equation (so that \(a_2 = a_3 = \ldots = 0 \) computed from the three-term recurrence relation in the future, can be just set to zero and not related to \(a_0, a_1) \), and \( a_0 = 3/4 \) from the first equation, i.e. \( y_p = x/2 + 3/4 \), a polynomial particular solution.
Exercise
Find the series solution to the ODE
\begin{align}
\frac{d^2y}{dx^2} + 2\frac{dy}{dx} + y = 0 \tag{10}
\end{align}
Answer
Again, put all the relevant expressions into (10) and rearrange the indices:
\begin{align}
\sum_{n=2}^{\infty} n(n-1) a_n x^{n-2} + 2 \sum_{n=1}^{\infty} n a_nx^{n-1} + \sum_{n=0}^{\infty} a_n x^n &= 0 \\
\sum_{n=0}^{\infty} (n+2)(n+1) a_{n+2} x^{n} + 2 \sum_{n=0}^{\infty} (n+1) a_{n+1}x^{n} + \sum_{n=0}^{\infty} a_n x^n &= 0
\end{align}
The recurrence relation is
\begin{align}
(n+2)(n+1) a_{n+2} + 2 (n+1) a_{n+1} + a_n = 0 \\
\Rightarrow a_{n+2} = -2\frac{a_{n+1}}{n+2} -\frac{a_n}{(n+2)(n+1)}
\end{align}
As just suggested before, write \( a_n = b_n/n! \) to further obtain
\begin{align}
\frac{b_{n+2}}{(n+2)!} &= -2\frac{b_{n+1}}{(n+2)(n+1)!} -\frac{b_n}{(n+2)(n+1)n!} \\
b_{n+2} &= -2b_{n+1} -b_n
\end{align}
The corresponding matrix system is
\begin{align}
\begin{bmatrix}
b_{n+2} \\
b_{n+1}
\end{bmatrix}
=
\begin{bmatrix}
-2 & -1 \\
1 & 0
\end{bmatrix}
\begin{bmatrix}
b_{n+1} \\
b_n
\end{bmatrix}
\end{align}
The matrix has a repeated (an algebraic multiplicity of \(2\)) eigenvalue of \( \lambda = -1 \):
\begin{align}
\begin{vmatrix}
-2-\lambda & -1 \\
1 & -\lambda
\end{vmatrix} &= 0 \\
-(-2-\lambda)\lambda -(-1) &=0 \\
\lambda^2 +2\lambda + 1 = (\lambda+1)^2&= 0
\end{align}
So \( b_n \) will contain a \( (-1)^n \) term. Apart from this, we need a second series to complete the general solution. Again, with the benefit of hindsight, we may try \( n(-1)^n \), inspired by the original repeated root case for the auxiliary equation. Let’s see if these really work (\(b_{n} = c_1(-1)^{n} + c_2n(-1)^{n} \)):
\begin{align}
\text{L.H.S.} &= b_{n+2} \\
&= c_1(-1)^{n+2} + c_2(n+2)(-1)^{n+2} \\
&= c_1(2-1) (-1)^{n+2} + c_2(2(n+1) -n)(-1)^{n+2} \\
&= -2c_1(-1)^{n+1} -c_1(-1)^n -2c_2(n+1)(-1)^{n+1} -c_2n(-1)^n \\
&= -2[c_1(-1)^{n+1} + c_2(n+1)(-1)^{n+1}] -[c_1(-1)^n + c_2n(-1)^n] \\
&= -2b_{n+1} -b_n = \text{R.H.S.}
\end{align}
This works nicely, hence we may have \( a_n = c_1(-1)^{n}/n! + c_2n(-1)^{n}/n! \), and
\begin{align}
y &= \sum_{n=0}^{\infty} (\frac{c_1(-1)^n}{n!} + \frac{c_2 n(-1)^n}{n!}) x^n \\
&= \sum_{n=0}^{\infty} \frac{c_1(-x)^n}{n!} + \sum_{n=1}^{\infty} \frac{c_2n(-x)^n}{n!} \\
&= c_1e^{-x} + c_2\sum_{n=1}^{\infty} \frac{(-x)^n}{(n-1)!} \\
&= c_1e^{-x} + c_2\sum_{n=0}^{\infty} \frac{(-x)^{n+1}}{n!} \\
&= c_1e^{-x} -c_2x \sum_{n=0}^{\infty} \frac{(-x)^{n}}{n!} = c_1e^{-x} -c_2xe^{-x}
\end{align}
where in the second line we remove the non-existent \( n=0 \) term in the second summation, and in the fourth line we replace \( n \) by \( n+1\).








Leave a Reply