Solving the differential equation $\frac{dx}{dt} = -x$ with initial condition $x(0) = -1$.

336 Views Asked by At

I've gotten all the way down to

$$\ln x =-t+c.$$

Then, $x = \exp(-t+c) = \exp(c)\cdot\exp(-t)$.

I've seen a few places where this has been given as the right final answer but I've also seen $x=c\cdot\exp(-t)$ and I don't understand that last step.

In case I can use $c\cdot\exp (-t)$ and $\exp(c)\cdot\exp (-t)$ interchangeably and then plug in my initial values. I get $c = -1$ for the $c\cdot\exp(-t)$ variant but I'm not sure how I would solve it for the other. $-1 = \exp (-0+c) \implies -1 = \exp (c)$ as far as I know there is no real solution for that.

Could someone explain very easily and clearly, I haven't done math in several years.

All help appreciated.

3

There are 3 best solutions below

0
On

As was pointed out in the comments, the first issue is that when you solve $$\frac{dx}{dt} = -x$$ you should get $\ln|x| = -t+c$ instead of simply $\ln(x) = -t+c$. In this case, upon exponentiation, you obtain $$|x| = \exp(-t+c) = \exp(c)\exp(-t).$$ Now, since $\exp(c)$ is itself a constant, you could express this as $|x| = C\exp(-t)$. It's important to note that $C$ and $\exp(c)$ are not necessarily equal, but considering $c$ as an arbitrary constant you would still be justified in expressing the solution as $c\exp(-t)$. In this case, you proceed as you did and obtain $x(t) = -\exp(-t)$. If, however, you want to use the form $|x| = \exp(c)\exp(-t)$ then you have to observe that this implies that $$x(t) = \pm\exp(c)\exp(-t).$$ To choose the correct sign you observe that $$-1 = x(0) = \pm\exp(c) \implies -1 = \color{red}-\exp(c) \implies c = 0.$$ Again you arrive at $$x(t) = -\exp(-t).$$

0
On

$$\frac{dx}{dt}=-x$$ $$\int\frac1x\frac{dx}{dt}dt=-\int dt$$ $$\ln|x|=-t+C$$ $$|x|=C_1\exp(-t)$$ $$x=\pm C_1\exp(-t)$$ now notice that: $$\exp(-t)>0\quad\forall t\in\mathbb R$$ and so we must have $\pm C_1\ge0$

0
On

Differently from the other approaches, let us solve it through the integrating factor method: \begin{align*} x' = -x & \Longleftrightarrow x' + x = 0\\\\ & \Longleftrightarrow \exp(t)x' + \exp(t)x = 0\\\\ & \Longleftrightarrow [\exp(t)x]' = 0\\\\ & \Longleftrightarrow \exp(t)x = c\\\\ & \Longleftrightarrow x(t) = c\exp(-t) \end{align*}

Since $x(0) = -1$, we obtain the desired solution $x(t) = -\exp(-t)$, where $t\in\mathbb{R}$.

Hopefully this helps!