<s>[INST] Find the general solution to the ODE $x\frac{dy}{dx}=y-\frac{1}{y}$ I have been working through an ODE finding the general solution and following the modulus through the equation has left me with four general solutions, as shown below. Online ODE solvers, however, have only calculated the two (positive and negative), on the right hand side of the page. Am I incorrect with my use of the modulus operator after I integrated each side then?
$$\begin{align*}x\frac{dy}{dx}&=y-\frac{1}{y}\quad\quad(-1<y<1)\\
\int\frac{1}{y-\frac{1}{y}}\ dy&=\int\frac{1}{x}\ dx\\
\int\frac{y}{y^2-1}\ dy&=\int\frac{1}{x}\ dx\\
\frac{1}{2}\ln{|y^2-1|}&=\ln{|x|}+c\\
\sqrt{|y^2-1|}&=A|x|\ \text{, where $A=e^c$}\\
|y^2-1|&=A^2x^2\\
\implies y^2-1&=A^2x^2&1-y^2&=A^2x^2\\
y^2&=A^2x^2+1&y^2&=1-A^2x^2\\
\\
\therefore y&=\pm\sqrt{Kx^2+1}&y&=\pm\sqrt{1-Kx^2}\ \text{, where $K=A^2$}\\
\end{align*}$$
Thanks :)
 [/INST] Another approach is this. Rewrite the DE as
$$
\frac{yy'}{y^2-1}=\frac 1x
$$
Which is the same as
$$
\frac 12 \frac{d}{dx}\ln(y^2-1)=\frac 1x
$$
Upon integration, one gets
$$
\ln\dfrac{y^2(x)-1}{y^2(x_0)-1}=2\ln\frac{x}{x_0}
$$
Hence, one obtains
$$
y^2(x)=1+[y^2(x_0)-1]\left(\frac{x}{x_0}\right)^2
$$
</s>