Calculate $\iint\frac{dxdy}{(1+x^2+y^2)^2}$ over a triangle 
Calculate
$$\iint\frac{dxdy}{(1+x^2+y^2)^2}$$ over the triangle $(0,0)$, $(2,0)$, $(1,\sqrt{3})$.    

So I tried changing to polar coordinates and I know that the angle is between $0$ and $\frac{\pi}{3}$ but I couldn't figure how to set the radius because it depends on the angle.

Let us have a solution based on an alternative idea. We consider on the triangle $T$ the one-form
$$
\omega=\frac 12\cdot \frac {x\; dy - y\; dx}{1+x^2+y^2}\ .
$$
Then 
$$
\begin{aligned}
2d\omega
&=
\frac\partial{\partial x}\left(\frac x{1+x^2+y^2}\right)
dx\wedge dy
+
\frac\partial{\partial x}\left(\frac {-y}{1+x^2+y^2}\right)
dy\wedge dx
\\
&=\frac 2{(1+x^2+y^2)^2}\; dx\wedge dy\ .
\end{aligned}
$$
We apply Stokes now. We parametrize the boundary of $T$ using the maps 


*

*$t\to(t,0)$ for $t$ from $0$ to $2$, and there will be no contribution because of $y=0$,

*$t\to(2-t,t\sqrt 3)$ for $t$ from $0$ to $1$,

*$t\to(t,t\sqrt 3)$ for $t$ from $1$ to $0$, and there will be no contribution, because $x\; dy-y\; dx$ becomes $t\;(t\sqrt 3)'\; dt -(t\sqrt 3)\; t'\; dt$,


and compute explicitly:
$$
\begin{aligned}
&\int_{\partial T}
\frac {x\;dy}{1+x^2+y^2}
=
\int_0^2\frac {t\cdot 0'\; dt}{1+t^2+0^2}
\\
&\qquad\qquad\qquad
+
\int_0^1\frac {(2-t)\; (t\sqrt 3)'\; dt}{1+(2-t)^2+3t^2}
+
\int_1^0\frac {t\; (t\sqrt 3)'\; dt}{1+t^2+3t^2}
\ ,
\\[3mm]
&\int_{\partial T}
\frac {y\;dx}{1+x^2+y^2}
=
\int_0^2\frac {0\cdot t'\; dt}{1+t^2+0^2}
\\
&\qquad\qquad\qquad
+
\int_0^1\frac {t\sqrt 3\; (2-t)'\; dt}{1+(2-t)^2+3t^2}
+
\int_1^0\frac {t\sqrt 3\; t'\; dt}{1+t^2+3t^2}
\ ,
\\[3mm]
&\iint_T\frac {dx\; dy}{(1+x^2+y^2)^2}=
\iint_T d\omega
\\
&\qquad=
\int_{\partial T} \omega
\\
&\qquad
=\frac 12\int_0^1
\frac {(2-t)\cdot(t\sqrt 3)'-(t\sqrt 3)\; (2-t)'}{1+(2-t)^2+3t^2}
\; dt
\\
&\qquad=\frac {\sqrt 3}2\int_0^1
\frac {(2-t)+t}{(2t-1)^2+2^2}
\; dt
=\color{blue}{\frac {\sqrt 3}2\arctan\frac 12}\ .
\end{aligned}
$$
(Note: All details are included for didactical reasons, now please remove all details to have a two lines computation, given the formula for $d\omega$ and the cancellations on the first and third line path parametrizing $\partial T$.) 

A sage numerical check using Fubini...
sage: var('x,y');
sage: f = 1 / (1 + x^2 + y^2)^2
sage: assume(x>0)
sage: assume(x<2)
sage: J1 = integral( integral(f, y, 0,    x *sqrt(3)), x, 0, 1)
sage: J2 = integral( integral(f, y, 0, (2-x)*sqrt(3)), x, 1, 2)

sage: (J1+J2).n()
0.401530607798613
sage: ( sqrt(3)/2*atan(1/2) ).n()
0.401530607798613

