First order separable Equation ODE

In summary: You could do this from the beginning, looking for a solution y=5+De-sin(x) and ruling out the case D=-2. Or you could take -D as the new D and get y=5+De-sin(x) and rule out D=2. Or you could just use D as the new D and get y=5+De-sin(x) and rule out D=1/2. The point is that the absolute value is not needed. The general solution is y=5+De-sin(x) and the D you want is positive. If you let x=0 and y=7 you get D=2. But if you let x=pi
  • #1
sanhuy
40
2

Homework Statement


[tex] \frac{dy}{dx}\:+\:ycosx\:=\:5cosx [/tex]
I get two solutions for y however only one of them is correct according to my online homework
(see attempt at solution)

Homework Equations


y(0) = 7 is initial condition

The Attempt at a Solution


[tex]\int \:\frac{1}{5-y}dy\:=\:\int \:cosxdx\:+\:C [/tex]
[tex] -ln\left|5-7\right|\:=\:sinx\:+C [/tex]
[tex] \left|5-y\right|\:=\:De^{-sinx}\:where\:D\:=\:e^{-C} [/tex]
[tex] \left|5-y\right|\:=\:5-y\:,\:if\:5-y\:>\:0\:and\:\left|5-y\right|\:=\:-\left(5-y\right)\:if\:5-y<0 [/tex]
using initial conditions for both equations
[tex] y=5\:-De^{-sinx}\:\:and\:\:y\:=\:5+De^{-sinx}[/tex]
[tex] y=5\:-2e^{-sinx}\:\:and\:\:y\:=\:5+2e^{-sinx} [/tex]

however the first solution is incorrect I don't understand why
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
sanhuy said:

Homework Statement


[tex] \frac{dy}{dx}\:+\:ycosx\:=\:5cosx [/tex]
I get two solutions for y however only one of them is correct according to my online homework
(see attempt at solution)

Homework Equations


y(0) = 7 is initial condition

The Attempt at a Solution


[tex]\int \:\frac{1}{5-y}dy\:=\:\int \:cosxdx\:+\:C [/tex]
[tex] -ln\left|5-7\right|\:=\:sinx\:+C [/tex]
Did you mean 5 - y above? If you really meant 5 -7, I wouldn't substitute in the initial condition yet.
sanhuy said:
[tex] \left|5-y\right|\:=\:De^{-sinx}\:where\:D\:=\:e^{-C} [/tex]
[tex] \left|5-y\right|\:=\:5-y\:,\:if\:5-y\:>\:0\:and\:\left|5-y\right|\:=\:-\left(5-y\right)\:if\:5-y<0 [/tex]
using initial conditions for both equations
[tex] y=5\:-De^{-sinx}\:\:and\:\:y\:=\:5+De^{-sinx}[/tex]
[tex] y=5\:-2e^{-sinx}\:\:and\:\:y\:=\:5+2e^{-sinx} [/tex]

however the first solution is incorrect I don't understand why
I'm not totally clear on what you're doing above. Since y(0) = 7, you can assume that y -7 < 0 for solutions near the initial condition.
 
  • #3
sanhuy said:

Homework Statement


[tex] \frac{dy}{dx}\:+\:ycosx\:=\:5cosx [/tex]
I get two solutions for y however only one of them is correct according to my online homework
(see attempt at solution)

Homework Equations


y(0) = 7 is initial condition

The Attempt at a Solution


[tex]\int \:\frac{1}{5-y}dy\:=\:\int \:cosxdx\:+\:C [/tex]
[tex] -ln\left|5-7\right|\:=\:sinx\:+C [/tex]
[tex] \left|5-y\right|\:=\:De^{-sinx}\:where\:D\:=\:e^{-C} [/tex]
[tex] \left|5-y\right|\:=\:5-y\:,\:if\:5-y\:>\:0\:and\:\left|5-y\right|\:=\:-\left(5-y\right)\:if\:5-y<0 [/tex]
using initial conditions for both equations
[tex] y=5\:-De^{-sinx}\:\:and\:\:y\:=\:5+De^{-sinx}[/tex][/B]
[tex] y=5\:-2e^{-sinx}\:\:and\:\:y\:=\:5+2e^{-sinx} [/tex]

however the first solution is incorrect I don't understand why
Why don't you apply the initial condition on ##\left|5-y\right|\:=\:De^{-sinx}\,##? That gives ##\left|5-y\right|\:=\:2e^{-sinx} > 0##. Now check your signs again.
 
  • #4
