<s>[INST] Help to use change of variables to solve the double integral I'm trying to evaluate: 

$$\iint_D \left(\sqrt{a^2-x^2-y^2}-\sqrt{x^2+y^2}~\right)dxdy$$

where $D_{xy}$ is the disk $x^2+y^2\le a^2$.
The exercise is to use change of variables to solve this integral. 
My solution
I chose $\varphi (r,\theta)=(ra\cos\theta,ra\sin\theta)$, where $0\le r\le 1$ and $0\le \theta\le 2\pi$ to be the change of variables. 
The determinant of the Jacobian is $ra^2$ and 
\begin{align*}
&\iint_{D_{xy}}\left(\sqrt{a^2-x^2-y^2}-\sqrt{x^2+y^2}~\right)dxdy \\&=\int_0^{2\pi}\int^1_0\left(\sqrt{a^2-r^2a^2}-ra\right)ra^2 drd\theta\\
&=2\pi a^3\int^1_0 \left(r\sqrt{1-r^2}-r^2 \right)dr\\
&=2\pi a^3\left(\int^1_0r\sqrt{1-r^2}dr-\int^1_0r^2dr\right)\\
&=2\pi a^3\left( \frac{1}{3}-\frac{1}{3} \right)\\
&=0
\end{align*}
I would like to know where I'm mistaken. The answer in the end of the book shows $\pi a^3/3$.
 [/INST] The answer is zero; the answer in the book is incorrect.
To verify, let's show that the following integrals (from your derivation above) are equal:
$$ A = \int_0^1 r\sqrt{1 - r^2} dr$$
$$ B = \int_0^1 r^2 dr $$
Let's change variable in $A$:
$$\quad t^2 = 1 - r^2 \Rightarrow 2tdt = -2rdr\Rightarrow rdr = -tdt.$$
Hence,
$$ A = \int_0^1 \sqrt{1 - r^2}\;rdr = - \int_1^0 t^2 dt = \int_0^1 t^2 dt$$
Thus, $A$ and $B$ are equal.
</s>