# Differential equation with power series

## Homework Statement

Solve y''+(cosx)y=0 with power series (centered at 0)

y(x) = Σ anxn

## 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?

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

you need to shift indices for your $y''$, you can't start with $a_2$
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

No, it does not make sense. You started with ##y(x) = a_0 + a_1 x + a_2 x^2 + \cdots##, so that is what you should end up with.
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?

You wrote y(x) = a0(1-x2/2+x4/12-x6/80+...)+a1(x-x3/6+x5/30+...), and that is wrong.
Could you please elaborate on why you say it's wrong?

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?

Dr Transport
Gold Member
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.

Are you honestly telling me that you cannot see the difference between
$$y(x) = \sum a_n x^n = a_0 + a_1 x + a_2 x^2 + \cdots$$
and
$$y(x) = a_0(1-x^2/2+x^4/12-x^6/80+\cdots)+a_1(x-x^3/6+x^5/30+\cdots)+ \cdots \; ?$$
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?

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.
Ok, that actually makes sense now, thank you.

I apologize for sounding frustrated, but the other person's answer wasn't very helpful as he simply replied "it's wrong, it should look like this (...)" without any further input. I didn't understand his answer so I asked for him to elaborate only to be received with the exact same response yet again. It seemed to me like the other person was being arrogant as he insisted that his response was helpful when I clearly did not understand what he meant.

I don't see the problem with asking someone to elaborate on their suggestions when I don't understand what they are trying to say?