Ordinary Differential Equation Problem

In summary: I'm not quite sure how I'm supposed to get rid of it.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 formdy/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".
  • #1
Mark Brewer
38
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
  • #2
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:
  • #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.
 
  • #4
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:
  • #5
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?
 
  • #6
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
  • #7
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.
 
  • #8
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.
 
  • #9
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.
 

Related to Ordinary Differential Equation Problem

1. What is an Ordinary Differential Equation (ODE)?

An Ordinary Differential Equation is a mathematical equation that describes how a quantity changes over time. It involves derivatives of an unknown function with respect to one or more independent variables.

2. What is the difference between an ODE and a Partial Differential Equation (PDE)?

The main difference between an ODE and a PDE is that an ODE involves derivatives with respect to a single independent variable, whereas a PDE involves derivatives with respect to multiple independent variables.

3. How are ODEs used in real-world applications?

ODEs are used to model a wide range of natural phenomena such as population growth, chemical reactions, and motion of objects. They are also used in engineering and physics to solve problems related to heat transfer, fluid dynamics, and electrical circuits.

4. What methods are used to solve ODEs?

There are various methods used to solve ODEs, including analytical methods such as separation of variables and integrating factors, as well as numerical methods such as Euler's method, Runge-Kutta method, and finite difference methods.

5. What are the challenges in solving ODEs?

One of the main challenges in solving ODEs is finding an analytical solution, as many ODEs do not have closed-form solutions. In such cases, numerical methods are used, which may introduce errors. Another challenge is determining the appropriate initial conditions and boundary conditions for the problem at hand.

Similar threads

  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
9
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
2K
  • Calculus and Beyond Homework Help
Replies
25
Views
462
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
2K
  • Calculus and Beyond Homework Help
Replies
4
Views
978
  • Calculus and Beyond Homework Help
Replies
3
Views
2K
  • Calculus and Beyond Homework Help
Replies
21
Views
899
  • Calculus and Beyond Homework Help
Replies
10
Views
1K
Back
Top