# Solving Second Order Differential Equations

1. Nov 5, 2009

### ryan8888

Hi everyone,

I am studying to write my final Mechanical Engineering Prep Exam and have come across some problems that I am having a hard time figuring out.

I have managed to figure out how to use the Euler-Cauchy Equations to solve problems of the form: x2y" + axy' + by = 0 where a and b are constants and you substitute in y = xm.

But I came across these examples and am wondering if the same method would work to solve them:

1. 2x2y" - 5xy' - 4y = 3x4

2. y" + 2y' - 3y = 9x2 + e-3x

3. x" + 4x = 3cos2t + 4cos3t

any help would be greatly appreciated!

2. Nov 5, 2009

### LCKurtz

The first equation is a non-homogeneous Euler Cauchy equation and the others are constant coefficient equations. You solve the Euler-Cauchy homogeneous equation as you have described. Similarly for the constant coefficient equations you assume a solution of the form y = erx to get the characteristic equation which leads to the homogeneous solution.

Then for a particular solution to add to the general solution of the homogeneous equation you can use variation of parameters or, in the constant coefficient case, the method of undetermined coefficients.

There is lots of information about these types of equations on the internet. For example, Google phrases like:

undetermined coefficients
variation of parameters
constant coefficient differential equations
Euler differential equation.

3. Nov 6, 2009

### HallsofIvy

It can also be helpful to observe that the substitution t= ln(x) or x= et will transform an Euler-Cauchy equation (in x) to an equation (in t) with constant coefficients with the same characteristic equation.

4. Nov 6, 2009

### ryan8888

Thanks for the help guys,

I am really stuck on the first question. I am not sure just what to do with the left hand side of the equation.

Am I following the right train of thought here:

1. Find the roots of the equation:

2x2y" - 5xy' - 4y = 0

let y = xm

Therefor:

y' = mxm-2
y" = m(m-1)xm-1

and substituting and simplifying gives:

a2m2 + (a1-a2)m + a0 = 0

substituting the values from my problem gives:

2m2 + (-5 - 2)m - 4 =0
2m2- 3m -4 = 0

This is where I get stuck. It looks like it is going to be a complex root problem, do I use the Quadratic equation to solve for the two roots?

Once I have the roots (if they are complex) I would sub them into the following:

y1 = xm1cos(m2ln x) and y2 = xm1sin(m1lnx)

which inturn is substituted into y0 = c1y1 + c2y2 to give me the general solution

5. Nov 6, 2009

### LCKurtz

You have:
2m2 + (-5 - 2)m - 4 =0
and the next step should be:
2m2- 7m -4 = 0 which factors (2m + 1)(m - 4) = 0 so you don't need the complex root case.

6. Nov 6, 2009

### ryan8888

Wow, I can't believe I made such a careless mistake in the math there. I think I have been looking at this problem for way too long!

But that clears things up considerably.

So once I factored the equation to"

2m2- 7m -4 = 0
(2m + 1)(m - 4) = 0

I can solve for my roots.

m1 = 4 and m2 = -1/2

Which I substitute into:

y1 = x4 and y2 = x-1/2

yc = c1y1 + c2y2

which equals:

yc = c1x4 + c2x-1/2

I thought that this was my final answer but I typed the equation into wolframalpha to check it and it came up with this:

y(x) = c1x4 + c2/x1/2 + 1/3x4log(x)

I have no idea where the 1/3x4log(x) fits into the equation. I feel like I missed something but I have regone through the section on the Euler-Couchy method and don't see how that part is worked in there.

7. Nov 6, 2009

### LCKurtz

What you have now is the general solution to the homogeneous equation. You need to add a particular solution to the non-homogeneous equation. I don't have time right now to help you with that. You can use variation of parameters or a method similar to undetermined coefficients for Euler equations. If someone else doesn't jump in I will look at it later this evening.

[Edit - added later in the day]

Since x4 is a solution to your homogeneous equation, you can't expect Ax4 to be a solution to the NH equation. Similarly to what you do in this situation for undetermined coefficients for constant coefficient equations, you look for a particular solution of the form:

