double integral with singularity (not exactly singularity) I'd like to solve $\iint_R \tan^{-1} \frac{y}{x}dA$, where $R=\{ (x,y) : x\ge0, y\ge 0, x^2+y^2 \le 4\}.$ 
I'm wondering if the following calculation is true:
$$
\begin{split}
\iint_R \tan^{-1} \frac{y}{x}dA
  &=\int_0^{\pi/2}\int_0^2
      \tan^{-1} \left(\frac{r \sin \theta}{r\cos\theta}\right)rdrd\theta\\
  &=\int_0^{\pi/2}\int_0^2 \tan^{-1}(\tan\theta)rdrd\theta\\
  &=\int_0^{\pi/2}\int_0^2\theta rdrd\theta\\
  &=\frac{\pi^2}{4}
\end{split}
$$
It might be true, but I don't think it is a rigid proof.
Apparently, $\tan^{-1} \frac{y}{x}$ is not defined for $x=0,$ but since $\lim_{x \to +0} \frac{y}{x} \to \infty$, we may extend or regard $\tan^{-1} \frac{y}{x}=\frac{\pi}{2}$ for $x=0.$ 
Please let me know if you have any comments for this problem. Thanks in advance!
 A: You're noticing is that the integral is improper when $x=0$. 
This translates to it being improper at $\theta=\pi/2$ in polar coordinates. So it's slightly better to include the limits. 
$$
\begin{split}
\iint_R \tan^{-1} \frac{y}{x}dA
&=\int_0^2\int_0^\sqrt{4-x^2}\tan^{-1}\frac{y}{x}\,dy\,dx\\
&=\lim_{a\to 0^+}\int_a^2\int_0^\sqrt{4-x^2}\tan^{-1} \frac{y}{x}\,dy\,dx\\
&=\lim_{a\to 0^+}\int_0^{\alpha(a)}\int_{a^2\sec\theta}^2\tan^{-1} \frac{r\sin\theta}{r\cos\theta}\,r\,dr\,d\theta\\
&=\lim_{a\to 0^+}\int_0^{\alpha(a)}\int_{a\sec\theta}^2 \theta r\,dr\,d\theta\\\
&=\lim_{a\to 0^+}\int_0^{\alpha(a)} 2\theta-\frac{a^2}{2}\theta \sec^2(\theta)\, d\theta\\\
&=\lim_{a\to 0^+} \theta^2 |_0^{\alpha(a)}-\frac{a^2}{2}\left[\ln\left|\cos\theta\right|-\theta\tan\theta\right]_0^{\alpha(a)}\\
&=\frac{\pi^2}{4}
\end{split}
$$
Note $x=a$ under the change of coordinates is $r\cos \theta=a$ so $r=a\sec\theta$. Also define the angle to the point $(a,\sqrt{4-a^2})$ to be $\alpha(a)$ for all $a>0$ that is $\alpha(a)=\tan^{-1}\sqrt{4/a^2-1}$. 
First part simply becomes $\lim_{a\to 0^+} (\tan^{-1}\sqrt{4/a^2-1})^2=(\lim_{x\to\infty}\tan^{-1}(x))^2=\left(\frac{\pi}{2}\right)^2$ the right hand part is zero. Here are some notes on how to see that 
$$\begin{split}
\lim_{a\to 0^+}a^2\alpha(a)\tan(\alpha(a)) &=
\lim_{a\to 0^+}a^2\sqrt{4/a^2-1}\tan^{-1}\sqrt{4/a^2-1}\\
&=\lim_{a\to 0^+}a\sqrt{4-a^2}\tan^{-1}\sqrt{4/a^2-1}\\
&=(0)(2)\left(\frac{\pi}{2}\right)=0
\end{split}$$
$$\begin{split}
\lim_{a\to 0^+}a^2\ln\left|\cos\alpha(a)\right|&=
\lim_{a\to 0^+}a^2\ln\left|\frac{a^2}{4}\right|\\
&=\lim_{a\to 0^+}\frac{\ln\left|\frac{a^2}{4}\right|}{a^{-2}}\\
&=\lim_{a\to 0^+}-a^2=0
\end{split}$$
where the last step is by L'Hopital's rule
