I have the following integral over the unit circle $$\int_0^{2\pi}d\varphi\int_0^1 rdr \ \varphi =\pi^2$$ where $\varphi$ is the azimuthal angle and $r$ is the radial distance. If I try to convert this into Cartesian coordinates, I get $$\int_{-1}^1dx\int_{-\sqrt{1-x^2}}^{\sqrt{1-x^2}}dy \arctan{\frac{y}{x}}=0$$
what am I doing wrong in the conversion from polars to Cartesians? Thanks.
You can try using this formula for $\varphi$ on quadrants (excluding the $x$-axis):
$$\varphi(x,y) =\begin{cases} \arctan\frac{y}x, &\text{ if $(x,y)$ is in the first quadrant}\\ \arctan\frac{y}x+\pi, &\text{ if $(x,y)$ is in the second or third quadrant}\\ \arctan\frac{y}x+2\pi, &\text{ if $(x,y)$ is in the fourth quadrant}\end{cases}$$
so your integral is $$\int_0^1 \int_0^{\sqrt{1-x^2}} \arctan\frac{y}x\,dydx + \int_{-1}^0 \int_{-\sqrt{1-x^2}}^{\sqrt{1-x^2}} \left(\arctan\frac{y}x + \pi\right)\,dydx + \int_0^1 \int_{-\sqrt{1-x^2}}^{1} \left(\arctan\frac{y}x+2\pi\right)\,dydx$$ which is equal to $\frac{\pi^2}{16} + \frac{\pi^2}2+ \frac{7\pi^2}{16}= \pi^2$.