Determine the centroid of the region $ D \ $ within the circle of radius $ \ 2 \ $ 
Determine the centroid of the region $ D \ $ within the circle of radius $ \ 2 \ $ as follows  :



Where $ \ AB \ $ is the line joining $ \ A (-\sqrt 2, -\sqrt 2) \ $ and $ \ (\sqrt 2, \sqrt 2 ) \ $
Step 1:  Use the formula $ \ \bar x=\frac{1}{A} \iint_D xdA , \ \ \bar y=\frac{1}{A} \iint_D y dA \ $, where $ \ A=\iint_D dxdy \ $ is the area of the shadded region
Step 2:  Use the formula $ \bar x=\frac{1}{2A} \int_C x^2 dy \, \ \ \bar y=\frac{1}{2A} \int_C y^2 dx$  , where $C$ is the boundary of $D$.
Show that both case gives same centroids

Answer:
The equation of the line $ AB \ $  is given by
$ y=- \sqrt 2 \ $
$$ A=\iint_D dxdy = 2 \int_{y=-\sqrt 2}^{2} \int_{0}^{\sqrt{4-y^2}} dxdy  = \int_{-\sqrt 2}^{2} \sqrt{4-y^2} dy=1+ \frac{3 \pi}{2} =5.7124$$
Thus
$$\bar x=\frac{1}{A} \int_{-\sqrt 2}^{2} \int_{-\sqrt{4-y^2}}^{\sqrt{4-y^2}} x dxdy =0 \qquad \bar y= \frac{1}{A} \int_{-\sqrt 2}^{2} \int_{-\sqrt{4-y^2}}^{\sqrt{4-y^2}} y  dxdy =0.1650. $$
Now using formula in step 2, we get
$$\bar y= \frac{1}{2A} \int_C y^2 dx = \frac{1}{2A} \int_{-2}^{2} (4-x^2) dx = \frac{10.677}{11.4248}=0.93, $$
which is not equal to above $\bar y=0.1650$.
So I am making mistake somewhere.
I think , I am making mistake when integrating along the curve $ \ C  \ $ which consists of the line segments $ AB \ $
Help me out.
 A: Note that
$$|D|=\iint_D dxdy= \int_{y=-\sqrt 2}^{2} \int_{x=-\sqrt{4-y^2}}^{x=\sqrt{4-y^2}} dxdy =2\int_{-\sqrt 2}^{2} \sqrt{4-y^2} dy =2+ 3 \pi.$$ 
Therefore
$$\bar y=\frac{1}{|D|}\iint_D ydxdy=\frac{1}{A}\int_{y=-\sqrt 2}^{2} y\int_{x=-\sqrt{4-y^2}}^{x=\sqrt{4-y^2}} dxdy\\=\frac{2}{|D|}\int_{-\sqrt 2}^{2} y\sqrt{4-y^2} dy=\frac{(4/3)\sqrt{2}}{2+ 3 \pi}\approx 0.16504.$$
Hence your first evaluation is correct.
On the other hand, the curve $C$ is the union of the segment $C_1$ and the circular arc $C_2$.
For $C_1$: $(x,y)=(t,-\sqrt{2})$ with $t\in [-\sqrt{2},\sqrt{2}]$ then 
$$\int_{C_1} y^2dx=\int_{t=-\sqrt{2}}^{\sqrt{2}}(-\sqrt{2})^2(t)'dt=4\sqrt{2}.$$
For $C_2$: $(x,y)=(2\cos(t),2\sin(t))$ with $t\in [-\pi/4,5\pi/4]$ then 
$$\int_{C_2} y^2dx=\int_{t=-\pi/4}^{5\pi/4}(2\sin(t))^2(2\cos(t))'dt=
8\int_{t=-\pi/4}^{5\pi/4}(1-\cos^2(t))^2\cos(t)'dt=?$$
Can you take it from here and correct the second evaluation?
P.S. Note that, it should be $\bar y=-\frac{1}{2|D|} \int_C y^2 dx$ where $C$ is oriented counter-clockwise. 
