Line integral of a conservative vector field I was trying to integrate the function
$$f(x,y)=\left(\frac{-y}{x^2+y^2},\frac{x}{x^2+y^2}\right)$$
from $(1,1)$ to $(1,-1)$ along any curve that does not intersect the line $L=\{(x,y)\in\mathbb{R}^2\:|\:\: y=0, x\geq 0\}$.
My approach was to note that
$$\frac{\partial f_x}{\partial y}=\frac{\partial f_y}{\partial x}$$
and that $\mathbb{R}^2-L$ is an simply connected subset of $\mathbb{R}^2$. This implies that $$\int f\cdot \mathrm{d}s$$ independs of the path and then integrated it along the circle of radius $\sqrt{2}$ that connects the points $(1,1)$ and $(1,-1)$. I arrived at the value $3\pi/2$ for the integral.
However, I could define another simply connected subset of $\mathbb{R}^2$ such that I could integrate $f$ along the line that connects $(1,1)$ to $(1,-1)$. Then I would arrive at the result $-\pi/2$ for the integral.
What is wrong here?
Thanks!
 A: The potential function is not conservative on $\mathbb{R}^2$ since $(0,0)$ is a pole: any closed path about the pole results in a non-zero value. Subtracting the ray $\{(x,0):x\ge0\}$ removes this possibility. Any path avoiding that ray should give the same value for the path integral.
\begin{equation}
 f(x,y)=-\dfrac{y}{x^2+y^2}\mathbf{i}+\dfrac{x}{x^2+y^2}\mathbf{j}
\end{equation}
You wish to evaluate
\begin{equation}
 \int_{(1,1)}^{(1,-1)}-\dfrac{y}{x^2+y^2}dx+\dfrac{x}{x^2+y^2}dy
\end{equation}
which, as you note, is exact. You have two choices for the potential function which differ by only a constant.
\begin{equation}
 \phi(x,y)=\int -\dfrac{y}{x^2+y^2}dx=-\tan^{-1}(x/y)+c_1
\end{equation}
or
\begin{equation}
 \phi(x,y)=\int \dfrac{x}{x^2+y^2}dy=\tan^{-1}(y/x)+c_2
\end{equation}
These two results differ by either $\frac{\pi}{2}$ or $-\frac{\pi}{2}$.
\begin{equation}
\tan^{-1}(x/y)+\tan^{-1}(y/x)=\begin{cases}
\frac{\pi}{2}\text{ for }xy>0\\
-\frac{\pi}{2}\text{ for }xy<0
\end{cases}
\end{equation}
If one is squeamish about integrating across a discontinuity, one may alternate between the two versions of the potential function as I have done.
Breaking the path into three segments $(1,1)\rightarrow(-1,1)$, $(-1,1)\rightarrow(-1,-1)$ and $(-1,1)\rightarrow(1,-1)$ we get
\begin{eqnarray}
\int_{(1,1)}^{(1,-1)}f\cdot\mathbf{ds}&=&\left[-\tan^{-1}(x/y)\right]_{(1,1)}^{(-1,1)}\\
           &+&\left[\tan^{-1}(y/x)\right]_{(-1,1)}^{(-1,-1)}\\
           &+&\left[-\tan^{-1}(x/y)\right]_{(-1,-1)}^{(1,-1)}\\
           &=&\dfrac{3\pi}{2}
\end{eqnarray}
