Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

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=0y^{\prime\prime} + p(x) y^{\prime} + 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+x2)y4xy+6y=0(1 + x^2) y^{\prime\prime} - 4 x y^{\prime} + 6y = 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=0anxny = \sum_{n=0}^{\infty} a_n x^n

where the coefficients ana_n are what we need to find.

  1. First, for power series to be a valid solution, we need to check whether x=0x=0 is an ordinary point of the ODE: is the ODE continuous and bounded at x=0x=0?

Continuous means that there should be no discontinuity at x=0x=0.

Bounded means that the solution should be finite at x=0x=0.

For example, consider the ODE

y4xy+(4x22)y=0y^{\prime\prime} - 4xy^{\prime} + (4x^2 - 2)y = 0

Both p(x)=4xp(x) = -4x and q(x)=(4x22)q(x) = (4x^2 - 2) are continuous and bounded at x=0x=0, so x=0x=0 is an ordinary point.

On the other hand, what about

y+x3y+1xy=0 ?y^{\prime\prime} + x^3 y^{\prime} + \frac{1}{x} y = 0 \text{ ?}

In this case, the solution is unbounded at x=0x=0, and so it is not an ordinary point.

  1. If x=0x=0 is an ordinary point, then we can find a solution in the form of a power series:

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

We then solve for the coefficients ana_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=0anxn=m=0amxm\sum_{n=0}^{\infty} a_n x^n = \sum_{m=0}^{\infty} a_m x^m

This is because the index variable is just a “dummy” that only has meaning inside the sum.

xn=0anxn=n=0anxn+1x \sum_{n=0}^{\infty} a_n x^n = \sum_{n=0}^{\infty} a_n x^{n+1}
y=n=0an(n)xn1=n=1an(n)xn1y=n=0an(n)(n1)xn2=n=2an(n)(n1)xn2\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}

Notice that we can change where the sums in the power series start, because for yy^{\prime} the term corresponding to n=1n=1 would just be zero, and similar for the first two terms of yy^{\prime\prime}.

n=1an(n)xn1=m=0am+1(m+1)xm\sum_{n=1}^{\infty} a_n (n) x^{n-1} = \sum_{m=0}^{\infty} a_{m+1} (m+1) x^m

Or, in other case, if we let m=n2m=n-2, or n=m+2n=m+2, then:

n=2an(n)(n1)xn2=m=0am+2(m+2)(m+1)xm\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

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 \;,

where we know the solution will be y(x)=c1sinx+c2cosxy(x) = c_1 \sin x + c_2 \cos x.

  1. Is x=0x=0 an ordinary point? Yes, the ODE is continuous and bounded at x=0x=0. So, we can find a solution of the form y(x)=n=0anxny(x) = \sum_{n=0}^{\infty} a_n x^n.

  2. Now, we solve for the coefficents by plugging the power series into the ODE:

n=2an(n)(n1)xn2+n=0anxn=0\sum_{n=2}^{\infty} a_n (n)(n-1) x^{n-2} + \sum_{n=0}^{\infty} a_n x^n = 0

Let’s use the index shift rule on the first part of that:

n=2an(n)(n1)xn2m=0am+2(m+2)(m+1)xm\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

Then, we can use the dummy index rule to change mm back to nn:

m=0am(m+2)(m+1)xmn=0an(n+2)(n+1)xn\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

Now, let’s replace the first term in the ODE with that, merge both terms into a single sum, and simplify:

n=0an(n+2)(n+1)xn+n=0anxn=0n=0xn[an+2(n+2)(n+1)+an]=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}

There are infinite terms in this sum, involving the continuous variable xx; the only way that equation can be satisfied is if

Use that expression to define a recursive formula for the coefficients:

an+2=an(n+1)(n+2)a_{n+2} = \frac{-a_n}{(n+1)(n+2)}

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:a2=a012=a02!n=2:a4=a234=a04!n=4:a6=a456=a06!\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}

and the odd terms:

n=1:a3=a123=a13!n=3:a5=a345=a15!n=5:a7=a567=a17!\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}

Now, let’s put that all together:

y(x)=a0+a1x+a2x2+a3x3+y=a0(1x22!+x44!+)+a1(xx33!+x55!+)\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}

which you might recognize as being the Taylor series expansion of sine and cosine:

y(x)=a0cosx+a1sinxy(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+x2)y4xy+6y=0(1 + x^2) y^{\prime\prime} - 4x y^{\prime} + 6y = 0

First, rearrange into standard form:

y4x1+x2y+61+x2y=0y^{\prime\prime} - \frac{4x}{1+x^2} y^{\prime} + \frac{6}{1+x^2} y = 0

Then, check whether x=0x=0 is an ordinary point: yes, it is.

Now, let’s insert the power series into the ODE:

y+x2y4xy+6y=0n=2an(n)(n1)xn2+x2n=0an(n)(n1)xn24xn=1an(n)xn1+6n=0anxn=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}

First, we’ll use the power rule:

n=2an(n)(n1)xn2+n=2an(n)(n1)xn4n=1an(n)xn+6n=0anxn=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

and then the index shift and dummy index rules on the first term:

n=2an(n)(n1)xn2m=0am+2(m+2)(m+1)xmn=0an+2(n+2)(n+1)xn\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

Then, put that back into the full equation and combine the sums:

n=0an+2(n+2)(n+1)xn+n=0an(n)(n1)xn4n=1an(n)xn+6n=0anxn=0n=0xn[an+2(n+2)(n+1)+an(n)(n1)4an(n)+6an]=0an+2(n+2)(n+1)+an(n25n+6)=0an+2(n+2)(n+1)+an(n3)(n2)=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}

Thus, our recursion formula for the coefficients ana_n is

an+2=an(n3)(n2)(n+1)(n+2)a_{n+2} = -a_n \frac{(n-3)(n-2)}{(n+1)(n+2)}

Again, we can see that the even terms will be related and the odd terms will be related:

n=0:a2=a062=3a0n=2:a4=0n=4:a6=a4230=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}

and the odd terms:

n=1:a3=a126=a13n=3:a5=0n=5:a7=a5642=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}

The solution is then

y(x)=a0+a1x3a0x2a13x3y=a0(13x2)+a1(xx33)\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}

where we find a0a_0 and a1a_1 using our initial or boundary conditions.