Consider the region $S$ bounded between the square with corners at the points (4,4),(-4,4),(-4,-4) and (4,-4) (oriented counterclockwise), and the circle of radius 1 centered at (-1,0) (oriented clockwise) and $$ F(x,y)=\left(\frac{-y}{(x+1)^2+y^2}, \frac{x+1}{(x+1)^2+y^2}\right) $$ and calculate $$\int_{ds} F\cdot dr$$
(Hint for calculating the line integral: Use the definition $\tan^{-1} a + \tan^{-1} a^{-1} = \frac{\pi}{2}$.
Let $P(x,y)=\frac{-y}{(x+1)^2+y^2}$ and $Q(x,y)=\frac{x+1}{(x+1)^2+y^2}$ I can't use the Green's Theorem because there is a singularity at the point $(−1,0)$ in $P$ and $Q$ .
So I want to calculate the line integral for the circle and the square
In the image I represented the curves to be integrated with their respective orientations but when I calculated the line integral of the circle I obtained that it diverges so I don't know how to continue the exercise. I leave below how to calculate this integral:
$$ \begin{split} I &= \int_{ds} F\cdot dr \\ &= \int_{0}^{2 \pi} \frac{-\sin t (-\sin t) dt} {(\cos t+1+1)^2+\sin^2 t} + \frac{(\cos t+1+1)\cos t dt}{(\cos t+1+1)^2+\sin^2 t} \\ &= \left[\frac{-1}{\sin t} - \tan^2 t +t\right]_{0}^{2 \pi} \to \infty \end{split} $$
At this point I don't know how to solve the exercise in any other way so help would be appreciated! :)
It looks like you are making a mistake when calculating the integral for the circle. You have $$ x=-1+\cos t,\ \ \ y=-\sin t $$ (where the minus sign accounts for the clockwise direction of the curve). Then $(x+1)^2+y^2=\cos^2t+\sin^2t=1$, and $$ \int_{\text{circle}}F\cdot dr=\int_0^{2\pi} \left(\sin t,\cos t \right)\cdot(-\sin t,-\cos t)\,dt=\int_0^{2\pi}(-1)\,dt=-2\pi. $$ Now you can apply Green to get (using that $F$ is conservative, so the integrand on Green is zero) that $$ \int_\text{square}F\cdot dr= -\int_{\text{circle}}F\cdot dr=2\pi. $$