Potential of vector field is undefined on Y-axis although field is defined I'm having the following vector field:
$$\vec{F}(x,y) = (\frac{-y}{x^2+y^2},\frac{x}{x^2+y^2})$$
The field is conservative in $\mathbb{R}^2 \backslash (0,0)$ as long as your curve doesn't encircle $(0,0)$.
The potential function I received is:
$$\phi(x,y) = -arctan(\frac{x}{y})+C $$
It is clear that on $Y=0$, the potential is undefined.
How can I calculate the line integral from point $(X,0) \rightarrow (-2,2)$ using the potential if it is undefined?
Thank you.

Your potential function needs some tweaking before it can be used in this case. Remembering
$$\mathrm{
\arctan\left(z\right)+\arctan\left({1\over z }\right)={\pi\over2}
}$$ 
turn your potential function into
$$\mathrm{
\phi(x,y)=\arctan\left({y\over x}\right)+C
}$$
which immediately yields the line integral as
$$\mathrm{
\phi(-2,2)-\phi(X,0)=-{\pi\over4}
}$$