fresh_42 said:
Why don't you apply the initial condition on ##\left|5-y\right|\:=\:De^{-sinx}\,##? That gives ##\left|5-y\right|\:=\:2e^{-sinx} > 0##. Now check your signs again.
Since 2e^−sinx>0 you can drop the absolute sign correct?
then it becomes
y=5−2e^−sinx?
 
  • #5
sanhuy said:
Since 2e^−sinx>0 you can drop the absolute sign correct?
then it becomes
y=5−2e^−sinx?
No you can't, because inside the absolute sign can still happen both possibilities. Just consider the cases ##y(x) > 5## and ##y(x) \leq 5##.

Edit: Sorry, I think I made a sign error myself.
 
  • #6
fresh_42 said:
No you can't, because inside the absolute sign can still happen both possibilities. Just consider the cases ##y(x) > 5## and ##y(x) \leq 5##.
if y(x) > 5 then |y-5| = (y-5)
and if y(x) <= 5 we get |y-5| = -(y-5) ?
then we get two solutions that i posted above again? Am i missing something here
 
  • #7
Now, that I've seen my sign error, I did what you should do as well with all of these kind of equations: check them by differentiation. (I think you were right in the first place.)
 
  • #8
fresh_42 said:
Now, that I've seen my sign error, I did what you should do as well with all of these kind of equations: check them by differentiation. (I think you were right in the first place.)
both solutions work, but my webwork says the first one is wrong
 
  • #9
Maybe you've had a typo in your other solution. Or some additional information is hidden somewhere in your text.
 
  • #10
sanhuy said:
both solutions work, but my webwork says the first one is wrong
They satisfy the differential equation, but I do not see how your negative multiplier solution satisfies the initial condition.
 
  • Like
Likes fresh_42
  • #11
haruspex said:
They satisfy the differential equation, but I do not see how your negative multiplier solution satisfies the initial condition.
I just noticed this as well. BTW I was just wondering the way I got rid of my absolute values was correct right, regardless of the general problem i stated?
 
  • #12
sanhuy said:
I just noticed this as well. BTW I was just wondering the way I got rid of my absolute values was correct right, regardless of the general problem i stated?
I was not quite sure what you did. I would substitute x=0, y=7 with still |y-5| to find D=2. Then you get y=5+/-2e-sin(x), then reuse the initial condition to rule out the -2 case.
 

1. What is a first order separable equation ODE?

A first order separable equation ODE is a type of ordinary differential equation (ODE) that can be written in the form dy/dx = f(x)g(y), where f(x) and g(y) are functions that only depend on one variable. This type of equation can be solved by separating the variables and integrating each side separately.

2. How do you solve a first order separable equation ODE?

To solve a first order separable equation ODE, you must first separate the variables by moving all the terms involving y to one side of the equation and all the terms involving x to the other side. Then, you can integrate both sides with respect to their respective variables and solve for y.

3. What is the general solution to a first order separable equation ODE?

The general solution to a first order separable equation ODE is given by y = F(x) + C, where F(x) is the antiderivative of f(x) and C is the constant of integration. This solution can be found by integrating both sides of the equation and solving for y.

4. Are there any special cases for solving a first order separable equation ODE?

Yes, there are some special cases for solving a first order separable equation ODE. For example, if f(x) = 0, then the equation becomes dy/dx = 0, which can be solved by simply integrating both sides and solving for y. Additionally, if g(y) = 0, the equation becomes dy/dx = f(x)/0, which cannot be solved using this method.

5. What are some real-world applications of first order separable equation ODEs?

First order separable equation ODEs have many real-world applications, such as in population growth models, radioactive decay, and chemical reactions. They are also commonly used in physics and engineering to model various physical phenomena.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
338
  • Calculus and Beyond Homework Help
Replies
8
Views
765
  • Calculus and Beyond Homework Help
Replies
11
Views
964
  • Calculus and Beyond Homework Help
Replies
11
Views
747
  • Calculus and Beyond Homework Help
Replies
12
Views
1K
Replies
4
Views
506
  • Calculus and Beyond Homework Help
Replies
5
Views
295
  • Calculus and Beyond Homework Help
Replies
16
Views
568
  • Calculus and Beyond Homework Help
Replies
20
Views
464
  • Calculus and Beyond Homework Help
Replies
2
Views
329
Back
Top