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

In summary: So make sure it satisfies the initial condition.Homework Statement Solve the initial value problem:dx/dt = x(2-x) x(0) = 1Homework EquationsProblem statement.The Attempt at a SolutionBased on the format, I attempted to solve the problem as a separable differential equation:∫dx/(x[2-x]) = ∫dtEvaluating to:(ln|x|)/2 - (ln|2 - x|)/2 + C = t + CSimplifyingln|x| - ln|2 - x| + 2C = 2t + 2CCancelling the constantln|x| - ln|
  • #1
cwbullivant
60
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
  • #2
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.
 
  • #3
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.
 
  • #4
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.
 
  • #5
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?
 
  • #6
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?
 
  • #7
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:
  • #8
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?
 
  • #9
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.
 

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

What is a differential equation?

A differential equation is a mathematical equation that describes the relationship between a function and its derivatives. It involves one or more variables and their rates of change.

What is an initial value problem?

An initial value problem (IVP) is a type of differential equation that involves finding a function that satisfies a given differential equation and also satisfies certain initial conditions. These initial conditions typically involve the value of the function at a specific point or the value of its derivative at that point.

What is the importance of solving initial value problems?

Solving initial value problems is important in many fields of science and engineering. It allows us to model and predict the behavior of systems that change over time, such as population growth, chemical reactions, and electrical circuits. It also helps us to understand the underlying principles and relationships between different variables in a system.

What methods are used to solve initial value problems?

There are several methods for solving initial value problems, including analytical methods (such as separation of variables and variation of parameters) and numerical methods (such as Euler's method and Runge-Kutta methods). The choice of method depends on the complexity of the problem and the desired level of accuracy.

What are the applications of initial value problems?

Initial value problems have a wide range of applications in various branches of science and engineering, such as physics, biology, economics, and computer science. They are used to model and analyze real-world systems and phenomena, and to make predictions about their behavior over time. They also play a crucial role in the development of new technologies and advancements in these fields.

Similar threads

  • Calculus and Beyond Homework Help
Replies
2
Views
814
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
658
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
360
  • Calculus and Beyond Homework Help
Replies
2
Views
599
  • Calculus and Beyond Homework Help
Replies
2
Views
562
  • Calculus and Beyond Homework Help
Replies
2
Views
721
  • Calculus and Beyond Homework Help
Replies
15
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
991
Back
Top