# Power series solutions to diffeq

I am suppose to find the power series solutions to some diffeqs.

$$y'=xy$$

The method is to assume that
$$y=\sum_{n=0}^{\infty}{c_nx^n}$$
is a solution to the diffeq.Then since we can differenitate term by term we have
$$\frac{d}{dx} \left[ \sum_{n=0}^{\infty}{c_nx^n} \right]=\sum_{n=1}^{\infty}{nc_nx^{n-1}}$$

Then we sub these back into our diffeq to get
$$\sum_{n=1}^{\infty}{c_{n}nx^{n-1}}-x\sum_{n=0}^{\infty}{c_nx^n}=$$

$$\sum_{n=1}^{\infty}{c_{n}nx^{n-1}}-\sum_{n=0}^{\infty}{c_nx^{n+1}}=0$$
So now I need to try to get the powers of $$x^n$$ and the starting index the same for both sums. But I cannot seems to figure how to push things into that form.

If I try adding one to the index of the left most series so I have the same starting index I get to
$$\sum_{n=0}^{\infty}c_{n+1}(n+1)x^{n-1} -\sum_{n=0}^{\infty}{c_nx^{n+1}}=0$$

But without having the same powers for x I cannot factor all the x's. How will I get my recurrance relation then?

Thanks for the help

Jeremy

Last edited:

Related Introductory Physics Homework Help News on Phys.org
StatusX
Homework Helper
You'll have to write a few terms of one of the series seperately out front and then start the sum. Actually, the usual method has a sum over xn+s, where n goes from 0 to infinity and s is the starting power. s would be determined by these terms out front. If this problem was given to you and s wasn't mentioned, it should probably work out by itself.

dextercioby
Homework Helper
It's very simple.

$$y= C \sum_{n=0}^{+\infty} c_{n}x^{n}$$(1)

$$\frac{dy}{dx}=C\sum_{n=0}^{+\infty} nc_{n}x^{n-1}$$ (2)

$$xy=C\sum_{n=0}^{+\infty} c_{n}x^{n+1}$$ (3)

Equate (2) & (3) and write the term

$$c_{1}+2c_{2}x+3c_{3}x^{2}+...=c_{0}x+c_{1}x^{2}+c_{2}x^{3}+...$$ (4)

In order for the 2 sides of (4) to be equal,one gets

$$c_{1}=0$$ (5)

$$c_{n}=(n+2)c_{n+2}$$ (6)

It's preferable to choose $$c_{0}=1$$ (why?,because i put a C (arbitrary constant) in front of the series,so $y(0)=Cc_{0}$,i.e.a product of arbitrary constants).

So the series (solution) becomes

