# Differential equation with power series

Tags:
1. Apr 22, 2016

1. The problem statement, all variables and given/known data
Solve y''+(cosx)y=0 with power series (centered at 0)

2. Relevant equations
y(x) = Σ anxn

3. The attempt at a solution
I would just like for someone to check my work:

I first computed (cosx)y like this:

(cosx)y = (1-x2/2!+x4/4!+ ...)*(a0+a1x+a2x2 +...)
=a0+a1x+(a2-a0/2)x2+(a3-a1/2)x3+...

Then I computed y'' as follows:

y'' = 2a2+6a3x+12a4x2+...

I assembled everything (y''+ycosx = 0):

(a0+2a2)+(6a3+a1)x+(12a4+a2-a0/2)x2+... = 0

Finally I computed the constants:

a0+2a2=0 => a2=-a0/2
6a3+a1=0 => a3=-a1/6
12a4+a2-a0/2)x2=0 => a4=a0/12
...
and so on for a couple of more terms.

y(x) = a0(1-x2/2+x4/12-x6/80+...)+a1(x-x3/6+x5/30+...)

Does this make sense? Is there a 'less-messy' way of doing this?

2. Apr 22, 2016

### Dr Transport

you need to shift indices for your $y''$, you can't start with $a_2$

3. Apr 22, 2016

Why? a2 in y'' is the same constant as in y, it wouldn't make sense to rename it a0 and start from there, would it? the first two terms in y'' are

(0)a0 + (0)a1

that's why i started at a2

4. Apr 22, 2016

Yes, y(x) is the general solution of the differential equation represented as a power series. After finding the constants a2,a3,a4, etc I replaced them in y(x) and factored out the undetermined coefficients a0 and a1. Can you elaborate on what I did wrong?

5. Apr 22, 2016

Could you please elaborate on why you say it's wrong?

6. Apr 22, 2016

Yeah, and I did not understand your answer. I'm asking for help and you just came on here to tell me I was wrong. Fine, I get it. I want to know what you mean by "it should look like this", if you don't want to help me then why did you even bother commenting on my thread?

7. Apr 22, 2016

### Dr Transport

When you find the series solution to a differential equation, your summations need to be the same, $y = \sum_{n=0}^\infty x^n a_n$, when you differentiate, you get $y'' = \sum_{n=2}^\infty x^{n-2} a_n(n)(n-1)$. The summations are not over the same limits, that is why the answer you provided is incorrect. Shift the index from $n \rightarrow n+2$ so you end up with $y'' = \sum_{n=0}^\infty x^n a_{n+2}(n+2)(n+1)$, then substitute into the original differential equation and then compare powers of $x]$ to get a recursion relation for the general form.

Frustrated responses to the commenters won't get you very far on this forum.... I indicated how to start in my original response, you didn't do as either of the respondents advised..... we are not in the business of doing your homework for you.

8. Apr 22, 2016

The latter is my solution... the point is to find the coefficients in terms of a0 and a1, right? That's exactly what I did, isn't it? When you solve homogeneous 2nd order differential equations, you assume a solution looks like

y(x) = ert

Right? Then you plug it into the DE and solve for "r". That's exactly what I did, but solving using power series, no?

9. Apr 22, 2016