<s>[INST] Solving the equation $\frac{gy}{x} + \frac{2y^2}{x} = \frac{gy}{y^2} + \frac{2x}{y^2}$ for $x$ or $y$ One day, while making and doing math problems, I came across this equation:

$$\frac{gy}{x} + \frac{2y^2}{x} = \frac{gy}{y^2} + \frac{2x}{y^2}$$

After some simple steps, I found $g$, but I couldn't find $x$ or $y$.
Here's a picture, since I'm not good with MathJax.

 [/INST] Multiply $$\frac{gy}{x} + \frac{2y^2}{x} = \frac{gy}{y^2} + \frac{2x}{y^2}$$ by $x y^2$ to obtain
$$g y^3 + 2 y^4 = g x y + 2 x^2.$$ 
By grouping the terms together this becomes $g y (y^2 - x) + 2 (y^4 - x^2) = 0$ and factoring the last term leads to
$$(y^2 - x)(2 y^2 + g y + 2 x) = 0.$$
Solving to $x$ yields two possible values:
$$x \in \left\{y^2, - \frac{y (2 y + g)}{2} \right\}.$$
</s>