# Solving $x \frac{\mathrm dy}{\mathrm dx}=y+1$

Following differential equation is given: $$x \frac{\mathrm dy}{\mathrm dx}=y+1.$$

Separating variables and integrating: $$\int \frac{1}{y+1} \mathrm dy=\int \frac 1x \mathrm dx$$ $$\ln|y+1|=\ln|x|+c$$

In my textbook the following step is: $$y+1=Ax \,\,\,\,\, \text{(where} \ A=e^c).$$

My question is why the modulus function can be omitted after exponentiating.

It can't! Except that it almost can. Here's the steps, slowed down.

$$\ln|y + 1| = \ln|x| + c$$ $$e^{\ln|y + 1|} = e^{\ln|x| + c}$$ $$|y + 1| = e^c|x|$$ $$y + 1 = \pm e^c|x|$$

But $\pm|x|$ is really just $\pm x$, so we have $y + 1 = \pm e^cx$.

If you say $A$ is $e^c$, then $A$ has to be positive, because powers of $e$ are always positive. Instead, we can say $A = \pm e^c$, which can be any nonzero constant.

So now we have $y + 1 = Ax$, for $A \neq 0$. But the case where $A = 0$ was accidentally ruled out when you divided by $y + 1$; $y = -1$ is a solution to the original differential equation. So the general solution is $y + 1 = Ax$, where $A$ is any constant.

• I just came across another diff. equ.: $$\frac{dy}{dx}=\frac{y^2}{x}$$Here I have the same problem. Separating variables: $$\int y^{-2} dy = \int x^{-1} dx \Rightarrow -y^{-1}=\ln|x|+c \Rightarrow y=\frac{1}{c-\ln |x|}$$ But Wolfram alpha and the solution manual both give $$y=\frac{1}{c-\ln x}$$ How can this omission of the modulus be explained? – FizzleDizzle Jul 14 '18 at 13:32
• (Edit: The last equation of the second line should be $y=\frac{1}{c'-\ln |x|}$, where $c'=-c$.) – FizzleDizzle Jul 14 '18 at 13:40

Without using logs function

$$x \frac{\mathrm dy}{\mathrm dx}=y+1$$ $$xy'-y=1$$ $$(\frac yx)'=\frac 1 {x^2}$$ Integrate $$\frac yx=\int \frac {dx} {x^2}$$ $$\implies y=Kx-1$$

It is wrong.

Try $y=-2$ so $$\ln|y+1|=0\implies \exp(\ln|y+1|)=1$$ whereas $$y+1=-2+1=-1\neq1.$$

They should not specify that $A=e^c$ but rather $A=\pm e^c$ to take into account of the pluses and minuses in the $x$s and $y$s.

Note that $$\ln|y+1|=\ln|x|+c \iff |y+1|=e^{c}|x|\iff y+1 = \pm e^{c} x = Ax,$$ where $A$ can be positive or negative.

Absorbing two $\pm$ signs into one, $y+1=\pm |y+1|=\pm A|x|=\pm Ax$. We can then redefine $A$ to absorb the final $\pm$ sign. You could posit different multipliers for $x$ depending on whether $x>0$ or $x<0$, but this would cause $y'$ to be undefined at $x=0$.

Another approach: write $y+1=zx$ so $x(zx)'=zx$, i.e. $z'x^2=0$. If $x\ne 0$, $z'=0$ so $z$ is constant. If at $x=0$ we have a $z$ discontinuity, $y',\,z'$ will both be undefined.

I did this. You have $$xy' - y = 1.$$ Divide by $x^2$ and you have $$y(1/x) + (1/x)'y = {1\over x^2}.$$ Undoing the product rule you have $$(y/x)' = {1\over x^2},$$ so $$y/x = C - 1/x.$$ Multipling by $x$ you have $$y = Cx - 1.$$