Ordinary Differential Equation Problem

Mark Brewer
Messages
38
Reaction score
4

Homework Statement



dy/dx = 4e-xcosx

The Attempt at a Solution


[/B]
I've divided dx to both sides, and now have dy = 4e-xcosx dx
I've then started to use intergration by parts to the right side with u = 4e-x and dv = cosx dx
Leaving y = 4e-xsinx - ∫ -4e-xsinx dx
Once again I used intergration by parts with u = -4e-x and dv = sinx dx
Leaving y = 4e-xsinx - (4e-xcosx - ∫ -4e-xcosx dx)
I know that I don't need to integrate again, so my final answer is 4e-x(sinx - cosx) + c

The correct answer is 2e-x(sinx - cosx) + c

Where am I missing division by 2?

Cheers,

Mark
 
Physics news on Phys.org
Look at the equation you got: ##y = 4e^{-x}\sin x - \big(4e^{-x}\cos x - \int( -4e^{-x}\cos x dx)\big)##. That looks correct to me.

That is not the same as ##y = 4e^{-x}\sin x - (4e^{-x}\cos x)##, which is your final answer (ignoring the constant). You've dropped the last term without justification.

But hang on, doesn't that last term remind you of something? Can you get rid of it by replacing it by that thing and moving it somewhere else in the equation?
 
Last edited:
I think you have made a mistake in some of your +ve/-ve signs and think that your approach would eventually give y = y.

The best way to go about this is to write cosx =(exp(ix) + exp(-ix))/2 (Euler's formula) and then you have to solve a differential equation of the form

dy/dx = exp(mx) where m = (1+/- i).

This is relatively straight forward to solve.
 
This not so much a "differential equations" problem (though it is disguised as one), it is just an "integration by parts exercise".

Yes, you can integrate 4\int e^{-x}cos(x)dx by parts. Let u= e^{-x}, so that du= -e^{-x}dx and let dv= cos(x)dx so that v= sin(x). Then 4\int e^{-x}cos(x)dx= 4\left(e^{-x}sin(x)- \int e^{-x}sin(x)dx\right). Do that resulting integral by parts. Let u= e^{-x} so that du= -e^{-x}du and let dv= sin(x) so that dv= -cos(x)dx.

Now, we have 4\int e^{-x}cos(x)dx= 4e^{-x}sin(x)- 4e^{-x}cos(x)- 4\int e^{-x}cos(x)dx.

Now,as andrewkirk suggested (or hinted, rather), we have 4\int e^{-x}cos(x)dx on both sides of the equation. Solve your equation for that and you are done.
 
Last edited by a moderator:
Summarizing a generous contribution by HallsofIvy ...

An explanation hinges on how you managed to go from this line:
Leaving y = 4e-xsinx - (4e-xcosx - ∫ -4e-xcosx dx)
to this line:
so my final answer is 4e-x(sinx - cosx) + c
Can you explain your intermediate step here?
 
Mark Brewer said:

Homework Statement



dy/dx = 4e-xcosx

The Attempt at a Solution


[/B]
I've divided dx to both sides, and now have dy = 4e-xcosx dx
I've then started to use intergration by parts to the right side with u = 4e-x and dv = cosx dx
Leaving y = 4e-xsinx - ∫ -4e-xsinx dx
Once again I used intergration by parts with u = -4e-x and dv = sinx dx
Leaving y = 4e-xsinx - (4e-xcosx - ∫ -4e-xcosx dx)
I know that I don't need to integrate again, so my final answer is 4e-x(sinx - cosx) + c

The correct answer is 2e-x(sinx - cosx) + c

Where am I missing division by 2?

Cheers,

Mark

In cases like this one it is almost always easier to do the problem by first eliminating the pesky multiplicative constant. So, first do the integral ##\int e^{-x} \cos(x) \, dx##, then multiply by 4 at the very end. Basically, if ##f(x) = 4 g(x)##, then ##\int f(x) \, dx = 4 G(x)##, where ##G(x) = \int g(x) \, dx##. That also helps you to keep straight where the various factors come and go, so that you know when a '2' appears in the final answer, it is '4/2' rather than ##\sqrt{4}##, for example.
 
  • Like
Likes Mark Brewer
NascentOxygen said:
Summarizing a generous contribution by HallsofIvy ...

An explanation hinges on how you managed to go from this line:
to this line:
Can you explain your intermediate step here?

I noticed the problem was going to continue as long as I would like to integrate by parts. If I recall from calc doing to steps of integration by parts was sufficient to ignore the remaining integral. I understand I'm an undergraduate so my mistakes are likely to exist. I do take criticism well, so please feel free to tell me I'm wrong, and I the practice I learned is incorrect.
 
andrewkirk said:
Look at the equation you got: ##y = 4e^{-x}\sin x - \big(4e^{-x}\cos x - \int( -4e^{-x}\cos x dx)\big)##. That looks correct to me.

That is not the same as ##y = 4e^{-x}\sin x - (4e^{-x}\cos x)##, which is your final answer (ignoring the constant). You've dropped the last term without justification.

But hang on, doesn't that last term remind you of something? Can you get rid of it by replacing it by that thing and moving it somewhere else in the equation?
Hi Andrew, I'm some what following your explanation, but I need a little more details. I recognize that the last term 4e-xcosx reminds me of dy/dx. A little help is appreciated.
 
Mark Brewer said:
I recognize that the last term 4e-xcosx reminds me of dy/dx
Right, in fact they are equal, and that means that ##y=\int 4e^{-x}\cos x dx##. So, substituting ##-y## for that last term gives you an equation with ##y## on both sides, and no more integrals to be done. How will you turn that into an equation of the form ##y=##<something not involving ##y##>?
 
  • #10
andrewkirk said:
Right, in fact they are equal, and that means that ##y=\int 4e^{-x}\cos x dx##. So, substituting ##-y## for that last term gives you an equation with ##y## on both sides, and no more integrals to be done. How will you turn that into an equation of the form ##y=##<something not involving ##y##>?

Thank you Andrew. Substituting -y then gave me the chance to add y to both sides and then divide by 2. Thank you once again.

Mark
 
  • #11
Mark Brewer said:
If I recall from calc doing to steps of integration by parts was sufficient to ignore the remaining integral.
Such a "rule" doesn't ring a bell with me. But I think you now see how the problem at hand can be concluded, without reliance on anything but algebra.
 
Back
Top