$$\left\{\begin{array}{c}y(x)=C \sum_{0}^{+\infty} c_{n}x^{n}\\c_{n}=(n+2)c_{n+2}\\c_{0}=1\\c_{1}=0 \end{array}\right$$ (5)

Daniel.

dextercioby
Homework Helper
(5) is the Taylor expansion around 0 (okay,some of you may know it a MacLaurin expansion) of the solution of the ODE

$$\frac{dy}{dx}=xy$$ (6)

,i.e.it is the Taylor expansion around 0 of the function

$$y(x)=Ce^{\frac{x^{2}}{2}}$$ (7)

Daniel.

P.S.Note the C in (7) is the same with the C in (1-3) and (5).

cepheid
Staff Emeritus
Gold Member
Jeremy:

We seem to be using the same methods in our class as you are. I think a general rule of thumb is this: you cannot combine two power series (by putting the two general terms of each under the same summation sign) unless the degree of the two series is the same, which requires both that x is raised to the same power (in terms of n), and that the starting index is the same in both cases. However, if the first condition is satisfied, but the starting indices are not the same, then it is not a big deal because you can just remove terms from (take them outside) series with lower starting indices until they match that of the series with the highest one, just as StatusX said. However, if the first condition is not satisfied (one series is in terms of x^n, and the other is in terms of, say, x^n+1), then you're going to have much more trouble. So your efforts should focus first on having both series with x raised to the same power (worry about starting indices later). That having been said, here's how we usually dealt with the y' terms:

$$\frac{d}{dx} \left[ \sum_{n=0}^{\infty}{c_nx^n} \right]=\sum_{n=1}^{\infty}{nc_nx^{n-1}} = \sum_{n=0}^{\infty}{(n+1)c_{n+1}x^{n}}$$

Note that last shift.

Then the DE becomes:

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

drat! Now we have an x^n+1 because of that pesky x multiplier:

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

It's all good...except starting indices are not the same. Throw out a term from the left series:

$$c_1 + \sum_{n=1}^{\infty}{(n+1)c_{n+1}x^{n}} - \sum_{n=1}^{\infty}{c_{n-1}x^{n}} = 0$$

$$c_1 + \sum_{n=1}^{\infty}{[(n+1)c_{n+1}x^{n} - c_{n-1}x^{n}]} = 0$$

Which, if I remember right, tells you that c1 = 0 (don't quote me on that), and that the rest of it is zero as well:

$$\sum_{n=1}^{\infty}{[(n+1)c_{n+1} - c_{n-1}]x^{n}} = 0$$

$$(n+1)c_{n+1} - c_{n-1} = 0$$

$$c_{n+1} = \frac{c_{n-1}}{n+1}$$

$$n = 1, 2, 3...$$

This is the same as:

$$c_{m+2} = \frac{c_{m}}{m+2}$$

$$m = 0, 1, 2...$$

I hope that is the correct recurrence relation. Although I can sort of see that this might result in a Taylor series of the function Daniel came up with, I have no idea how he just stated the solution by inspection. Anyways, I thought the point was to actually come up with the power series solution. Can you take it from here?

Last edited:
dextercioby
Homework Helper
Cepheid,if i'm not mistaking,your solution is

$$y(x)^{Cepheid}=c_{1}x+c_{3}x^{3}+...$$

which is not okay,because it is not the Taylor expansion of $e^{x^{2}/2}$,moreover,it doesn't verify identically the ODE,not to mention that y(0)=0,which is incorrect,as it wasn't a Cauchy problem to begin with...

Daniel.

Last edited:
cepheid
Staff Emeritus
Gold Member
One mistake I made that I can see is that when you "throw out" the n=0 term from the first series, the term you throw out is actually c1, not c0. (just plug in n=0 to check). So only the even terms of my series survive, including c0.

I will edit that post to make the correction.

cepheid said:
Jeremy:

We seem to be using the same methods in our class as you are. I think a general rule of thumb is this: you cannot combine two power series (by putting the two general terms of each under the same summation sign) unless the degree of the two series is the same, which requires both that x is raised to the same power (in terms of n), and that the starting index is the same in both cases. However, if the first condition is satisfied, but the starting indices are not the same, then it is not a big deal because you can just remove terms from (take them outside) series with lower starting indices until they match that of the series with the highest one, just as StatusX said. However, if the first condition is not satisfied (one series is in terms of x^n, and the other is in terms of, say, x^n+1), then you're going to have much more trouble. So your efforts should focus first on having both series with x raised to the same power (worry about starting indices later). That having been said, here's how we usually dealt with the y' terms:

$$\frac{d}{dx} \left[ \sum_{n=0}^{\infty}{c_nx^n} \right]=\sum_{n=1}^{\infty}{nc_nx^{n-1}} = \sum_{n=0}^{\infty}{(n+1)c_{n+1}x^{n}}$$

Note that last shift.

Then the DE becomes:

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

drat! Now we have an x^n+1 because of that pesky x multiplier:

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

It's all good...except starting indices are not the same. Throw out a term from the left series:

$$c_0 + \sum_{n=1}^{\infty}{(n+1)c_{n+1}x^{n}} - \sum_{n=1}^{\infty}{c_{n-1}x^{n}} = 0$$

$$c_0 + \sum_{n=1}^{\infty}{[(n+1)c_{n+1}x^{n} - c_{n-1}x^{n}]} = 0$$

Which, if I remember right, tells you that c0 = 0 (don't quote me on that), and that the rest of it is zero as well:

$$\sum_{n=1}^{\infty}{[(n+1)c_{n+1} - c_{n-1}]x^{n}} = 0$$

$$(n+1)c_{n+1} - c_{n-1} = 0$$

$$c_{n+1} = \frac{c_{n-1}}{n+1}$$

$$n = 1, 2, 3...$$

This is the same as:

$$c_{m+2} = \frac{c_{m}}{m+2}$$

$$m = 0, 1, 2...$$

I hope that is the correct recurrence relation. Although I can sort of see that this might result in a Taylor series of the function Daniel came up with, I have no idea how he just stated the solution by inspection. Anyways, I thought the point was to actually come up with the power series solution. Can you take it from here?

Yes, that is what I was looking for. It would be easy to solve since it is seperable but I really wanted to work out the recurrsion relation the way the book suggest to do it and I could not understand how to do this until now.

As far as seeing the solution Daniel came up with all you would have to know is that the power series solution for the exponential function is
$$e^x=\sum_{n=0}^{\infty} \frac{x^n}{n!}$$

Since the solution is
$$y=C_0e^{\frac{x^2}{2}}$$

All you would have to do is push this into the series given above and you're there.

$$C_0 \sum_{n=0}^{\infty} \frac{x^{2n}}{(2n)!}$$

And after solving the recurrance relation you gave me I found
$$c_{2n}= \frac{c_0}{(2n)!}$$
So our solution checks out perfectly.

But seriously thank you for your sol. it was just what I was hoping for.

Jeremy

dextercioby
Homework Helper
Nope.

$$\frac{x^{2n}}{(2n)!}\neq \frac{ x^{2n}}{2^{n}n!}$$

The RHS correctly describes the general term of the Taylor expansion of $e^{x^{2}/2}$ around 0.

Daniel.

dextercioby said:
Nope.

$$\frac{x^{2n}}{(2n)!}\neq \frac{ x^{2n}}{2^{n}n!}$$

The RHS correctly describes the general term of the Taylor expansion of $e^{x^{2}/2}$ around 0.

Daniel.
You're right...

I think I am getting too tired to work on this any more tonight. Thanks for the help. I will look at this in the morning.

Jeremy

cepheid
Staff Emeritus
Gold Member
Jeremy

From the recurrence relation I derived:

$$c_2 = \frac{c_0}{2}$$

$$c_4 = \frac{c_2}{4} = \frac{c_0}{2 \cdot 4}$$

$$c_6 = \frac{c_4}{6} = \frac{c_0}{2 \cdot 4 \cdot 6}$$

$$c_8 = \frac{c_6}{8} = \frac{c_0}{2 \cdot 4 \cdot 6 \cdot 8}$$

As you can see, the denominator is not (2n)!, for that would be 8*7*6*...*2*1 in that last example. Instead we have:

$$c_{2n} = \frac{c_0}{2n \cdot (2n-2) \cdot ... \cdot 2}$$

But that denominator can be expressed as a factorial. Hint: what can you factor out from each of the factors in that product? So how many times does it appear? To answer that, you just need to know: how many factors are in that product?

Hint that will give it away: In the end you will of course end up with the result dexter gave.