<s>[INST] Double integral with change of coordinates Evaluate the following double integral:
$$\iint_D \sqrt{x^2+y^2}\,dx\,dy$$
where $D=\{(x,y)\in\mathbb{R^2},\ x^2+y^2-4x<0\}$. I'm trying to use the polar coordinates by making the substitution $x=\rho\cos\theta$ and $y=\rho\sin\theta$.
After replacing in the domain, I find out that $0<\rho<4\cos\theta$. But what about $\theta$ ?
 [/INST] First, let's look at the region $D$: $$x^2+y^2-4x < 0 \iff (x-2)^2 + y^2 < 4$$ Hence, $D$ is the interior of the circle with centre $(2,0)$ and radius $2$. In polar coordinates, this is the region $0<\rho<4\cos\theta$ and $-\pi/2<\theta<\pi/2$. (See  here  for explanation).
Therefore, the integral is:
\begin{align}
\iint_D\sqrt{x^2+y^2}\,dx\,dy &= \int_{-\pi/2}^{\pi/2}\int_0^{4\cos\theta}\rho^2\,d\rho\,d\theta \\
&= \int_{-\pi/2}^{\pi/2} \left[\frac{\rho^3}{3}\right]_0^{4\cos\theta}\,d\theta \\
&= \frac{64}{3} \int_{-\pi/2}^{\pi/2}\cos^3\theta\,d\theta \\
&= \frac{64}{3} \int_{-\pi/2}^{\pi/2}(\cos\theta - \cos\theta\sin^2\theta)\,d\theta \\
&= \frac{128}{3} \left[\sin\theta-\frac{\sin^3\theta}{3}\right]_{0}^{\pi/2} \\ &= \frac{256}{9}
\end{align}
</s>