# Finding series solution for the differential equation

1. Jul 16, 2015

### RyanTAsher

1. The problem statement, all variables and given/known data

y'' - xy' + xy = 0 around x0=0

Find a solution to the 2nd order differential equation using the series solution method.

2. Relevant equations

Assume some function y(x)= ∑an(x-x0)n exists that is a solution to the above differential equation.

3. The attempt at a solution

How on earth do I shift the index in each equation to make the xn in each series the same power?
I don't see any way to do it.

2. Jul 16, 2015

### RUber

I can't open your image, so I am going to take a stab, and hope that we are using the same forms.
If you have
$y = \sum_{n=0}^\infty a_n x^n$
$y' = \sum_{n=1}^\infty na_n x^{n-1}$
$y'' = \sum_{n=2}^\infty n(n-1) a_n x^{n-2}$
Reindexing gives you:
$xy = a_0x + \sum_{n=2}^\infty a_{n-1} x^n$
$xy' = a_1x + \sum_{n=2}^\infty (n)a_{n} x^{n}$
$y'' = 2a_2 + 6 a_3 x + \sum_{n=2}^\infty (n+2)(n+1) a_{n+2} x^{n}$
(Note, I left an additional term out of the sum to show the pattern.)

3. Jul 16, 2015

### HallsofIvy

Staff Emeritus
Another way to get a series solution to y''- xy'- xy= 0 around 0 is this: The McLaurin's series for y is $$\sum y^{(n)}(0) x^n$$. Since this is a second order linear equation, there will be two undetermined coefficients. Take those to be y(0)= A, y'(0)= B. The given equation is equivalent to y''= xy'+ xy so that y''(0)= 0(B)+ 0(A)= 0.

Differentiating both sides of y''= xy'+ xy, y'''= xy''+ y'+ xy'+ y or y'''= xy''+ (1+ x)y'+ y so y'''(0)= 0(0)+ B+ 0(B)+ A= A+ B.

Differentiating again, y''''= xy'''+ y''+ y'+ (1+ x)y''+ y'= xy'''+ (2+ x)y''+ 2y' so that y''''(0)= 0(A+ B)+ 2(0)+ 2B= 2B.

So far we have y= A+ Bx+ (A+ B)x^3/3!+ 2B x^4/4!

Continue like that.

4. Jul 16, 2015

### RyanTAsher

We have the same differentials of y(x)... but my reindexing is different, and I can't do it.

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

Then, I distribute the x into the series:

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

I don't understand how you set yours up, nor do I understand how to achieve the result... How would I bring the $\sum_{n=0}^\infty a_{n} x^{n+1}$ term now back to just $x^{n}$ if its index is 0. It doesn't make any sense.

5. Jul 16, 2015

### Noctisdark

You can admit the fact that ∑nanxn = a1x + ∑nanxn, I agree with what you did, just shift out the n until all sums begins with n = 2, then it'll be easier to determine an, try it out !!,

6. Jul 16, 2015

### RyanTAsher

The only problem, is that I don't understand how to shift the index of $\sum_{n=0}^\infty a_{n} x^{n+1}$ to make it's n=2 , if I try to shift the n to n=2, it will just make the equation $\sum_{n=2}^\infty a_{n} x^{n+3}$, which doesn't help me either, and I can't see any way of doing it with pulling out terms like you said.

7. Jul 16, 2015

### RUber

By pulling out the terms, you can make sure that all your powers of x start from the same index.
Reindexing is like substitution,
$\sum_{i =0}^\infty x^i=\sum_{j=2}^\infty x^{j-2}$

8. Jul 16, 2015

### Noctisdark

9. Jul 16, 2015

### RyanTAsher

Okay, I think I understand now, kind of. But the one thing that is bothering me, is when I look at your initial response, why don't you pull the 0th term out of the xy and xy'. You pulled out the 1st term, but then for the y'' you pulled out a 0th term initially. (I'm not confused about why you pulled out 2 terms for y'', I'm just confused as to why you started with pulling out the 0th term on y'', as apposed to xy and xy' where you pulled out the 1st term initially)

Also, why didn't you pull 2 terms out of the xy, as well, isn't it two terms behind the y''?

10. Jul 16, 2015

### RyanTAsher

Thank you for the link, I had already checked that out, but I just don't understand it. I feel like I am shifting everything correctly but I am getting a different result.

11. Jul 16, 2015

### RUber

Pull as many out as you need to see the pattern, then you can put them back into a sum notation afterward.

12. Jul 16, 2015

### RUber

On all of them, I started with the zero term, but for xy and xy', they were multiplied by an additional x. In the end, I was focused more on starting the summation with the x^2 term.

13. Jul 16, 2015

### RyanTAsher

Okay, I have gotten what you have gotten now, but only because I took out the 0th and 1st terms in the y'', but took out only the 1st terms in xy' and xy. (Which I still don't understand), but I have gotten what you got:

