How to calculate integral $\int \frac{xdy-ydx}{x^2+y^2}$ where the figure is bounded by $l: (x-a)^2+(y-b)^2=1$ I tried to rewrite the function under integral in polar coordinates, but the issue is that I don't know how to deal with these separate $dy$, $dx$. Here is my try: $$\int \frac{r\cos\phi d\phi - r\sin\phi dr}{r}$$
The domain of the integrand constitutes those pairs $(x,y)$ such that $x\neq 0$ or $y\neq 0$. On its domain, the integrand is closed, because
$$\frac{\partial}{\partial x}\frac{x}{x^2+y^2}=\frac{\partial}{\partial y}\left(-\frac{y}{x^2+y^2}\right)=\frac{y^2-x^2}{(x^2+y^2)^2}\text{.}$$
Consequently, it is locally exact: on each contractible subset of its domain, it may be written as an exact differential. For example, if $x&gt;0$ or if $x&lt;0$, then

$$\frac{x\mathrm{d}y-y\mathrm{d}x}{x^2+y^2}=\mathrm{d}\arctan\tfrac{y}{x}$$
whereas if $y&gt;0$ or if $y&lt;0$,
$$\frac{x\mathrm{d}y-y\mathrm{d}x}{x^2+y^2}=-\mathrm{d}\arctan\tfrac{x}{y}$$

The behavior of the integral depends on whether the value of $a^2+b^2$ is less than or greater than $1$, corresponding to the circular path enclosing or excluding the origin, respectively. (If $a^2+b^2=1$, then the path goes through the origin, so we ignore this case as the integrand is not defined there.)

If $a^2+b^2&gt;1$, then the path excludes the origin and is the boundary of a disk $D$ on which the integrand is defined. Green's theorem allows us to write
$$\int_{l}\frac{x\mathrm{d}y-y\mathrm{d}x }{x^2+y^2}
=\int_D\left(\frac{\partial}{\partial x}\frac{x}{x^2+y^2}-\frac{\partial}{\partial y}\left(-\frac{y}{x^2+y^2}\right)\right)\mathrm{d}x\,\mathrm{d}y =0\text{.}$$

If $a^2+b^2&lt;1$, then the path includes the origin and passes through all four quadrants. Let $l_i$ be the portion of the path lying in quadrant $i$. On each quadrant we have an expression for the integrand as an exact differential in terms of the arctangent function,so that
$$\int_{l_i}\frac{x\mathrm{d}y-y\mathrm{d}x}{x^2+y^2}=\frac{\pi}{2}$$
$$\int_{l}\frac{x\mathrm{d}y-y\mathrm{d}x}{x^2+y^2}=4\left(\frac{\pi}{2}\right)=2\pi\text{.}$$
We have $x=a+ \cos( \phi)$ and $y=b +\sin( \phi)$ with $ \phi \in [0,2 \pi].$ Then

$\int_l \frac{xdy-ydx}{x^2+y^2}= \int_0^{ 2 \pi} \frac{(a+ \cos( \phi)) \ \cos ( \phi)-(b + \sin( \phi)) (- \sin ( \phi))}{1} d \phi=\int_0^{ 2 \pi}( a \cos ( \phi)+b \sin( \phi)+1) d \phi.$

Your turn !