# Solve $(y+1)dx+(x+1)dy=0$

Solve $$(y+1)dx+(x+1)dy=0$$

$$\frac{dy}{y+1}=-\frac{dx}{x+1}$$

then we get $$\ln|y+1|=-\ln|x+1|+c$$

$$\ln(|(y+1)(x+1)|)=c$$

$$|(y+1)(x+1)|=e^c=c_1$$

but answer is $$y+1=\frac{c}{x+1}$$ can you help to find where is my mistake?

• There are no mistakes. If you are new to indefinite integrals and differential equations , then you can expect that many times the answer you arrive at might not match exactly with the book. There is absolutely no problem with that provided you did correctly. And it is customary that after the integral the modulus is dropped. It is assumed that you are in the domain. So don't be too concerned with that. Many a times you will see answers which do not match yours but they are equivalent. Dec 12, 2021 at 15:09
• @Mr.GandalfSauron Thanks for comments.But when we drop modulus we lose case where $(y+1)(x+1) < 0$ Dec 12, 2021 at 15:25
• As I said in my comment. You are assumed to already be in the domain of definition. So you WILL see many text books dropping modulus. That does not make it incorrect. Dec 12, 2021 at 16:01

i don't think you made a mistake. continuing from where you stopped,
if $$(y+1)(x+1)>0$$ , then $$y+1=\frac{c_1}{x+1}$$.
otherwise if $$(y+1)(x+1)<0$$ , then $$y+1=-\frac{c_1}{x+1}$$.

Simpler:

$$(y+1)dx + (x+1)dy = 0$$

$$ydx + xdy = -(dx+dy)$$

$$d(xy) = d(-(x+y))$$

$$xy = -(x+y) + c$$

$$xy + x + y = c$$, which is equivalent to your given answer.

• Not sure who downvoted this, but I think this shows an easier way to get to the solution, which doesn't rely on absolute value. Dec 13, 2021 at 22:02
• Just to show the final steps: (a) add $1$ to both sides. The $C$ can swallow it (since a constant plus a constant is still a constant). (b) Then the left-hand side factors to $(x + 1)(y + 1)$ which (c) can then be divided out into the solution. Dec 13, 2021 at 22:04

$$(y+1)dx+(x+1)dy=0$$

$$M(x, y) =y+1$$

$$N(x, y) =x+1$$

Then, $$\frac {\partial M}{\partial y}=1=\frac {\partial N}{\partial x}$$

Hence, the differential equation is exact.

Choose, $$u(x, y)$$ be such that

$$u_x =M$$ and $$u_y =N$$

Then, $$u(x, y) =\int {M {dx}}=x(y+1)+h(y)$$

$$u_y (x, y)=x+h'(y)$$

$$x+h'(y)=x+1$$

$$h(y) =y$$

Hence, $$u(x, y) =x(y+1)+y$$

Solution : $$u(x, y) =C$$

$$\implies x(y+1)+y =C$$

$$\implies x(y+1)+y+1 =C+1$$

$$(y+1)(x+1 )=c \space \space [c=C+1]$$

Hence, $$(y+1)=\frac{c}{(x+1)}$$

Note: \begin{align} \frac {d}{dx}{u(x, y(x))} &=u_x + u_y \frac {dy}{dx}\\&=M+N \frac {dy}{dx} =0 \end{align}

Hence,$$u(x, y) =C$$

• Solution :$u(x,y)=C$.Can you explain this step?Why it is equal to $C$? Dec 12, 2021 at 14:57
• \begin{align} \frac {d}{dx}{u(x, y(x))} &=u_x + u_y \frac {dy}{dx}\\&=M+N \frac {dy}{dx} =0 \end{align} Hence,$u(x, y) =C$ Dec 12, 2021 at 15:09

The equation can be properly written as $$y(x)+1+(x+1)y'(x)=0,$$ which suggests the substitution $$z(x)=(x+1)[y(x)+1].$$ Hence $$z'(x)=y(x)+1+(x+1)y'(x),$$ implying $$z'(x)=0.$$ Since $$y$$ need not be differentiable at $$-1$$ to satisfy the equation everywhere else, we account for this, so we have that $$(x+1)[y(x)+1]=A$$ for every $$x\lt-1,$$ and $$(x+1)[y(x)+1]=B$$ for every $$x\gt-1.$$ $$A$$ and $$B$$ need not be equal. As such, $$y(x)=\frac{A}{x+1}-1$$ for every $$x\lt-1$$ and $$y(x)=\frac{B}{x+1}-1$$ for every $$x\gt-1.$$

In your case, you did this instead by writing the equation as $$\frac{y'(x)}{y(x)+1}=-\frac{1}{x+1},$$ which ignores the solution $$y(x)=-1.$$ Once you antidifferentiated, you wrote $$\ln|y(x)+1|=-\ln|x+1|+c,$$ but a more careful way to antidifferentiate is to use different constants of antidifferentiation in different intervals. In other words: $$\ln(-(y(x)+1))=-\ln(-(x+1))+A$$ for $$y(x)\lt-1,x\lt-1,$$ $$\ln(-(y(x)+1))=-\ln(x+1)+B$$ for $$y(x)\lt-1,x\gt-1,$$ $$\ln(y(x)+1)=-\ln(-(x+1))+C$$ for $$y(x)\gt-1,x\lt-1,$$ $$\ln(y(x)+1)=-\ln(x+1)+D$$ for $$y(x)\gt-1,x\gt-1.$$ Respectively, this simplifies to $$y(x)+1=\frac{\exp(A)}{x+1},$$ $$y(x)+1=-\frac{\exp(B)}{x+1},$$ $$y(x)+1=-\frac{\exp(C)}{x+1},$$ $$y(x)+1=\frac{\exp(D)}{x+1}.$$ This can be simplified to the answer I gave, provided that you include $$y(x)=-1$$ by allowing the constants to be $$0.$$