I did a shift from the y'' sigma from n=2 to n=0:

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

Then I did a substitution for n in each term with k, and then pulled out terms to make them equal:

$2a_{2}+6a_{3}x+\sum_{k=0}^\infty (k+2)(k+1) a_{k+2} x^{k}$ - $a_{1}x+\sum_{k=2}^\infty (k)a_{k} x^{k}$ + $a_{0}x+\sum_{k=2}^\infty a_{k} x^{k}$

I just wish I could see why you didn't pull out a 0th term in xy and xy'. I know why you pulled out the 2 on y''.

14. Jul 16, 2015

### RyanTAsher

Ahhh, I see but then why does your xy' term say $a_{1}$, if it was the 0th term wouldn't the (n) in the series cause the whole thing to be 0?

and wouldn't the xy term be $a_{-1}$, when plugging in the 0th term, because it would because it is $a_{n-1}$

15. Jul 17, 2015

### RUber

Right. The y' drives the a_0 term to zero, and the y'' drives the a_1 term to zero.
$y = \sum_{n=0}^\infty a_n x^n= a_0 + a_1 x + a_2 x^2 + ...$
$y' = \sum_{n=1}^\infty na_n x^{n-1} = a_1 + 2a_2x + 3a_3x^2 + ...$
$y'' = \sum_{n=2}^\infty n(n-1) a_n x^{n-2}= 2a_2 + 6a_3 x + 12a_4 x^2 + ...$
Multiplying by x and gathering into sums:
$xy = a_0x + \sum_{n=2}^\infty a_{n-1} x^n$
$xy' = a_1x + \sum_{n=2}^\infty (n)a_{n} x^{n}$
$y'' = 2a_2 + 6 a_3 x + \sum_{n=2}^\infty (n+2)(n+1) a_{n+2} x^{n}$
So, what form are you expected to put the final answer into?
Something like:
$2a_2 + \sum_{n=1}^\infty \left[ (a + b + c) x^n \right]?$

16. Jul 17, 2015

### RyanTAsher

It just has to be in a general form of say:

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

With 4 terms in each sequence we use for the whole series.

17. Jul 18, 2015

### RyanTAsher

I THINK I UNDERSTAND NOW!

Correct me if I am wrong but here was my step-by-step process:

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

Distribute the x's:

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

Shift without respect to the series index to get all the x's to the same power:

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

Now shift with respect to the same index, in this case n=2, to do this without changing the inside equations, we can pull terms out. Since the y'' series index is equal to 0, the first term we pull out will be the 0th term, then we need to pull out the second term which is then the 1st term due to the index change. Repeat this process with xy' and xy except only once because their index is already starting at 1, so their first term is the 1st term:

$2a_2 + 6a_3x + \sum_{n=2}^\infty (n+2)(n+1)a_{n+2}x^{n} - a_1x + \sum_{n=2}^\infty na_{n}x^{n} + a_0x + \sum_{n=2}^\infty a_{n-1}x^{n} =0$ (4)

So, I have achieved your answer, the only question I have now is...

Why did you pull out terms to make the index n=2 when you could just pull 1 term out of y'' and make all the index n=1? It seems like it would be easier to then solve for terms. Is that what you were talking about when you said you did something to show a pattern?

(edit: Never mind I realize why you did that now, as it gives you an extra term you can plug in for. Thank you for all your help with this problem, I realize I dragged this out way too long, but I just was not understanding. )

18. Jul 18, 2015

### RUber

Looks good. Yes, you could just start from n=1 if you want to. Also, if it makes your notation more compact, you can combine all the sums into the form:
$\sum (c_1+c_2+c_3)x^n$ where the C's are your coefficients from each of the sums.