Power series solutions are another technique we can use to solve 2nd-order homogeneous ODEs of the form
y ′ ′ + p ( x ) y ′ + q ( x ) y = 0 y^{\prime\prime} + p(x) y^{\prime} + q(x) y = 0 y ′′ + p ( x ) y ′ + q ( x ) y = 0 This is useful for more-general cases where our other techniques fail.
For example, how would you find the solution to this ODE?
( 1 + x 2 ) y ′ ′ − 4 x y ′ + 6 y = 0 (1 + x^2) y^{\prime\prime} - 4 x y^{\prime} + 6y = 0 ( 1 + x 2 ) y ′′ − 4 x y ′ + 6 y = 0 None of the methods we’ve discussed so far would allow us to find an analytical solution to this problem—but we can using a power series solution.
Power series solutions will be of the form
y = ∑ n = 0 ∞ a n x n y = \sum_{n=0}^{\infty} a_n x^n y = n = 0 ∑ ∞ a n x n where the coefficients a n a_n a n are what we need to find.
First, for power series to be a valid solution, we need to check whether x = 0 x=0 x = 0 is an ordinary point of the ODE: is the ODE continuous and bounded at x = 0 x=0 x = 0 ?
Continuous means that there should be no discontinuity at x = 0 x=0 x = 0 .
Bounded means that the solution should be finite at x = 0 x=0 x = 0 .
For example, consider the ODE
y ′ ′ − 4 x y ′ + ( 4 x 2 − 2 ) y = 0 y^{\prime\prime} - 4xy^{\prime} + (4x^2 - 2)y = 0 y ′′ − 4 x y ′ + ( 4 x 2 − 2 ) y = 0 Both p ( x ) = − 4 x p(x) = -4x p ( x ) = − 4 x and q ( x ) = ( 4 x 2 − 2 ) q(x) = (4x^2 - 2) q ( x ) = ( 4 x 2 − 2 ) are continuous and bounded at x = 0 x=0 x = 0 , so x = 0 x=0 x = 0 is an ordinary point.
On the other hand, what about
y ′ ′ + x 3 y ′ + 1 x y = 0 ? y^{\prime\prime} + x^3 y^{\prime} + \frac{1}{x} y = 0 \text{ ?} y ′′ + x 3 y ′ + x 1 y = 0 ? In this case, the solution is unbounded at x = 0 x=0 x = 0 , and so it is not an ordinary point.
If x = 0 x=0 x = 0 is an ordinary point, then we can find a solution in the form of a power series:
y = ∑ n = 0 ∞ a n x n y = \sum_{n=0}^{\infty} a_n x^n y = n = 0 ∑ ∞ a n x n We then solve for the coefficients a n a_n a n by plugging this in to the ODE. To do that, we’ll need to take advantage of certain properties of power series.
Properties of power series ¶ ∑ n = 0 ∞ a n x n = ∑ m = 0 ∞ a m x m \sum_{n=0}^{\infty} a_n x^n = \sum_{m=0}^{\infty} a_m x^m n = 0 ∑ ∞ a n x n = m = 0 ∑ ∞ a m x m This is because the index variable is just a “dummy” that only has meaning inside the sum.
x ∑ n = 0 ∞ a n x n = ∑ n = 0 ∞ a n x n + 1 x \sum_{n=0}^{\infty} a_n x^n = \sum_{n=0}^{\infty} a_n x^{n+1} x n = 0 ∑ ∞ a n x n = n = 0 ∑ ∞ a n x n + 1 y ′ = ∑ n = 0 ∞ a n ( n ) x n − 1 = ∑ n = 1 ∞ a n ( n ) x n − 1 y ′ ′ = ∑ n = 0 ∞ a n ( n ) ( n − 1 ) x n − 2 = ∑ n = 2 ∞ a n ( n ) ( n − 1 ) x n − 2 \begin{align}
y^{\prime} &= \sum_{n=0}^{\infty} a_n (n) x^{n-1} = \sum_{n=1}^{\infty} a_n (n) x^{n-1} \\
y^{\prime\prime} &= \sum_{n=0}^{\infty} a_n (n)(n-1) x^{n-2} = \sum_{n=2}^{\infty} a_n (n)(n-1) x^{n-2}
\end{align} y ′ y ′′ = n = 0 ∑ ∞ a n ( n ) x n − 1 = n = 1 ∑ ∞ a n ( n ) x n − 1 = n = 0 ∑ ∞ a n ( n ) ( n − 1 ) x n − 2 = n = 2 ∑ ∞ a n ( n ) ( n − 1 ) x n − 2 Notice that we can change where the sums in the power series start, because for y ′ y^{\prime} y ′ the term corresponding to n = 1 n=1 n = 1 would just be zero, and similar for the first two terms of y ′ ′ y^{\prime\prime} y ′′ .
Index shift . We can redefine the index used within a sum to shift where it starts. For example, if we let m = n − 1 m=n-1 m = n − 1 , or n = m + 1 n=m+1 n = m + 1 , then:
∑ n = 1 ∞ a n ( n ) x n − 1 = ∑ m = 0 ∞ a m + 1 ( m + 1 ) x m \sum_{n=1}^{\infty} a_n (n) x^{n-1} = \sum_{m=0}^{\infty} a_{m+1} (m+1) x^m n = 1 ∑ ∞ a n ( n ) x n − 1 = m = 0 ∑ ∞ a m + 1 ( m + 1 ) x m Or, in other case, if we let m = n − 2 m=n-2 m = n − 2 , or n = m + 2 n=m+2 n = m + 2 , then:
∑ n = 2 ∞ a n ( n ) ( n − 1 ) x n − 2 = ∑ m = 0 ∞ a m + 2 ( m + 2 ) ( m + 1 ) x m \sum_{n=2}^{\infty} a_n (n)(n-1) x^{n-2} = \sum_{m=0}^{\infty} a_{m+2} (m+2)(m+1) x^m n = 2 ∑ ∞ a n ( n ) ( n − 1 ) x n − 2 = m = 0 ∑ ∞ a m + 2 ( m + 2 ) ( m + 1 ) x m Now, let’s apply these properties to solve ODEs.
Power series example 1 ¶ Let’s try to apply the power series approach to solve
y ′ ′ + y = 0 , y^{\prime\prime} + y = 0 \;, y ′′ + y = 0 , where we know the solution will be y ( x ) = c 1 sin x + c 2 cos x y(x) = c_1 \sin x + c_2 \cos x y ( x ) = c 1 sin x + c 2 cos x .
Is x = 0 x=0 x = 0 an ordinary point? Yes, the ODE is continuous and bounded at x = 0 x=0 x = 0 .
So, we can find a solution of the form y ( x ) = ∑ n = 0 ∞ a n x n y(x) = \sum_{n=0}^{\infty} a_n x^n y ( x ) = ∑ n = 0 ∞ a n x n .
Now, we solve for the coefficents by plugging the power series into the ODE:
∑ n = 2 ∞ a n ( n ) ( n − 1 ) x n − 2 + ∑ n = 0 ∞ a n x n = 0 \sum_{n=2}^{\infty} a_n (n)(n-1) x^{n-2} + \sum_{n=0}^{\infty} a_n x^n = 0 n = 2 ∑ ∞ a n ( n ) ( n − 1 ) x n − 2 + n = 0 ∑ ∞ a n x n = 0 Let’s use the index shift rule on the first part of that:
∑ n = 2 ∞ a n ( n ) ( n − 1 ) x n − 2 → ∑ m = 0 ∞ a m + 2 ( m + 2 ) ( m + 1 ) x m \sum_{n=2}^{\infty} a_n (n)(n-1) x^{n-2} \rightarrow \sum_{m=0}^{\infty} a_{m+2} (m+2)(m+1) x^m n = 2 ∑ ∞ a n ( n ) ( n − 1 ) x n − 2 → m = 0 ∑ ∞ a m + 2 ( m + 2 ) ( m + 1 ) x m Then, we can use the dummy index rule to change m m m back to n n n :
∑ m = 0 ∞ a m ( m + 2 ) ( m + 1 ) x m → ∑ n = 0 ∞ a n ( n + 2 ) ( n + 1 ) x n \sum_{m=0}^{\infty} a_m (m+2)(m+1) x^m \rightarrow \sum_{n=0}^{\infty} a_n (n+2)(n+1) x^n m = 0 ∑ ∞ a m ( m + 2 ) ( m + 1 ) x m → n = 0 ∑ ∞ a n ( n + 2 ) ( n + 1 ) x n Now, let’s replace the first term in the ODE with that, merge both terms into a single sum, and simplify:
∑ n = 0 ∞ a n ( n + 2 ) ( n + 1 ) x n + ∑ n = 0 ∞ a n x n = 0 ∑ n = 0 ∞ x n [ a n + 2 ( n + 2 ) ( n + 1 ) + a n ] = 0 \begin{align}
\sum_{n=0}^{\infty} a_n (n+2)(n+1) x^n + \sum_{n=0}^{\infty} a_n x^n &= 0 \\
\sum_{n=0}^{\infty} x^n \left[ a_{n+2}(n+2)(n+1) + a_n \right] &= 0
\end{align} n = 0 ∑ ∞ a n ( n + 2 ) ( n + 1 ) x n + n = 0 ∑ ∞ a n x n n = 0 ∑ ∞ x n [ a n + 2 ( n + 2 ) ( n + 1 ) + a n ] = 0 = 0 There are infinite terms in this sum, involving the continuous variable x x x ; the only way that equation can be satisfied is if
x = 0 x=0 x = 0 always, which cannot be true, or
a n + 2 ( n + 2 ) ( n + 1 ) + a n = 0 a_{n+2}(n+2)(n+1) + a_n = 0 a n + 2 ( n + 2 ) ( n + 1 ) + a n = 0 for all values of n n n . This is what we can use to find the coefficients of our power series solution.
Use that expression to define a recursive formula for the coefficients:
a n + 2 = − a n ( n + 1 ) ( n + 2 ) a_{n+2} = \frac{-a_n}{(n+1)(n+2)} a n + 2 = ( n + 1 ) ( n + 2 ) − a n We can see that the even coefficients will be related to each other, and the odd coefficients will be related. Let’s try to identify a pattern with each, starting with the even terms:
n = 0 : a 2 = − a 0 1 ⋅ 2 = − a 0 2 ! n = 2 : a 4 = − a 2 3 ⋅ 4 = a 0 4 ! n = 4 : a 6 = − a 4 5 ⋅ 6 = − a 0 6 ! \begin{align}
n=0: \quad a_2 &= \frac{-a_0}{1 \cdot 2} = \frac{-a_0}{2!} \\
n=2: \quad a_4 &= \frac{-a_2}{3 \cdot 4} = \frac{a_0}{4!} \\
n=4: \quad a_6 &= \frac{-a_4}{5 \cdot 6} = \frac{-a_0}{6!}
\end{align} n = 0 : a 2 n = 2 : a 4 n = 4 : a 6 = 1 ⋅ 2 − a 0 = 2 ! − a 0 = 3 ⋅ 4 − a 2 = 4 ! a 0 = 5 ⋅ 6 − a 4 = 6 ! − a 0 and the odd terms:
n = 1 : a 3 = − a 1 2 ⋅ 3 = − a 1 3 ! n = 3 : a 5 = − a 3 4 ⋅ 5 = a 1 5 ! n = 5 : a 7 = − a 5 6 ⋅ 7 = − a 1 7 ! \begin{align}
n=1: \quad a_3 &= \frac{-a_1}{2 \cdot 3} = \frac{-a_1}{3!} \\
n=3: \quad a_5 &= \frac{-a_3}{4 \cdot 5} = \frac{a_1}{5!} \\
n=5: \quad a_7 &= \frac{-a_5}{6 \cdot 7} = \frac{-a_1}{7!}
\end{align} n = 1 : a 3 n = 3 : a 5 n = 5 : a 7 = 2 ⋅ 3 − a 1 = 3 ! − a 1 = 4 ⋅ 5 − a 3 = 5 ! a 1 = 6 ⋅ 7 − a 5 = 7 ! − a 1 Now, let’s put that all together:
y ( x ) = a 0 + a 1 x + a 2 x 2 + a 3 x 3 + … y = a 0 ( 1 − x 2 2 ! + x 4 4 ! + … ) + a 1 ( x − x 3 3 ! + x 5 5 ! + … ) \begin{align}
y(x) &= a_0 + a_1 x + a_2 x^2 + a_3 x^3 + \dots \\
y &= a_0 \left( 1 - \frac{x^2}{2!} + \frac{x^4}{4!} + \dots \right) + a_1 \left( x - \frac{x^3}{3!} + \frac{x^5}{5!} + \dots \right)
\end{align} y ( x ) y = a 0 + a 1 x + a 2 x 2 + a 3 x 3 + … = a 0 ( 1 − 2 ! x 2 + 4 ! x 4 + … ) + a 1 ( x − 3 ! x 3 + 5 ! x 5 + … ) which you might recognize as being the Taylor series expansion of sine and cosine:
y ( x ) = a 0 cos x + a 1 sin x y(x) = a_0 \cos x + a_1 \sin x y ( x ) = a 0 cos x + a 1 sin x So, our unknown coefficients end up being our integration constants, which we can use our two constraints to find.
Power series example 2 ¶ Find the solution to the ODE
( 1 + x 2 ) y ′ ′ − 4 x y ′ + 6 y = 0 (1 + x^2) y^{\prime\prime} - 4x y^{\prime} + 6y = 0 ( 1 + x 2 ) y ′′ − 4 x y ′ + 6 y = 0 First, rearrange into standard form:
y ′ ′ − 4 x 1 + x 2 y ′ + 6 1 + x 2 y = 0 y^{\prime\prime} - \frac{4x}{1+x^2} y^{\prime} + \frac{6}{1+x^2} y = 0 y ′′ − 1 + x 2 4 x y ′ + 1 + x 2 6 y = 0 Then, check whether x = 0 x=0 x = 0 is an ordinary point: yes, it is.
Now, let’s insert the power series into the ODE:
y ′ ′ + x 2 y ′ ′ − 4 x y ′ + 6 y = 0 ∑ n = 2 ∞ a n ( n ) ( n − 1 ) x n − 2 + x 2 ∑ n = 0 ∞ a n ( n ) ( n − 1 ) x n − 2 − 4 x ∑ n = 1 a n ( n ) x n − 1 + 6 ∑ n = 0 ∞ a n x n = 0 \begin{align}
y^{\prime\prime} + x^2 y^{\prime\prime} - 4 x y^{\prime} + 6 y &= 0 \\
\sum_{n=2}^{\infty} a_n (n)(n-1)x^{n-2} + x^2 \sum_{n=0}^{\infty} a_n (n)(n-1)x^{n-2} - 4 x \sum_{n=1} a_n (n) x^{n-1} + 6 \sum_{n=0}^{\infty} a_n x^n &= 0
\end{align} y ′′ + x 2 y ′′ − 4 x y ′ + 6 y n = 2 ∑ ∞ a n ( n ) ( n − 1 ) x n − 2 + x 2 n = 0 ∑ ∞ a n ( n ) ( n − 1 ) x n − 2 − 4 x n = 1 ∑ a n ( n ) x n − 1 + 6 n = 0 ∑ ∞ a n x n = 0 = 0 First, we’ll use the power rule:
∑ n = 2 ∞ a n ( n ) ( n − 1 ) x n − 2 + ∑ n = 2 ∞ a n ( n ) ( n − 1 ) x n − 4 ∑ n = 1 a n ( n ) x n + 6 ∑ n = 0 ∞ a n x n = 0 \sum_{n=2}^{\infty} a_n (n)(n-1)x^{n-2} + \sum_{n=2}^{\infty} a_n (n)(n-1)x^{n} - 4 \sum_{n=1} a_n (n) x^{n} + 6 \sum_{n=0}^{\infty} a_n x^n = 0 n = 2 ∑ ∞ a n ( n ) ( n − 1 ) x n − 2 + n = 2 ∑ ∞ a n ( n ) ( n − 1 ) x n − 4 n = 1 ∑ a n ( n ) x n + 6 n = 0 ∑ ∞ a n x n = 0 and then the index shift and dummy index rules on the first term:
∑ n = 2 ∞ a n ( n ) ( n − 1 ) x n − 2 → ∑ m = 0 ∞ a m + 2 ( m + 2 ) ( m + 1 ) x m → ∑ n = 0 ∞ a n + 2 ( n + 2 ) ( n + 1 ) x n \sum_{n=2}^{\infty} a_n (n)(n-1)x^{n-2} \rightarrow \sum_{m=0}^{\infty} a_{m+2} (m+2)(m+1) x^m \rightarrow \sum_{n=0}^{\infty} a_{n+2} (n+2)(n+1) x^n n = 2 ∑ ∞ a n ( n ) ( n − 1 ) x n − 2 → m = 0 ∑ ∞ a m + 2 ( m + 2 ) ( m + 1 ) x m → n = 0 ∑ ∞ a n + 2 ( n + 2 ) ( n + 1 ) x n Then, put that back into the full equation and combine the sums:
∑ n = 0 ∞ a n + 2 ( n + 2 ) ( n + 1 ) x n + ∑ n = 0 ∞ a n ( n ) ( n − 1 ) x n − 4 ∑ n = 1 a n ( n ) x n + 6 ∑ n = 0 ∞ a n x n = 0 ∑ n = 0 ∞ x n [ a n + 2 ( n + 2 ) ( n + 1 ) + a n ( n ) ( n − 1 ) − 4 a n ( n ) + 6 a n ] = 0 a n + 2 ( n + 2 ) ( n + 1 ) + a n ( n 2 − 5 n + 6 ) = 0 a n + 2 ( n + 2 ) ( n + 1 ) + a n ( n − 3 ) ( n − 2 ) = 0 \begin{align}
\sum_{n=0}^{\infty} a_{n+2} (n+2)(n+1) x^n + \sum_{n=0}^{\infty} a_n (n)(n-1)x^{n} - 4 \sum_{n=1} a_n (n) x^{n} + 6 \sum_{n=0}^{\infty} a_n x^n &= 0 \\
\sum_{n=0}^{\infty} x^n \left[ a_{n+2} (n+2)(n+1) + a_n (n)(n-1) - 4a_n (n) + 6a_n \right] &= 0 \\
a_{n+2} (n+2)(n+1) + a_n (n^2 -5n + 6) &= 0 \\
a_{n+2} (n+2)(n+1) + a_n (n-3)(n-2) &= 0 \\
\end{align} n = 0 ∑ ∞ a n + 2 ( n + 2 ) ( n + 1 ) x n + n = 0 ∑ ∞ a n ( n ) ( n − 1 ) x n − 4 n = 1 ∑ a n ( n ) x n + 6 n = 0 ∑ ∞ a n x n n = 0 ∑ ∞ x n [ a n + 2 ( n + 2 ) ( n + 1 ) + a n ( n ) ( n − 1 ) − 4 a n ( n ) + 6 a n ] a n + 2 ( n + 2 ) ( n + 1 ) + a n ( n 2 − 5 n + 6 ) a n + 2 ( n + 2 ) ( n + 1 ) + a n ( n − 3 ) ( n − 2 ) = 0 = 0 = 0 = 0 Thus, our recursion formula for the coefficients a n a_n a n is
a n + 2 = − a n ( n − 3 ) ( n − 2 ) ( n + 1 ) ( n + 2 ) a_{n+2} = -a_n \frac{(n-3)(n-2)}{(n+1)(n+2)} a n + 2 = − a n ( n + 1 ) ( n + 2 ) ( n − 3 ) ( n − 2 ) Again, we can see that the even terms will be related and the odd terms will be related:
n = 0 : a 2 = − a 0 6 2 = − 3 a 0 n = 2 : a 4 = 0 n = 4 : a 6 = − a 4 2 30 = 0 … \begin{align}
n=0: \quad a_2 &= -a_0 \frac{6}{2} = -3 a_0 \\
n=2: \quad a_4 &= 0 \\
n=4: \quad a_6 &= -a_4 \frac{2}{30} = 0 \\
&\ldots
\end{align} n = 0 : a 2 n = 2 : a 4 n = 4 : a 6 = − a 0 2 6 = − 3 a 0 = 0 = − a 4 30 2 = 0 … and the odd terms:
n = 1 : a 3 = − a 1 2 6 = − a 1 3 n = 3 : a 5 = 0 n = 5 : a 7 = − a 5 6 42 = 0 … \begin{align}
n=1: \quad a_3 &= -a_1 \frac{2}{6} = \frac{-a_1}{3} \\
n=3: \quad a_5 &= 0 \\
n=5: \quad a_7 &= -a_5 \frac{6}{42} = 0 \\
&\ldots
\end{align} n = 1 : a 3 n = 3 : a 5 n = 5 : a 7 = − a 1 6 2 = 3 − a 1 = 0 = − a 5 42 6 = 0 … The solution is then
y ( x ) = a 0 + a 1 x − 3 a 0 x 2 − a 1 3 x 3 y = a 0 ( 1 − 3 x 2 ) + a 1 ( x − x 3 3 ) \begin{align}
y(x) &= a_0 + a_1 x - 3 a_0 x^2 - \frac{a_1}{3} x^3 \\
y &= a_0 \left(1 - 3x^2 \right) + a_1 \left( x - \frac{x^3}{3} \right)
\end{align} y ( x ) y = a 0 + a 1 x − 3 a 0 x 2 − 3 a 1 x 3 = a 0 ( 1 − 3 x 2 ) + a 1 ( x − 3 x 3 ) where we find a 0 a_0 a 0 and a 1 a_1 a 1 using our initial or boundary conditions.