# ODE + series

1. Oct 28, 2005

### Benny

Hi, can someone help me with the following question? I need to solve the ODE using series.

$$y'' + 4y' + 3y = 0$$

Firstly, using the characteristic equation I know the general solution is of the form $$y\left( x \right) = Ae^{ - x} + Be^{ - 3x}$$. So I know roughly what I should get.

Anyway so if I used series to find the solution to the equation I would try $$y = \sum\limits_{n = 0}^\infty {c_n x^n }$$. Then $$y' = \sum\limits_{n = 0}^\infty {c_{n + 1} \left( {n + 1} \right)x^n } \Rightarrow y'' = \sum\limits_{n = 0}^\infty {c_{n + 2} } \left( {n + 2} \right)\left( {n + 1} \right)x^n$$.

Substituting into the DE: $$\sum\limits_{n = 0}^\infty {c_{n + 2} } \left( {n + 2} \right)\left( {n + 1} \right)x^n + 4\sum\limits_{n = 0}^\infty {c_{n + 1} \left( {n + 1} \right)x^n } + 3\sum\limits_{n = 0}^\infty {c_n x^n } = 0$$.

$$\Rightarrow \sum\limits_{n = 0}^\infty {\left[ {c_{n + 2} \left( {n + 2} \right)\left( {n + 1} \right) + 4c_{n + 1} \left( {n + 1} \right) + 3c_n } \right]} = 0$$...This step is only valid provided that the series for y, y', y'' converge in an interval containing x = 0? Anyway...

$$\Rightarrow c_{n + 2} \left( {n + 2} \right)\left( {n + 1} \right) + 4c_{n + 1} \left( {n + 1} \right) + 3c_n = 0$$

$$c_{n + 2} = \frac{{ - 4c_{n + 1} \left( {n + 1} \right) - 3c_n }}{{\left( {n + 2} \right)\left( {n + 1} \right)}} = - \frac{{4c_{n + 1} }}{{\left( {n + 2} \right)}} - \frac{{3c_n }}{{\left( {n + 2} \right)\left( {n + 1} \right)}}$$

Ok I'm stuck at this point. I'm actually not really sure what to do. I know that I need an expression for coefficient of y in the original series that I substituted. I'm thinking that I need to solve for c_(n+2). I've seen examples where c_(n+2) is split into c_(2n) and c_(2n+1) so that expressions for the odd and even coefficients are found separately. Is this the general method used to solve second order ODEs using series? Any assistance would be good thanks.

2. Oct 28, 2005

### hypermorphism

Use the initial conditions to get c0 and c1.

3. Oct 28, 2005

### Benny

I'm not sure what you mean when you say use the initial conditions. This isn't an IVP. Are you referring to some property of the series I substituted into the equation?

4. Oct 29, 2005

### Benny

Hmm it seems that there are no more complicated equations(ones where the derivatives have non constant coefficients) which can be solved fairly easily by making a slight index shift. So after the index shift, in addition to having a summation, there are also expressions like c_0, c_1x, c_2x^2 in the equation. In those cases I can just say c_0 = c_1 = c_2 = 0 and work from that. However, it doesn't seem possible to do that with this equation. Can someone please help me out?

5. Oct 29, 2005

### HallsofIvy

Staff Emeritus
Separting into even and odd powers won't help you here- the two functions that you KNOW you want, ex and e3x, both have even and odd powers. Looking at the e3x, you might want to focus on the terms that involve that "3cn".

At first I found Hypermorphism's suggestion that you "Use the initial conditions to get c0 and c1" completely opaque- you aren't given any initial conditions- but then I finally realized what he is saying.
The function f(x)= ex has f(0)= 1, f'(0)= 1. Since, in this power series, c0= f(0) and c1= f'(0), set c0= c1= 1 and see if that doesn't simplify things.
g(x)= e3x has f(0)= 1, f'(0)= 3. Set c0= 1, c1= 3 and see what happens.

6. Oct 29, 2005

### Benny

Ok but to do that don't I need to 'use the answer.' Even for this equation when I know what my answer should look like, I'm just not sure if it is valid for me to use the answer(ie. linear combination of exp(-x) and exp(-3x)). But how would I solve an equation like y'' - 2xy' + y = 0 with series? For such an equation I don't know what I should be getting so I wouldn't be able to use initial conditions.

7. Oct 30, 2005

### saltydog

Benny, sometimes not so easy to reduce the relation into a nice summation expression. The objective is to reduce it to an expression that's managable.

Using a power series representation for the solution in the form:

$$y(x)=\sum_{n=0}^{\infty} a_n x^n$$

