I am trying to evaluate $$\oint _C \frac{-ydx+xdy}{x^2+y^2}$$

clockwise around the square with vertices (−1,−1), (−1,1), (1,1), and (1,−1).

So from the question, $$\vec{F}=<\frac{-y}{x^2+y^2},\frac{x}{x^2+y^2}>$$

I first conducted the gradient test $\frac{\partial F_2}{\partial x}=\frac{\partial F_1}{\partial y}$ to see whether the field is conservative. And indeed, I found out that

$$\frac{\partial F_2}{\partial x}=\frac{\partial F_1}{\partial y}=\frac{y^2-x^2}{(x^2+y^2)^2}$$

Thus, $$\vec\nabla \times\vec F=0$$

In this case, since the domain(the square) is simply connected, I thought that the answer was: $$\oint _C \frac{-ydx+xdy}{x^2+y^2}=0$$

However, apparently this is wrong and the solution is

$$\oint _C \frac{-ydx+xdy}{x^2+y^2}=2\pi$$

I don't know which of my logic is flawed.. Please help!

  • 3
    $\begingroup$ What about $x=y=0$? Think ${1 \over z}$ in complex terms. Revisit the simply connected part... $\endgroup$
    – copper.hat
    May 21, 2015 at 15:17
  • 1
    $\begingroup$ The domain where the integrand is defined is the square without the origin! $\endgroup$
    – Alex Fok
    May 21, 2015 at 15:18
  • $\begingroup$ Ah i see! what a stupid mistake.. Then does that mean the only way to solve this problem is to compute all of the four line integrals and sum them up?? $\endgroup$
    – user223022
    May 21, 2015 at 15:20
  • $\begingroup$ @user223022 I provided 3 distinct approaches. Please let me know how I can improve my answer. I just want to give you the best answer I can give you. $\endgroup$
    – Mark Viola
    May 21, 2015 at 18:23

4 Answers 4


The reason that Stokes' Theorem does not apply directly here is that $F$ is not continuous (and thus, not differentiable) throughout the region bounded by $C$. The singularity at the origin is the source the issue.

METHOD 1: Brute Force

The integration is comprised of the sum of integrals over the 4 line segments. From symmetry considerations, each contribution is identical and we therefore only need to carry out the integration over one of the four segments and multiply by $4$.


$$\begin{align} \oint_C \ \frac{-ydx+xdy}{x^2+y^2}&=4\int_{-1}^{1} \frac{(-1)dx+x(0)}{x^2+(1)^2}\\\\ &=\left. -4\arctan(x)\right|_{-1}^{1}\\\\ &=-2\pi \end{align}$$

METHOD 2: Change Contour

Since $\nabla \times \vec F =0$ for $(x,y)\ne (0,0)$, we can deform the contour to any shape that encloses the origin. Let's choose a unit circle as the new contour $C'$. Then, we have

$$\begin{align} \oint_C \ \frac{-ydx+xdy}{x^2+y^2}&=\oint_{C'} \ \frac{-ydx+xdy}{x^2+y^2}\\\\ &=-\int_{-\pi}^{\pi} \frac{-\sin \phi (-\sin \phi) d\phi+\cos \phi (\cos \phi)d\phi}{\cos^2 \phi +\sin^2 \phi}\\\\ &=-2\pi \end{align}$$

METHOD 3: Complex Plane Analysis Interestingly, this problem is identical to the imaginary part of the complex plane contour integration of $1/z$

$$\begin{align} \text{Im}\left(\oint_C \frac{dz}{z}\right)&=\text{Im}\left(\oint_C \bar z \frac{dz}{|z|^2}\right)\\\\ &=\text{Im}\left(\oint_C \frac{xdx+ydy}{x^2+y^2}+i\oint_C \frac{-ydx+xdy}{x^2+y^2}\right)\\\\ &=\oint_C \frac{-ydx+xdy}{x^2+y^2}\\\\ &=-2\pi \end{align}$$

from the residue theorem recalling that $C$ is traversed clockwise.


Put a circle of radius $r$ centered about the origin, so that the circle fits inside the rectangle. Then you know by Green's Thm that the integral over the rectangle is the same as the integral over the circle, which when you switch to polar coordinates, will give you $-2\pi $.


Since $\nabla \times \vec{F}=0$ is valid in $\mathbb{R}\backslash{(0,0)}$, you can reshape your curve to a circle centered at origin and use polar coordinates to evaluate it.


Your field $\vec F$ is nothing else but $\nabla\arg$.

The argument (polar angle) function $$\arg: \>\dot{\mathbb R}^2\to{\mathbb R}/(2\pi{\mathbb Z})$$ is locally a nice real function, but is globally only defined up to multiples of $2\pi$. Therefore on the one hand its gradient is well defined. For $x>0$ it can be computed from $$\arg(x,y)=\arctan{y\over x}\qquad({\rm mod}\ 2\pi)\ ,$$ and the result is your $\vec F$, valid in all of $\dot{\mathbb R}^2$. It follows that ${\rm curl}(\vec F)\equiv0$.

On the other hand the integral of $\vec F$ along any arc $\gamma$ in the punctured $(x,y)$-plane is equal to the total increment of $\arg$ along this arc, and the integral of $\vec F$ along the chain $C:=\partial Q$ is equal to the totel increment of $\arg$ along $C$, which is obviouly $=2\pi$.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .