# Thread: solving ODE using power series

1. ## solving ODE using power series

I'm trying to solve an ordinary differential equation, with non-constant coefficients, using a

power series solution. The question is as follows:

----------------------------------------------------------------

solve the initial value problem:

$x(2-x)y'' - 6(x-1)y' - 4y = 0$
$y(1)=1$
$y'(1) = 0$

hint: since the initial condition is given at $x_0 = 1$, it is best to write the

solution as a series centered at $x_0 = 1$.

---------------------------------------------------------------

I have attempted the question, but I got stuck in one of the steps. Here's what I have so far:

assume the solution can be written as a power series centered about x = 1. Then the solution and

its derivatives are:

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

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

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

where the $a_n$ are constant coefficients.

Substitute y, y', and y'' into the ODE in order to determine the $a_n$:

$x(2-x)\displaystyle\sum_{n=2}^{\infty}{n (n-1) a_n (x-1)^{n-2}}-6(x-1)\displaystyle\sum_{n=

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

$(1-(x-1)^2)\displaystyle\sum_{n=2}^{\infty}{n (n-1) a_n (x-1)^{n-2}}-6(x-1)

\displaystyle\sum_{n=1}^{\infty}{n a_n (x-1)^{n-1}}-4\displaystyle\sum_{n=0}^{\infty}{a_n (x-1)

^n} = 0$

$\displaystyle\sum_{n=2}^{\infty}{n (n-1) a_n ((x-1)^{n-2}- (x-1)^n)}-6\displaystyle\sum_{n=

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

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

{n (n-1) a_n (x-1)^n} -6\displaystyle\sum_{n=1}^{\infty}{n a_n (x-1)^n}-4\displaystyle\sum_{n=0}

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

now I need to shift indices to make all the exponents of (x-1) equal to n, and also to try to

make all the summations start at n=0:

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

{\infty}{n (n-1) a_n (x-1)^n} -6\displaystyle\sum_{n=1}^{\infty}{n a_n (x-1)^n}-4

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

I don't know how to proceed from here. I have 4 summations. Two of them start at n=0 and has

the $(x-1)^n$ factor. The other two summations start at n=2 or n=1. I can't get them

to start at n=0 because if I try to do that, then I get:

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

and

$6\displaystyle\sum_{n=0}^{\infty}{(n+1) a_{n+1} (x-1)^{n+1}}$

As you can see, these have the factors $(x-1)^{n+2}$ and $(x-1)^{n+1}$

instead of $(x-1)^n$. So I don't know how to combine all this, since the summations

do not start at the same number.

--------------------------------------------------------------
I'm told that in the end, the answer to the coefficients should be:

$a_{2n} = (n+1)a_0$ and $a_{2n+1} = \frac{2n+3}{3}a_1$

So I just don't know how to get from the point I'm stuck to this answer. I'm also quite confused

as to how to solve the initial value problem, after obtaining the expected answer. The initial

conditions are: $y(1)=1$, $y'(1) = 0$. Using the initial condition y(1)

= 1, I get:

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

This does not make sense...what am I doing wrong?

2. You have to consider the first few terms separately. If one sum starts at 0 and the other starts at 1, it just means that the first coefficient in the latter sum is zero. So if you only consider the coefficient in front of the zero order term in the whole expression, that will consist of only the term coming from (the first term of) the first sum.

3. On the second thought, you don't even need to write out the first terms separately, because the expressions in this case are so that if you just extend the summation limit down to n=0, exactly the right terms become zero. For example,

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

because the factor n(n-1) is zero when n=0 or n=1.

Your attempt to make the sums start at 0 is not exactly how it should be done in this case, because that makes the power of x inconsistent with the other sums.

I would also suggest first make the variable substitution z=x-1 to make computation simpler.

4. Thanks for your response. So it seems that I can just rewrite the two summations that are giving me trouble as starting at zero, without shifting the indices.

I'm still not sure how to solve the initial value problem. Since the initial value is x=1, when I try to substitute x=1 into the expression for y, the whole sum becomes 0

5. edit: oh, that's what we're doing. Never mind - --

6. Originally Posted by jessa234
Using the initial condition y(1)

= 1, I get:

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

This does not make sense...what am I doing wrong?
Except for the n = 0 term, of course!!!

7. Originally Posted by jessa234
try to

make all the summations start at n=0:

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

{\infty}{n (n-1) a_n (x-1)^n} -6\displaystyle\sum_{n=1}^{\infty}{n a_n (x-1)^n}-4

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

I don't know how to proceed from here. I have 4 summations. Two of them start at n=0 and has

the $(x-1)^n$ factor. The other two summations start at n=2 or n=1. I can't get them

to start at n=0 because if I try to do that, then I get:

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

and

$6\displaystyle\sum_{n=0}^{\infty}{(n+1) a_{n+1} (x-1)^{n+1}}$

As you can see, these have the factors $(x-1)^{n+2}$ and $(x-1)^{n+1}$

instead of $(x-1)^n$. So I don't know how to combine all this, since the summations

do not start at the same number.
Also, if you plug in n=0 in this expression, I get $2 a_0 = a_2$ so you should have SOME confidence in this answer.

And who says that all of your terms have to have the same power?

8. Originally Posted by jessa234
I'm still not sure how to solve the initial value problem. Since the initial value is x=1, when I try to substitute x=1 into the expression for y, the whole sum becomes 0
The whole sum does not become zero when x=1. When you write power series in the form $f(x) = \sum_{n=0}^{\infty}a_n(x-1)^n$ you are implicitly assuming $(x-1)^0=1$ for all x including $x=1$. In short, $0^0\equiv 1$ when it comes to power series. Without this shorthand one must write the power series in the form $f(x) = a_0 + \sum_{n=1}^{\infty}a_n(x-1)^n$.

To solve this particular problem, the first thing to do is to make the substitution $z=x-1$. This will simplify things a lot; hence the hint. The derivatives with respect to z are easy to compute via the chain rule:
$\frac{dy}{dz} = \frac{dx}{dz}\, \frac{dy}{dx} = 1\cdot \frac{dy}{dx} = y'$. Thus the same differential equation applies with the substitution, but now you have

$(z+1)(2-(z+1))\,\frac{d^2y}{dz^2} - 6z\,\frac{dy}{dz} - 4y = 0$

This simplifies even more (I'll let you work that out). Next write y as a power series in z about z=0 (this is the same power series as the series in x about x=1) and compute the derivatives. Next collect terms with equal powers so you have something that looks like

$\sum_{n=0}^{\infty} b_n z^n = 0$

This can be true for all z if and only if each bn is identically zero (Jess: Justify this step.) Setting the terms to zero should give you a recursive relationship of the form

$a_{\{n+\text{offset}\}} + f(n)a_n = 0$

I'll let you figure out what that offset is. With this, you should be able to show that

$a_{2n} = (n+1)a_0$ and $a_{2n+1} = \frac{2n+3}{3}a_1$

Finally, solve for a0 and a1 using the given initial conditions.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•