I reduced the solution to the following recursive relationship:

$$a_0=\text{arbitrary}$$

$$a_1=\text{arbitrary}$$

$$a_n=\frac{-4a_{n-1}}{n}-\frac{3a_{n-2}}{n(n-1)}\quad\text{for}\quad n\ge 2$$

Now, that's very managable right? Just calculate them recursively and it works fine. I did so for the first 100 in Mathematica. However, we know that the solution is also of the form:

$$y(x)=Ae^{-x}+Be^{-3x}$$

and therefore should be able to equate them. So lets look at the first 4 terms of the recursive relationship:

$$y(x)=a_0+\frac{-3a_0}{2\cdot 1}x^2+a_1x+\frac{-4a_1}{2\cdot 1}x^2+\frac{-3a_1}{3\cdot 2}x^3+\frac{(-1)^2 4^2 a_1}{3\cdot 2}x^3+\frac{(-1)^2 4\cdot 3 a_0}{3\cdot 2\cdot 1}x^3$$

Now, if I let:

$$a_0=A+B$$

$$a_1=-(3A+B)$$

this expression becomes:

$$(A+B)-(3A+B)x+(3^2A+B)\frac{x^2}{2}-(3^3A+B)\frac{x^3}{6}$$

or:

$$(A-3Ax+3^2Ax^2/2-3^3Ax^3/6)+(B-Bx+Bx^2/2-Bx^3/6)$$

or:

$$A\left(1-3x+\frac{(3x)^2}{2}-\frac{(3x)^3}{6}\right)+B(1-x+x^2/2-x^3/6)$$

which is the first 4 terms of the power series:

$$A\sum_{n=0}^{\infty}\frac{(-1)^n(3x)^n}{n!}+B\sum_{n=0}^{\infty}\frac{(-1)^n(x)^n}{n!}$$

or:

$$Ae^{-3x}+Be^{-x}$$

Last edited: Oct 30, 2005
8. Oct 30, 2005

### Benny

Thanks for your help Saltydog. I see that you've made an idex shift and it does make the recurvise relation look more simple. My main problem is recognising the pattern for the coefficients. With a_0 and a_1 arbitrary, after even just 1 more iteration (n=4) I would get a very complicated expression for a_4 in terms of a_0 and a_1 wouldn't I? I just don't understand why 'simple' equations such as y'' + 4y' + 3y = 0 seem to be so much more difficult to solve with series than something like y'' - 2xy' + y = 0.

9. Oct 30, 2005

### saltydog

They get complex only if you calculate them in terms of a0 and a1 but are rather easy to calculate if you calculate them sequentially which is what I did in Mathematica (used 0 and 1 for starters):

Code (Text):
coef = Table[0, {100}];
coef[[1]] = 0;
coef[[2]] = 1;
For[n = 3, n <= 100, n++,
coef[[n]] = -(4 coef[[n - 1]])/(n -
1) + (3 coef[[n - 2]])/((n - 1)(n - 2))
];
You into non-linear dynamics right Benny? I suspect it's all a matter of critical points and bifurcations: It just "looks" simple to us but rather is a reflection of a bifurcation (adding the 'x') which qualitatively changes the solution dynamics which we observe as a change from difficult to simple.

10. Oct 30, 2005

### Benny

I'm not sure what you mean. Ultimately, if I was to solve the DE using series wouldn't I be looking for the nth coefficient in terms of some arbitrary starting points (eg. c_0 and c_1)? If so then I can't think of a way to do so without calculating everything in terms of those arbitrary constants. Even if I had ICs, this problem still seems like it would be horrible to work with.

I've only had a few introductory classes on the things that you mentioned. So I don't really see the effect of adding the x in terms of the ideas you referred to. What I can see from having tried solving a few DEs with power series is that it makes it easier to eliminate either c_0 or c_1 so that I'm left with a relation between c_(n+2) and c_(n+1) or c_n.

11. Oct 31, 2005

### saltydog

I disagree Benny. Here it is in Mathematica in clear terms:

Code (Text):

coef=Table[0,{100}];
coef[[1]]=y(0);
coef[[2]]=y'(0);
For[n=3,n<=100,n++,

$$coef[[n]]=-\frac{4 coef[[n-1]]}{(n-1)}-\frac{3 coef[[n-2]]}{(n-1)(n-2)}$$
];

$$y[x]:=\sum_1^{100} coef[[n]]x^{n-1}$$

Granted, Mathematica starts with index=1 so I have to make it a little messy. Note that the "arbitrary" constants are just the initial conditions right?

Well, I'm just implying solutions are not always "neat".