The differential equation $\frac{dy}{dx} = \frac{y}{x} - \frac{1}{y}\;$ I am learning differential equations and can do the basic examples. However, how can you solve the differential equation
$$\frac{dy}{dx} = \frac{y}{x} - \frac{1}{y}\;?$$
 A: Setting $y=\sqrt x\, u(x)$, the equation becomes separable:
$$\sqrt x\, u'=\frac1{\sqrt{x}}\left(\frac{u}{2}-\frac1u\right).$$
Therefore, writing
$$\frac{2u du}{u^2-2}=\frac{dx}{x},$$
we get 
$$\ln\left(u^2-2\right)=\ln x+C \qquad \Longrightarrow \quad y(x)=\pm\sqrt{x(2+Cx)}.$$
A: You already have nice solutions with substitutions. If one cannot come up with the right substitution, maybe this is a solution that works better:
Multiplying the differential equation with $y$ gives
$$
yy'=\frac{y^2}{x}-1,
$$
or
$$
\frac{1}{2}\bigl(y^2\bigr)'=\frac{y^2}{x}-1.
$$
This is a linear and first order differential equation for $y^2$, we write it as
$$
\bigl(y^2\bigr)'-\frac{2}{x}y^2=-2
$$
The integrating factor is $1/x^2$, so
$$
\Bigl(\frac{1}{x^2}y^2\Bigr)'=-\frac{2}{x^2}.
$$
Integrating,
$$
\frac{1}{x^2}y^2=\frac{2}{x}+C,
$$
where $C$ is an arbitrary constant. We can write this as
$$
y^2=2x+Cx^2\quad \text{or}\quad y=\pm\sqrt{2x+Cx^2}.
$$
A: $$\frac { dy }{ dx } =\frac { y }{ x } -\frac { 1 }{ y } \;$$ substitute

$$y=xt$$

$$  \frac { dy }{ dx } =t+x\frac { dt }{ dx } \\ t+x\frac { dt }{ dx } =t-\frac { 1 }{ xt } \\ x\frac { dt }{ dx } =-\frac { 1 }{ xt } \\ \int { tdt } =\int { -\frac { d }{ { x }^{ 2 } }  } \\ \frac { { t }^{ 2 } }{ 2 } =\frac { 1 }{ x } +C\\ \frac { { y }^{ 2 } }{ { x }^{ 2 } } =\frac { 2 }{ x } +C\\ y=\pm \sqrt { 2x+{ x }^{ 2 }C } $$
A: Multilpying the equation by $2y$ we get , $$2y\frac{dy}{dx}-\frac{2y^2}{x}=-2.$$Now put , $y^2=z$. Then ,$$\frac{dz}{dx}-\frac{2z}{x}=-2.$$So , $I.F.=e^{-2\ln x}=\frac{1}{x^2}$. Then solution is $$\frac{z}{x^2}=-2\int\frac{dx}{x^2}+C$$That is $$\frac{y^2}{x^2}=\frac{2}{x}+C.$$
