How can I solve a separable differential equation for an initial value problem?

Click For Summary
To solve the initial value problem dx/dt = x(2-x) with x(0) = 1, the approach involves separating variables and integrating. The integration leads to the equation ln|x| - ln|2-x| = 2t + D, where D is a constant. The logarithmic properties must be correctly applied, specifically that e^(ln a - ln b) = a/(b), to derive the relationship x/(2-x) = Ke^(2t). By applying the initial condition x(0) = 1, the constant K is determined to be 1, yielding a valid solution. The discussion emphasizes the importance of correctly handling logarithmic functions and constants during integration.
cwbullivant
Messages
60
Reaction score
0

Homework Statement



Solve the initial value problem:

dx/dt = x(2-x) x(0) = 1

Homework Equations



Problem statement.

The Attempt at a Solution



Based on the format, I attempted to solve the problem as a separable differential equation:

∫dx/(x[2-x]) = ∫dt

Evaluating to:

(ln|x|)/2 - (ln|2 - x|)/2 + C = t + C

Simplifying

ln|x| - ln|2 - x| + 2C = 2t + 2C

Cancelling the constant

ln|x| - ln|2 - x| = 2t

Removing the logs

x - (2 - x) = e^2t

Simplifying further

2x - 2 = e^2t

And finally solving for x:

(e^2t)/2 + 1

Which gives me a function, but for t = 0, x(0) = 3/2, not 1.

Should I be using another technique, or did I make a mistake somewhere in the process above?
 
Physics news on Phys.org
The reason you are given initial conditions so that you can evaluate the constant, so it shouldn't disappear. I didn't check the integration but instead write :$$\ln|x| - \ln|2-x| + K = 2t + 2C\,\,\,\text{and so} \ln|x| -\ln|2-x| = 2t + D$$ where D = 2C - K. Now evaluate D using initial conditions.
 
CAF123 said:
The reason you are given initial conditions so that you can evaluate the constant, so it shouldn't disappear. I didn't check the integration but instead write :$$\ln|x| - \ln|2-x| + K = 2t + 2C\,\,\,\text{and so} \ln|x| -\ln|2-x| = 2t + D$$ where D = 2C - K. Now evaluate D using initial conditions.

Attempting to evaluate using

$$ln|x| -\ln|2-x| = 2t + D$$

Returns

$$x = e^{2t+D} + 1$$

Hmmm... Perhaps resubstituting so that...

$$x = e^{2t}e^{D} + 1$$

And assuming e^D = some constant A

$$x = Ae^{2t} + 1$$

Which looks similar to the equation for radioactive decay.

But that only seems to satisfy the initial condition for A = 0, and while that does seem like a potential solution, it also implies that $$x(t) = Ae^{2t} + 1 = 1 \forall t $$ (sorry for bad formatting with the last bit, this is the first time I've ever actually used latex), which seems like it will be a problem.
 
cwbullivant said:
Attempting to evaluate using

$$ln|x| -\ln|2-x| = 2t + D$$
Yes, that's correct.

Returns

$$x = e^{2t+D} + 1$$
How in the world did you get this?

Hmmm... Perhaps resubstituting so that...

$$x = e^{2t}e^{D} + 1$$

And assuming e^D = some constant A

$$x = Ae^{2t} + 1$$

Which looks similar to the equation for radioactive decay.

But that only seems to satisfy the initial condition for A = 0, and while that does seem like a potential solution, it also implies that $$x(t) = Ae^{2t} + 1 = 1 \forall t $$ (sorry for bad formatting with the last bit, this is the first time I've ever actually used latex), which seems like it will be a problem.
 
cwbullivant said:

Homework Statement



Solve the initial value problem:

dx/dt = x(2-x) x(0) = 1

Homework Equations



Problem statement.

The Attempt at a Solution



Based on the format, I attempted to solve the problem as a separable differential equation:

∫dx/(x[2-x]) = ∫dt

Evaluating to:

(ln|x|)/2 - (ln|2 - x|)/2 + C = t + C

Simplifying

ln|x| - ln|2 - x| + 2C = 2t + 2C

Cancelling the constant

ln|x| - ln|2 - x| = 2t
The two constants of integration aren't necessarily equal, so you can't cancel them like you did. You usually combine them anyway, so typically, you just include the constant on one side of the equation after integrating.
$$\int \frac{dx}{x(2-x)} = \int dt \hspace{2em} \Rightarrow \hspace{2em} \frac{1}{2}\ln \lvert x \rvert - \frac{1}{2}\ln \lvert 2-x \rvert = t+C$$
Removing the logs

x - (2 - x) = e^2t
This is wrong. ##e^{\ln a + \ln b} \ne a+b##. You need to review how to work with logarithms.

Simplifying further

2x - 2 = e^2t

And finally solving for x:

(e^2t)/2 + 1

Which gives me a function, but for t = 0, x(0) = 3/2, not 1.

Should I be using another technique, or did I make a mistake somewhere in the process above?
 
vela said:
The two constants of integration aren't necessarily equal, so you can't cancel them like you did. You usually combine them anyway, so typically, you just include the constant on one side of the equation after integrating.
$$\int \frac{dx}{x(2-x)} = \int dt \hspace{2em} \Rightarrow \hspace{2em} \frac{1}{2}\ln \lvert x \rvert - \frac{1}{2}\ln \lvert 2-x \rvert = t+C$$

This is wrong. ##e^{\ln a + \ln b} \ne a+b##. You need to review how to work with logarithms.

##e^{\ln a + \ln b} = ab## and ##e^{\ln a - \ln b} = \frac{a}{b}##correct?

In which case,

$$ \frac{x}{2-x} = e^{2t}e^{D} $$

Is this on the right track?
 
Yup. So now apply the initial condition and solve for D. Note that ##e^D## is a constant, so you can write the righthand side as ##Ke^{2t}## and solve for K instead.
 
Last edited:
vela said:
Yup. So now apply the initial condition and solve for D. Note that ##e^D## is a constant, so you can write the righthand side as ##Ke^{2t}## and solve for K instead.

Ok. So $$ \frac{x}{2-x} = e^{2t}e^{D} $$, and calling $$e^D = K$$

## \frac{x}{2-x} = Ke^{2t}##, applying initial condition x(0) = 1, t = 0

## Ke^{0} = 1 ##

Given e^0 = 1, K = 1?
 
You have a solution, so you don't need us to verify it for you. If your equation satisfies the initial condition and the differential equation, you're done.
 

Similar threads

Replies
4
Views
1K
  • · Replies 2 ·
Replies
2
Views
1K
Replies
5
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 11 ·
Replies
11
Views
3K
Replies
5
Views
2K
Replies
2
Views
1K