Answer
$C=\ln x-tan^{-1}\frac{x}{y}$
Work Step by Step
We are given:
$$(\frac{1}{x}-\frac{y}{x^2+y^2})dx+\frac{x}{x^2+y^2}dy=0 (1)$$
Here,
$M(x,y)=\frac{\partial}{\partial y}(\frac{1}{x}-\frac{y}{x^2+y^2})=\frac{y^2-x^2}{(x^2+y^2)^2}$
$N(x,y)=\frac{\partial}{\partial x}(\frac{x}{x^2+y^2})=\frac{y^2-x^2}{(x^2+y^2)^2}$
$M_y=\frac{y^2-x^2}{(x^2+y^2)^2}\;\;\;\;,\;\;\;\;N_x=\frac{y^2-x^2}{(x^2+y^2)^2}$
$M_y=N_x$
$\Rightarrow$ (1) is exact differential equation
Therefore there exists a potential function $\phi$ such that
$\frac{\partial\phi}{\partial x}=\frac{1}{x}-\frac{y}{x^2+y^2}$ ___(2)
Integrating (2) with respect to $x$ holding $y$ fixed
$\phi =\ln x - \tan ^{-1}\frac{x}{y}+f(y)$ ___(3)
Where $f(y)$ is arbitrary function of $y$
Hence we get:
$\frac{\partial\phi}{\partial y}=\frac{x}{x^2+y^2}+f'(y)=\frac{x}{x^2+y^2} \rightarrow f'(y)=0$ (4)
Differentiate (4) with respect to $y$:
$f(y)=C$
$C$ is constant
The solution is:
$\phi(x,y)=\ln x-tan^{-1}\frac{x}{y}+C$
and $\phi(x,y)=0$
so:
$C=\ln x-tan^{-1}\frac{x}{y}$