<s>[INST] Differential equation, modulus signs in solution? Question: Find the equation of the curve with gradient $\frac{dy}{dx}=\frac{y+1}{x^2-1}$ that passes through $(-3,1)$.
So I integrated both sides with respect to $x$ which gave me
$\ln{|y+1|}=\frac{1}{2}\ln{|x-1|}-\frac{1}{2}\ln{|x+1|}+c$
Given the point I found $c=\ln{\sqrt{2}}$
So at this point I figure the best way this equation can tidy up is $|y+1|=\sqrt{\frac{2|x-1|}{|x+1|}}$
I'm having trouble getting my head around what I can do with the equation at this point. The textbook gives an answer of $(y+1)^2(x+1)=2(x-1)$ but where have the modulus signs gone? Surely changing them to brackets gives just one possible curve (ie. where $y>-1$ and $x>1$)? And can you just square both sides of the equation like this? ($y=x$ and $y^2=x^2$ aren't the same curve)
Can anyone help me out with perhaps a little intuition here, and maybe some advice with how the solution should be presented here? Thanks in advance.
 [/INST] $$\frac{dy}{dx}=\frac{y+1}{x^2-1}$$
$$\ln{|y+1|}=\frac{1}{2}\ln{|x-1|}-\frac{1}{2}\ln{|x+1|}+c\qquad\text{is OK.}$$
$y(-3)=1 \implies c=\frac12\ln{\sqrt{2}}\quad$ but not $c=\ln{\sqrt{2}}$ .
$$2\ln{|y+1|}=\ln{|x-1|}-\ln{|x+1|}+\ln(2)$$
$$(y+1)^2=2\left|\frac{x-1}{x+1}\right|$$
Then one have to study the function $f(x)=\frac{x-1}{x+1}$ which must be positive. We show that :
$$f(x)>0 \quad\text{if}\quad \left(x<0\quad\text{or}\quad x>2 \right)$$
$$f(x)<0 \quad\text{if}\quad 0<x<2$$
Thus
$$(y+1)^2=2\frac{x-1}{x+1}\quad\text{if}\quad \left(x<0\quad\text{or}\quad x>2 \right) $$
$$(y+1)^2=-2\frac{x-1}{x+1}\quad\text{if}\quad 0<x<2 $$
The specified point $(x=-3\:;\:y=1)$ belongs to the branche :
$$(y+1)^2(x+1)=2(x-1)\qquad x<0.$$
</s>