$$y_p = Ax^4\ln(x)$$

Try plugging that in to determine A and you should get agreement with the answer.

Last edited: Nov 6, 2009
8. Nov 7, 2009

### ryan8888

Thanks for your help, but I have a couple more questions for you.

1. How did you come up with the general form of the yp? I can seem to find that formula in any of the textbooks or references on line.

2. I just want to make sure that I have the next step right. Once I determine what I am going to use for yp which from what I have read in my text book is of the form Knxn + Kn-1xn-1.......

So I would need the derivatives:

yp = Ax4ln(x)
y' = x3 + 4ln(x)x3
y" = 3x2 + ln(x)12x2 + 4x2

So substituting back into the original ODE:

2x2(3x2 + ln(x)12x4+4x2) - 5x(x3 + ln(x)4x3) - 4(x4ln(x)) = 3x4

before I attempt to simplify that expression I just want to make sure I am on the right track

Thanks for all of the help!

9. Nov 7, 2009

### LCKurtz

1. What happened to the A in your derivatives?
2. Why not collect like terms in y''?
3. Be more careful with your algebra when substituting back into the equation. You should see the ln(x) terms drop out.

One way to figure out the form for yp is to look at the similarity to constant coefficient equations. As HallsofIvy pointed out the substitution x = et, t = ln(x) converts this equation to a constant coefficient equation. A root of r = 4 to the constant coefficient equation in t would correspond to a yc = e4t and the x4 term on the right would correspond to e4t. In that case for the t equation you would try Ate4t for a particular solution. Since t = ln(x) that suggests x4ln(x).

In fact, one way to solve these equations is to make the x = et substitution, solve the corresponding constant coefficient equation using the usual methods, and substitute back.

10. Nov 8, 2009

### ryan8888

Okay. Thanks for your continued help with this.

I think I am getting closer.

So I have yp = Ax4ln(x)

y'p = A(x3 + 4x2ln(x))
y"p = A(7x2 + 12x2ln(x))

So I substitute into the general equation and simplify:

A(24x4ln(x) + 14x4) - A(-15x4 - 20x4ln(x)) - A4x4ln(x) = 3x4

I get lost here again, I have tried a few different things and still cannot seem to come up with the correct answer. I come up with 7Aln(x) - 3x4

I must have made a mistake in my math but I can't find it. I take to log of each side to eliminate the ln(x) on the left and I am left with 7A = 3x4log(x)

which would mean A = 3/7x4log(x) which is close to the correct answer but just not quite there.

11. Nov 8, 2009

### LCKurtz

Like I said in suggestion 3, be more careful with your minus signs when you substitute your derivatives back into the equation. Your derivatives are correct.

12. Nov 9, 2009

### ryan8888

Okay I think I figured it out. I made a mistake in the multiplication in the second derivative. For some reasion I was assuming there was a constant of 5 infront of the x3.

So once I caught the mistake I was left with the following:

