Solution (source code)

= Solution

The form is \b[not exact], because $P_y=1$ and $Q_x=2$. For an <integrating factor depending on one coordinate>, the condition $(\mu P)_y=(\mu Q)_x$ with $\mu=\mu(x)$ gives $\mu'/\mu=(P_y-Q_x)/Q=-1/(2x)$. Thus
$$
\boxed{\mu(x)=|x|^{-1/2}\quad\text{on either half-plane }x\ne0.}
$$
For example, on $x>0$, the multiplied form is $(\sqrt x+y/\sqrt x)dx+2\sqrt x\,dy$, with potential $\boxed{f=\tfrac23x^{3/2}+2y\sqrt x+C}$. On $x<0$, a corresponding potential is $f=\tfrac23(-x)^{3/2}-2y\sqrt{-x}+C$. The factor is local to these domains and is singular on the excluded line $x=0$.