Interchange order of integral Can someone tell me which step in the process did wrong? My result seems wrong
$$D = \{(x, y) \mid \sqrt{2x - x^2} \leq y \leq \sqrt{2x}, 0 \leq x \leq 2 \}$$
$$\iint_D f(x,y) \, dy \, dx$$
Then I can draw the Graph

According to the graph, we can know that this is the area enclosed by $x = \frac{y^2}{2}$ and $x = 2$ minus the semicircle area
$$\iint_D f(x,y)\,dy\,dx = -\int_0^4 \int_{\frac{y^2}{2}}^2 f(x,y)\,dx\,dy - 2\int_0^1 \int_1^{1 + \sqrt{1 - y^2}} f(x,y)\,dx\,dy $$
 A: You haven't said what function $f$ is, but your last equality is right if the integral of $f$ over the left half of the semicircle equals the integral over the right half. But not otherwise.
A: The natural way to write the iterated integral is of course $$\iint_D f \, dA = \int_{x=0}^2 \int_{y=\sqrt{2x-x^2}}^{\sqrt{2x}} f \, dy \, dx.$$  The first alternative where the order of integration is switched, is as you attempted, the area of the parabolic sector minus the semicircle.  Note that the parabolic segment satisfies $$y = \sqrt{2x} \iff x = \frac{y^2}{2},$$ so when $x = 2$, $y = \sqrt{4} = 2$, not $y = 4$ as shown in your diagram.  Then the semicircular arc is a portion of the circle $y^2 = 2x - x^2 = 1 - (x-1)^2$, hence $$x = 1 \pm \sqrt{1 - y^2}.$$  Thus the semicircular region is, for $y \in [0,1]$, bounded above by $1 + \sqrt{1 - y^2}$ and below by $1 - \sqrt{1 - y^2}$, and we have
$$\iint_D f \, dA = \int_{y=0}^2 \int_{x=y^2/2}^2 f \, dx \, dy - \int_{y=0}^1 \int_{x=1 - \sqrt{1 - y^2}}^{1 + \sqrt{1 - y^2}} f \, dx \, dy.$$  A second alternative is to compute the area from $y = 0$ to $1$ as the sum of two sub-areas, plus a third sub-area from $y = 1$ to $2$:  $$\iint_D f \, dA = \int_{y=0}^1 \left( \int_{x=y^2/2}^{1-\sqrt{1-y^2}} f \, dx + \int_{x=1+\sqrt{1-y^2}}^2 f \, dx \right) dy + \int_{y=1}^2 \int_{x=y^2/2}^2 f \, dx \, dy.$$
