1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Ordinary Differential Equation Problem

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

    dy/dx = 4e-xcosx

    3. The attempt at a solution

    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?


  2. jcsd
  3. Sep 1, 2015 #2


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    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: Sep 1, 2015
  4. Sep 1, 2015 #3
    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.
  5. Sep 1, 2015 #4


    User Avatar
    Staff Emeritus
    Science Advisor

    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 [itex]4\int e^{-x}cos(x)dx[/itex] by parts. Let [itex]u= e^{-x}[/itex], so that [itex]du= -e^{-x}dx[/itex] and let [itex]dv= cos(x)dx[/itex] so that [itex]v= sin(x)[/itex]. Then [itex]4\int e^{-x}cos(x)dx= 4\left(e^{-x}sin(x)- \int e^{-x}sin(x)dx\right)[/itex]. Do that resulting integral by parts. Let [itex]u= e^{-x}[/itex] so that [itex]du= -e^{-x}du[/itex] and let [itex]dv= sin(x)[/itex] so that [itex]dv= -cos(x)dx[/itex].

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

    Now,as andrewkirk suggested (or hinted, rather), we have [itex]4\int e^{-x}cos(x)dx[/itex] on both sides of the equation. Solve your equation for that and you are done.
    Last edited by a moderator: Sep 1, 2015
  6. Sep 1, 2015 #5


    User Avatar

    Staff: Mentor

    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?
  7. Sep 1, 2015 #6

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    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.
  8. Sep 1, 2015 #7
    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.
  9. Sep 1, 2015 #8

    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.
  10. Sep 1, 2015 #9


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    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##>?
  11. Sep 1, 2015 #10
    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.

  12. Sep 2, 2015 #11


    User Avatar

    Staff: Mentor

    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.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted

Similar Discussions: Ordinary Differential Equation Problem