Solution (source code)

= Solution

Dividing by $x^2$, which is allowed precisely away from zero, gives
$$
\boxed{f(x,y)=\frac{1-2x}{x^2}y+\frac{e^{-1/x}}{x^2(1+x^2)},\qquad x\ne0.}
$$
This <function> is smooth on each of the two half-planes $x>0$ and $x<0$, and is affine in the dependent variable $y$. Its derivative with respect to $y$ is $(1-2x)/x^2$.