# DiffEq Initial Value problem

1. Sep 10, 2013

### cwbullivant

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

Solve the initial value problem:

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

2. Relevant equations

Problem statement.

3. 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?

2. Sep 10, 2013

### CAF123

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. Sep 10, 2013

### cwbullivant

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. Sep 10, 2013

### HallsofIvy

Staff Emeritus
Yes, that's correct.

How in the world did you get this?

5. Sep 10, 2013

### vela

Staff Emeritus
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.

6. Sep 10, 2013

### cwbullivant

$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. Sep 10, 2013

### vela

Staff Emeritus
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: Sep 10, 2013
8. Sep 10, 2013

### cwbullivant

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. Sep 10, 2013

### Staff: Mentor

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.