Calculating $\oint_{L} \frac{xdy - ydx}{x^2 + y^2}$ The problem is "Calculating $\oint_{L} \frac{xdy - ydx}{x^2 + y^2}$, where L is a smooth, simple closed, and postively oriented curve that does not pass through the orgin".
Here is my solution:
Let $$P(x,y) = \frac{-y}{x^2 + y^2}, Q(x,y) = \frac{x}{x^2 + y^2}$$
Get $$\frac{\partial{P}}{\partial{y}} = \frac{y^2 - x^2}{(x^2 + y^2)^2} = \frac{\partial{Q}}{\partial{x}}$$
Acorrding to the Green formula: 
$$\oint_{L} \frac{xdy - ydx}{x^2 + y^2} = \iint (\frac{\partial{Q}}{\partial{x}} - \frac{\partial{P}}{\partial{y}})dxdy = 0$$
What's wrong with my solution?
 A: That is valid as long as $L$ is a simple closed curve and the origin is not "inside" $L$, i.e., in the bounded region determined by $L$.  For example, this would work if $L$ is a unit circle centered at $(2,0)$, but not if it is the unit circle centered at the origin, and not if it is not a simple closed curve.
(As Timothy Wagner already pointed out before I finished writing, you need to check the hypotheses on the theorem you invoked to see when it works.)
If $L$ is closed, your integral should be $2\pi$ times the number of times $L$ winds around the origin.
A: Hint: What does the hypothesis of Green's theorem say about the requirements on functions $P$ and $Q$?
A: Just to add that I think that the value of the integral (i.e., 2Pi times the
  winding number) depends only on the homotopy-type of the curve, i.e., if a curve
  C is homotopic to the circle L that winds around the origin, then the integral over
  C will have the same value as the integral over L.
A: The answer should be $2\pi$ if the origin lies "inside" $L$, otherwise it should be 0.
A: One way of understanding why Green's theorem doesn't necessarily work in this context is to view Green's theorem as two separate equations added together: $\oint_{L} P dx = \int\int-{\partial P \over \partial y} dy dx$ and $\oint_{L} Q dy = \int\int{\partial Q \over \partial x} dx dy$. 
Basically, Green's theorem holds because you can prove each of these equations by integrating by parts. In the first equation you integrate by parts in $y$ for a fixed $x$ and then integrate the result in $x$. In the second, you integrate by parts in $x$ for a fixed $y$ and then integrate the result in $y$. Since in your case both $-{\partial P \over \partial y}$ and  ${\partial Q \over \partial x}$ blow up at the origin, if the origin is contained in the interior of your curve these integrations by parts won't work... and you'll get the wrong answer. 
(The curve is assumed to be simple and closed in the above.)
A: Notice that $\frac {xdt-ydx}{ x^2+y^2}$ is the total derivative of $arctan(x/y)$, so when you integrate about a closed curve, by the fundamental theorem of contour integrals, you get (after parametrizing) $$\int_{C} \frac {xdy-ydx}{x^2+y^2} = arctan(x/y) /_{(c,d)}^{(a,b)}$$ with $(a,b), (c,d)$ points on your curve. If $C$ is a circle, then these points will be of the form $(r, \sqrt {1-r^2)}$ or $(rcos\theta,rsin\theta)$ , so that, with the latter you get $$ tan^{-1}(sin \theta/ cos \theta)=tan^{-1}(tan\theta) =  \theta$$ so that the integral equals $$ \theta_1 - \theta_2 $$ though you have to take the periodicity of $tan \theta$ into account.
