Solution (source code)

= Solution

An <exact differential> $M\,dx+N\,dy$ is $d\Phi$ for a scalar <potential function> $\Phi$, so $M=\partial\Phi/\partial x$ and $N=\partial\Phi/\partial y$. Equality $\partial M/\partial y=\partial N/\partial x$ is necessary, and is sufficient on a <simply connected space> when these <partial derivatives> are continuous.

Here, after multiplying the <ordinary differential equation> by $dx$,
$$
M=x+\frac{2x}{y^2},\qquad N=6y-\frac{2x^2}{y^3},\qquad
\frac{\partial M}{\partial y}=-\frac{4x}{y^3}=\frac{\partial N}{\partial x}.
$$
On either half-plane $y>0$ or $y<0$, integrate $M$ with respect to $x$:
$$
\Phi=\frac{x^2}{2}+\frac{x^2}{y^2}+h(y).
$$
Comparison of $\partial\Phi/\partial y$ with $N$ gives $h'(y)=6y$, hence $h(y)=3y^2$ up to a constant. The solution is therefore the family of <level sets>
$$
\boxed{\frac{x^2}{2}+\frac{x^2}{y^2}+3y^2=C,\qquad y\ne0.}
$$
Locally these define differentiable graphs $y(x)$ wherever $N\ne0$, by the <implicit function theorem>. When $N=0$, $M\ne0$ on this domain, so a finite derivative cannot satisfy $M+Ny'=0$ there; such points are <vertical tangents> of the implicit curves, rather than additional classical graph solutions.