TITLE: Question regarding usage of absolute value within natural log in solution of differential equation
QUESTION [13 upvotes]: The problem from the book. 

$\dfrac{\mathrm{d}y}{\mathrm{d}x} = 6 -y$ 

I understand the solution till this part. 
$\ln \vert 6 - y \vert = x + C$ 
The solution in the book is $6 - Ce^{-x}$ 
My issue this that this solution, from the book, doesn't seem to resolve the issue of the abs value of $\vert 6 - y\vert$

REPLY [2 votes]: Here's a rigorous solution:
$$\begin{align}
&\dfrac{\mathrm{d}y}{\mathrm{d}x} = 6 -y \\
\frac1{6-y}\dfrac{\mathrm{d}y}{\mathrm{d}x} &= 1 \ \ \ \ \ \ \ \ \text{or}\ \ \ \ \ \  \ \ y=\bbox[pink]{6} \\
\int\frac{\mathrm{d}y}{6-y} &= \int1{\mathrm{d}x} \\
-\ln \lvert 6-y\rvert &= x +C' \\
\lvert 6-y\rvert &= e^{-x-C'} \\
6-y= e^{-x-C'}\ \ \ &\text{or}\ \ \ y-6= e^{-x-C'}\\
y&=\bbox[pink]{6\pm e^{-C'}e^{-x}}.
\end{align}$$
Observe that $\pm e^{-C'}$ is a nonzero arbitrary constant.
Combining the two sub-answers (in pink) gives the general solution
$\bbox[yellow]{y=6+Ce^{-x}}$.


2. Alternatively, this solution avoids dealing with the modulus function, and is more compact to boot:
$$\begin{align}
\dfrac{\mathrm{d}y}{\mathrm{d}x} &= 6 -y\\
\dfrac{\mathrm{d}y}{\mathrm{d}x} +y &= 6\\
\dfrac{\mathrm{d}y}{\mathrm{d}x}e^x +ye^x  &= 6e^x \\
\dfrac{\mathrm{d}}{\mathrm{d}x} (ye^x) &= 6e^x\\
ye^x &= \int6e^x{\mathrm{d}x}\\
&=6e^x+C\\
\bbox[yellow]{y}&\bbox[yellow]{=6+Ce^{-x}}.
\end{align}$$