# Solving DE with Nonpolynomial Coefficient

1. Jul 29, 2009

### The0wn4g3

I need help solving the rest of an example problem in my book, please.

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

Solve y'' + (cos[x])y = 0

2. Relevant equations

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

3. The attempt at a solution

$$y'' + (cos(x))y = \sum_{n=0}^\infty n(n-1)c_n x^{n-2} + (1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + ...)\sum_{n=0}^\infty c_n x^n$$

$$= 2c_{2}+6c_{3}x+12c_{4}x^{2}+20c_{5}x^{3} + ... = (1 - \frac{x^2}{2!} + \frac{x^4}{4!} + ...)(c_{0}+c_{1}x+c_{2}x^{2}+c_{3}x^{3}+...)$$

$$= 2c_{2}+c_{0}+(6c_{3}+c_{1})x + (12c_{4}+c_{2}- \frac{1}{2} c_{0})x^{2} + (20c_{5}+c_{3}- \frac{1}{2} c_{1})x^{3} + ... = 0$$

It follows that

$$2c_{2} + c_{0} = 0$$
$$6c_{3} + c_{1} = 0$$
$$12c_{4} + c_{2} - \frac{1}{2} c_{0} = 0$$
$$20c_{5} _ c_{3} - \frac{1}{2} c_{0} = 0$$

and so on. this gives $c_{2} = -\frac{1}{2}c_{0}, c_{3} = -\frac{1}{6}c_{1}, c_{4} = \frac{1}{12}c_{0}, c_{5} = \frac{1}{30}c_{1}, .....$ By grouping terms we arrive at the general solution $y = c_{0}y_{1}(x) + c_{1}y_{2}(x)$, where

$$y_{1} = 1 - \frac {1}{2}x^{2} + \frac{1}{12}x^{4} - ...$$ and $$y_{2}(x) = x - \frac {1}{6}x^{3} + \frac{1}{30}x^{5}...$$

Ok, I'm not exactly sure how to present this question as I'm not quite sure I know what I don't udnerstand... I believe I understand how they are factoring the like terms ($x, x^{2},x^{3}$ etc.) up to the point where they are $- \frac{1}{2}c_{0}$ how are they multiplying the Maclaurin series $cos(x)$ term by the y series?

Can anyone this to me please?

PS: First time using latex, I'm sorry if I messed anything up...
PS again: In y' and y'' that's is suppose to be $x^{n-1}$ and $x^{n-2}$ respectively. It seems I can't fix it for some reason.

Last edited: Jul 29, 2009
2. Jul 29, 2009

### The0wn4g3

Seems I'm just stupid and didn't realize you just multiple the power series of cos(x) and y together to form a new series...

So, on to my next question. How does the book "arrive at the general solution $y = c_{0}y_{1}(x) + c_{1}y_{2}(x)$ " ? And how does it determine $y_{1}$ and $y_{2}$ from that?

3. Jul 30, 2009

### nickmai123

That's because this equation is a form of Matthieu's Differential Equation. Look up "Matthieu Differential Equation" in Wolfram's MathWorld. I find it interesting your book asked you to solve it.

4. Jul 30, 2009

### HallsofIvy

Staff Emeritus
The set of all solutions to any second order, linear, homogeneous, equation forms a vector space of dimension two. That means, if you can find two independent solutions (that form a basis for the space) you can write any solution as a linear combination of the two solutions. That's all "$y(x)= c_1y_1(x)+ c_2y_2(x)$" means.

As to how you find $y_1$ and $y_2$, that depends heavily on exactly what the coefficients are. Try nickmai123's suggestion

5. Jul 30, 2009

### The0wn4g3

I read over the the Wolfram page on Matthieu Differential Equation and it's all pretty much Greek to me. This is an example problem in my book on how to solve a non-polynomial DE, but if I can't figure out how to work the example I certainly can't work the other problems.

I understand why the solution will be in the form of $y(x)= c_1y_1(x)+ c_2y_2(x)$, but I don't understand how they solved for $$c_{1}[/itex] and [tex]c_{2}[/itex]. From what I can determine, the goal is to come ot a point in which you can describe the coefficients in terms of $c_{1}$ and $c_{2}$. Right? So how do I know how far I need to write out the summation before I start combining terms? And from there, how do I determine $y_{1}$ and $y_{2}$? Such as, where does the 1 come from in $y_{1}$ ? I'm trying my best here, but it seems the book just leaves out a ton of steps and information in this example problem. I just don't get it at all. 6. Jul 30, 2009 ### The0wn4g3 Okay, I think I'm making some headway. if I'm understanding this correctly, the book is calculating $c_{1}, c_{2},c_{3},c_{4},c_{5}$ first with the assumption that $c_{0} = 1 ; c_{1} = 0$ then with the assumption that $c_{0} = 0 ; c_{1} = 1$. The 1 is coming from the fact that the book is assigning the value of 0 to $c_{1}$ and 1 to $c_{0}$ therefore $1*x^{0} = 1$. And in $y_{2}$ the first x can be explained by assigning the value of 0 to $c_{0}$ and 1 to $c_{1}$ therefore $1*x^{1} = 1$. Am i correct in all of this? I sure hope so... 7. Jul 30, 2009 ### nickmai123 Haha this problem involves wayyyy too much series arithmetic. Wait, so the attempted solution is yours or did you get that out of the book? I'm just checking b/c if it's out of the book then we know that what they got for y1 and y2 is what you're supposed to get. EDIT: Nevermind, I read what you said and this is the book's solutions. That's good since now I know where to begin helping you. 8. Jul 30, 2009 ### nickmai123 No, your book doesn't begin by assuming those values. Here's now they get from the series to the solutions in terms of [tex]c_{0}$$ and $$c_{1}$$.

$$2c_{2} + c_{0} = 0$$
$$6c_{3} + c_{1} = 0$$
$$12c_{4} + c_{2} - \frac{1}{2} c_{0} = 0$$
$$20c_{5} + c_{3} - \frac{1}{2} c_{0} = 0$$

Once they get there, they solve for c2 and c3 in terms of c0 and c1. Then they take the those new definitions of what c 2 and c3 are and plug them in to the bottom 2 equations. For example, 12c4 + (-1/2 c0) - 1/2 c0 = 0. You solve for c4.

After you do all of that, you take your new definitions of c2, c3, c4, and c5 and plug them back into your equation. Then factoring out c0 and c1, you get it into the form $$y=c_{0}y_{1} + c_{1}y_{2}$$

I hope that explains it. If not I can type up the math of it all. it's just a lot of work that I don't exactly feel like doing haha.

9. Jul 31, 2009

### The0wn4g3

Oh! Okay! I see what's going on here much better now. You're right, it is a ton of arithmetic. I don't understand why anyone would do this by hand when Mathematica exists, but clearly my instructor wants us to.
Now, will this method work for any non-poly DE in the same form? Such as $y'' + e^{x}y = 0$. It should, right? Just follow the same idea, get those 4 equations, solve for $c_{0}$ and $c_{1}$ then plug back in and solve for $c_{4}$ and $c_{5}$ then plug all of that back in to the original equation, factor out $c_{0}$ and $c_{1}$ and you've got $$y=c_{0}y_{1} + c_{1}y_{2}$$. Correct?

Thanks a ton!

10. Jul 31, 2009

### nickmai123

Yes it will work. Do what they did, and don't work with the summation notations. Expand each of the 3 series, y'', y, and e^x, to the first 5 terms. Then you'll have to FOIL those 5 terms for y and e^x. That's the hairy part. Once you've got that, it's downhill from there.

Well, for the example you provided, Mathematica would give you the solution to Matthieu's Differential Equation, which is not what you were looking for. For the problem you are now working, it gives you the Bessel Functions as solutions.

11. Jul 31, 2009

### The0wn4g3

Excellent, that's just what I wanted to hear!

I don't think I know enough about differential equations or Mathematica to understand Matthieu's Differential Equation or the Bessel Functions (is that he name of the functions that are the solutions?) yet, but I can definitely get Mathematica to do all the arithmetic. From there solving for the constants isn't a big deal.

Thanks!

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook