12

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$

jimjim
  • 9,675
yiyi
  • 7,352
  • 2
    I always thought that the abs in this kind of context are "niceties", to ensure that the value isn't negative, and there is no need to pay too much attention to them... – Valtteri Feb 23 '13 at 02:01
  • 5
    @Valtteri Not trying to sound rude but I don't want "niceties" I need pure mathematical reasoning otherwise, I doubt myself. – yiyi Feb 23 '13 at 02:02
  • The absolute value is necessary. But forgetting about it will not cause grief, as long as we make a compensating mistake. Go from $\log(6-y)=x+C$ to $6-y=Ce^x$ and then forget that $e^D$ is by nature positive. Actually, we do this kind of cheating all the time, since $y=6$ is a solution but $e^D$ cannot be $0$. Furthermore, we really should not use the same constant on both sides of $6$. In a problem with an initial condition, this issue doesn't come up. – André Nicolas Feb 23 '13 at 03:15

3 Answers3

5

You should have, as your general solution, $$ -\ln|6-y|=x+C\ \quad\iff\quad |6-y|=e^C e^{-x} . $$

If $y-6>0$, you have the solution $$y-6= e^Ce^{-x}\ \quad\iff\quad y=6+ e^Ce^{-x} . $$

If $y-6<0$, you have the solution $$6-y= e^Ce^{-x}\ \quad\iff\quad y=6- e^Ce^{-x} . $$

In either case, the solution can be written as $y=6- Ce^{-x} $, for some constant $C$ (different from the $C$ above).

David Mitra
  • 74,748
  • the $\ln|6-y|=e^C e^{-x}$ I don't understand. – yiyi Feb 23 '13 at 02:10
  • @MaoYiyi Sorry, was a typo. – David Mitra Feb 23 '13 at 02:11
  • 4
    It's worth noting that even this fails to capture the constant solution $y=6 - 0e^{-x}$, which might be said to crudely represent $C=\infty$. – Erick Wong Feb 23 '13 at 02:13
  • 2
    @ErickWong Good point. To do the separation step properly at the very beginning $y=6$ is set aside and one assumes $y\ne 6$. – Maesumi Feb 23 '13 at 02:19
  • 1
    @ErickWong Good point. The integration method used is valid only on intervals not containing $y=6$. $y=6$ is a solution and of the form given at the end ($y=6- Ce^{-x}$). – David Mitra Feb 23 '13 at 02:19
  • @ErickWong Good point. Although, I'm not sure what you mean by $C=\infty$. – Mateen Ulhaq Aug 10 '15 at 06:55
  • 1
    @MateenUlhaq There's a few different uses of $C$ in the answer (which is pretty normal usage). The $C$ I was referring to was the very first one: if $y=6$ then $-\ln|6-y|$ could loosely be said to be $\infty$. – Erick Wong Aug 10 '15 at 08:42
2
  1. Here's a clearer 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 +D \\ \lvert 6-y\rvert &= e^{-x-D} \\ 6-y= e^{-x-D}\ \ \ &\text{or}\ \ \ y-6= e^{-x-D}\\ y&=\bbox[pink]{6\pm e^{-D}e^{-x}}. \end{align}$$ Observe that $\pm e^{-D}$ 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}$$

ryang
  • 38,879
  • 14
  • 81
  • 179
0

$$\dot{y}(x)=6-y(x)$$ $$\frac{\dot{y}(x)}{6-y(x)}=1$$ $$\int{\frac{\dot{y}(x)}{6-y(x)}}dx=\int{1}dx$$ $$-\ln{|6-y(x)|}=x+c$$ $$y(x)=6-e^{-x-c}.$$

Iuli
  • 6,790