3
$\begingroup$

Is the general solution for $\frac{\text {d}y}{\text {d}x} = e^y$

$$y = -\ln(-x+C)$$ or $$y = -\ln|-x+C|$$ or something else?

Here are the steps I'm taking: $$\begin{align} \frac{\text {d}y}{\text {d}x} & = e^y & \text{0. start}\\ e^{-y}\text {d}y & = \text {d}x & \text{1. separate dependent} y \text{and independent } x \\ \int e^{-y}\text {d}y & = \int \text {d}x & \text{2. integrate both sides} \\-\int e^u \text {d}u & = \int \text {d}x & \text{3. substitute } u = -y, \text{ constant multiple rule}\\-e^u + C_1 & = \int \text {d}x & \text{4. exponential rule} \\-e^{-y} + C_1 & = \int \text {d}x & \text{5. undo substitution} \\ -e^{-y} + C_1 & = x + C_2 & \text{6. constant rule} \\ e^{-y} - C_1 & = -x - C_2 & \text{7. multiply both sides by} -1 \\ e^{-y} & = -x - C & \text{8. combine constants of integration} \\ \ln(e^{-y}) & = \ln(-x - C) & \text{9. take natural log of both sides} \\ -y & = \ln(-x - C) & \text{10. definition of natural log} \\ y & = -\ln(-x - C) & \text{11. multiply both sides by} -1 \end{align}$$ So I end up with $$y = -\ln(-x+C)$$ but the given answer is $$y = -\ln|-x+C|$$ with the absolute value bars. Have I gone wrong somewhere? Why would it be $y = -\ln|-x+C|$ with the absolute value bars?

$\endgroup$

2 Answers 2

2
$\begingroup$

Your answer is right and the given answer is wrong. One can check for example that $y=-\ln|{-}x|$ is not a solution to the differential equation when $x>0$ (where $y=-\ln x$).

$\endgroup$
1
  • $\begingroup$ I was also staring at it and wondering. Maybe they confused the necessity of $x \mapsto e^x$ being everywhere positive with the (right thing to do, which is) invoking the domain restriction given by $-x-C > 0$, i.e. $x < -C$. $\endgroup$
    – User
    Commented Jul 6 at 22:36
1
$\begingroup$

Checking the given answer: \begin{align*} \frac{\mathrm{d}}{\mathrm{d}x} \left( -\ln |-x-C| \right) &= \frac{-1}{|-x-C|}\frac{\mathrm{d}}{\mathrm{d}x}\left( |-x-C| \right) \\ &= \frac{-1}{|-x-C|} \cdot \left( \frac{\mathrm{d}}{\mathrm{d}u} |u| \right)_{u = -x-C} \cdot \frac{\mathrm{d}}{\mathrm{d}x}(-x-C) \\ &= \begin{cases} \frac{-1}{|-x-C|} \cdot -1 \cdot -1 ,& -x-C < 0\\ \frac{-1}{|-x-C|} \cdot 1 \cdot -1 ,& -x-C > 0\\ \end{cases} \\ &= \begin{cases} \frac{-1}{|x+C|} ,& x > -C \\ \frac{1}{|x+C|} ,& x < -C \\ \end{cases} \\ \end{align*}

However, \begin{align*} \mathrm{e}^{-\ln|-x-C|} &= \mathrm{e}^{\ln\frac{1}{|-x-C|}} \\ &= \frac{1}{|x+C|} \\ \end{align*} (and $x \neq -C$ has been implicit throughout both computations).

We see that these are only equal for $x < -C$. Unless you have some constraint on $x$ that is not present in the Question, the version with the absolute value is not the solution of the differential equation.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .