How do i solve $\frac{dy}{dx}- \frac {dx}{dy}= \frac {x}{y}-\frac {y}{x}$? I came up with this question in my exam. But i didn't get it right. Can someone show me how to solve this differential equation
$$\frac{dy}{dx}- \frac {dx}{dy}= \frac {x}{y}-\frac {y}{x}$$

Since $$\frac{dy}{dx}-\frac{dx}{dy}=\frac{dy}{dx}-\frac{1}{\frac{dy}{dx}}=\frac{x}{y}-\frac{y}{x}$$
Let $a=\frac{dy}{dx}$ and $b=\frac{x}{y}$. We are given that $$a-\frac{1}{a}=b-\frac{1}{b}$$
Rearranging gives $$(a-b)(1+\frac{1}{ab})=0$$
Which gives us $$a=b$$ or $$a=-\frac{1}{b}$$
Plugging $a,b$ back, we have $$\frac{dy}{dx}=\frac{x}{y}$$ or $$\frac{dy}{dx}=-\frac{y}{x}$$
If $\frac{dy}{dx}=\frac{x}{y}$, we have $y dy = x dx$, so integration gives $y^2=x^2+C$, or $y=\pm \sqrt{x^2+C}$.
If $\frac{dy}{dx}=-\frac{y}{x}$, we have $-\frac{dy}{y}=\frac{dx}{x}$, so integration gives $-\ln y = \ln x+C$, or $xy=C$, so $y=\frac{C}{x}$.
Therefore, the solution set is $y=\pm \sqrt{x^2+C}$ and $y=\frac{C}{x}$.