A[14x4 + 24x4ln(x) - 5x4-20x4ln(x) - 4x4ln(x) = 3x4

Next, to get rid of the ln(x)'s I took the log of each side:

A[14x4 + 24x4 - 5x4 - 20x4 - 4x4] = 3x4log(x)

A(9x4) = 3x4log(x)

which equals'

1/3x4log(x)

Substituting back into the form y(x) = yh + yp

y(x) = c1x4 = c2x-1/2 + 1/3x4log(x)

I just wanted to make sure that my methods were correct and that I did get the right answer.

Thanks for the help!

13. Nov 9, 2009

### LCKurtz

Here's part of what you said:
-------
So once I caught the mistake I was left with the following:

A[14x4 + 24x4ln(x) - 5x4-20x4ln(x) - 4x4ln(x) = 3x4
-------

OK, that's good. You found that mistake. But then you said:

-------
Next, to get rid of the ln(x)'s I took the log of each side:
A[14x4 + 24x4 - 5x4 - 20x4 - 4x4] = 3x4log(x)
-------

And that only leaves me shaking my head. Here you are studying differential equations so presumably you have gotten through calculus and yet you are still having major problems with algebra. In your first equation above, which you finally have correct, the ln(x) terms cancel out. How don't you see that?

Then your next step where you "take the log of both sides" to get rid of the ln(x) is so bad it's "not even wrong".

14. Nov 9, 2009

### ryan8888

You know, I think the problem is that I am too concerned with attempting to get the answer into the correct format and I overlooked the simple mathemitics involved.

I had noticed that the ln(x) terms summed to 0 but assumed that I had to take the log of each side inorder to have it in the answer.

I realize now that what I am actually doing is solving for the A in the particular solution yp = Ax4ln(x)

So I attempted the derivative equation again and managed to solve for A

After the ln(x)'s cancel out I am left with

A(9x4) = 3x4

Which solved for A = 1/3

Substituting A = 1/3 back into yp

yp = 1/3x4ln(x)

I am pretty sure that I am still missing something algebrically (it has been a while, and I am realizing that a refresher course in Alegebra might be a good idea).

Have I done this correct? How do I eliminate the ln(x) in the right side of the equation?

15. Nov 9, 2009

### LCKurtz

You were looking for a particular solution of the NH differential equation of the form Ax4ln(x). You have substituted this into the equation and discovered that it requires A = 1/3. In other words, if A = 1/3 you have found a particular solution:

yp = (1/3)x4ln(x)

that works in the DE. Why are you now asking how to eliminate the ln(x) on the right side of "the" equation, whichever equation that is?

16. Nov 9, 2009

### ryan8888

The only reason that I am asking is that the answer in my book is the same that I came up with:

y(x) = c1x4 + c21/2 + 1/3x4ln(x)

Back of the book:

y(x) = c1x4 + c21/2 + 1/3x4log(x)

I am just wondering if maybe they used a different method of solving the particular solution to get that answer. That has been what is screwing me up to this point.

17. Nov 9, 2009

### LCKurtz

I think you had x-1/2 in your complementary solution. And you should have parentheses around the (1/3)'s. Is what is bothering you the use of ln vs log? Perhaps your text has the convention that if the base isn't specified as in log10(x) then log is to be interpreted as natural base e. That is pretty common.

18. Nov 9, 2009

### ryan8888

I think that is just what it is. I was looking through some of the other answers and came up with the same situation.

I have one more question for you.

I was reading up on the differences between the method of undetermined coefficients and the variation of parameters. It seems to me the the method of undetermined coefficients is significantly easier would be the preferred method to solve these types of equations. Is there a reason that the undetermined coefficients equation would not work for a Euler-Cauchy equation?

Also I am working on another problem and have determined the general solution to the equation using the general form of y = ex, but am a little stuck at finding the solution of yp, the function on the right hand side is 6x3 - 3x2 + 12x

Do I do something similar to the form of yp = Axnln(x)

So my guess would be: yp = A(6x3 - 3x2 +12x)ln(x)

19. Nov 9, 2009

### LCKurtz

Since Euler-Cauchy equations can always be transformed to constant coefficient equations, I will address your question assuming the latter.

You are correct that undetermined coefficients is frequently, in fact usually, easier than variation of parameters. Its weakness is that it doesn't always work while variation of parameters does, at least in principle.

The idea is that if the non-homogeneous term "gives itself back" or goes away upon differentiation, then when you plug terms like it in the DE there is a chance of determining the coefficients. So if there is a sin(x) on the right side and knowing that derivatives of sines and cosines are sines and cosines,then Asin(x) + Bcos(x) might work. Similarly if there is an ex on the right side and you know derivatives of ex are ex, one would expect Aex to work. Of course, if ex is a solution of the homogeneous equation then Aex can't solve the NH equation, and the theory shows that Axex makes a good trial solution. And there are complications for repeated roots.

It is easier to understand all the complications arising with undetermined coefficients by looking at the method of annihilators. One place you might look is:

http://en.wikipedia.org/wiki/Annihilator_method

And everything that works for constant coefficient DE's has an analogue in the Euler-Cauchy equations through the transformation t = ln(x).

20. Nov 10, 2009

### ryan8888

Thanks for pointing me in the direction of the Annihilator Method, It really simplifies things and makes things much more clear.

I do have one issue, I have no problem solving for equations with say 3e2x or -sinx on the right side I am getting stuck with the basic polynomial annihilator.

I am working on this problem:

y" + y' - 6y = 6x3 - 3x2 + 12x

So I determined that my annihilator is Dm+1 or D4

And the multiplying each side by the Annihilator:

D4(D+3)(D-2) = 0

This is where I am having the issue,

I know that the general form of the solution is y=ex

So the homogenous solution is yh = c1e2x + c2e-3x

I am just wondering how to deal with the D4?

Do I simply treat it in this manner:

yp = Ae4x

Where I would take the derivatives and sub back into the equation, solve for A and multiply the right side by A to determine my answer

I am sure I am missing something very rudimentary but just can't seem to find it.

21. Nov 10, 2009

### LCKurtz

After looking a little more I found a much better reference for annihilators:

http://faculty.swosu.edu/michael.dougherty/diffeq/lecture10.pdf

You are OK up to where you have (missing y):
D4(D+3)(D-2)y = 0

Since D4 annihilates 3rd degree polynomials, the general solution would have the form:

y = Ax3 + Bx2 + Cx + D + c1e2x + c2e-3x

Since c1e2x + c2e-3x solves the homogeneous equation, the rest of it is what you want to try for the NH equation:

yp = Ax3 + Bx2 + Cx + D

Take a look at the pdf reference I just gave you. It's much clearer.

Last edited: Nov 11, 2009
22. Nov 11, 2009

### ryan8888

Thanks for that reference, it does make the method a little more clear. I am still havign some problems though with this particular for of the solution.

Once I have determined the general form of yh = Ax3 + Bx2 + Cx + D

I would think that the next step is to find its derivatives and substitute tham back into the original ODE to solve for the coefficients. But in this case we are going to end up with 4 unknowns to solve for (A, B, C and D)

Now the resource that you provided me says in step 3

3. Plug yp with its (still undetermined) coefficients into the original ODE, i.e.,
(a) Set L[yp] = f(x), and compute and expand L[yp] on the LHS.
(b) Compare coefficients of the various functions on the LHS with those on the RHS to
determine the values of those coefficients, to find the exact form of yp.

So would I simply plug the form yh = Ax3 + Bx2 + Cx + D back into my original ODE and not worry about finding the derivative?

So I would have:

(Ax3 + Bx2 + Cx + D) + (Ax3 + Bx2 + Cx + D) - 6Ax3 + 6Bx2 + 6Cx + 6D = 6x3 - 3x2 + 12x

It is part (b) of the above statement that I don't understand. How to compare the coefficients on the left to those on the right to determine the value of the coefficients.

23. Nov 11, 2009

### LCKurtz

Note I have corrected a typo here and earlier; this is yp we are discussing, not yh which is the solution to the homogeneous equation.

"So would I simply plug the form yp = Ax3 + Bx2 + Cx + D back into my original ODE and not worry about finding the derivative?"

No. Of course not. You plug yp and its derivatives in the original NH equation and look for values of the constants that make it work. That's the whole point. You determine the "undetermined coefficients" that work to give you yp.

Set the coefficients of like powers of x equal to get equations. Or maybe plug in some nice values of x. Or a combination of both. Whatever works.

24. Nov 11, 2009

### ryan8888

Okay, I was fairly certain that I had to use the derivatives of the yp solution since I have worked other examples and that is the technique that I used.

So I have:

yp = Ax3 + Bx2 + Cx + D
y'p = 3Ax2 + 2Bx + C
y"p = 6Ax + 2B

Plugging them back into the Original ODE:

(6Ax + 2B) + (3Ax2 + 2Bx + C) - 6Ax3 + Bx2 + 6Cx + 6D = 6x3 - 3x2 + 12x

Once I hit this point I have to look at the coefficients of like powers of x, so taking x3 to start:

The only power of x3 in the left hand side is -6Ax3 do I now equate this to -6Ax3 = 6x3 and solve for A?