Solution (source code)

= Solution

A horizontal strip at height $y$ has width $4-2\sin(\pi y/2)$. The sine term is odd, so the <area> is
$$
\boxed{|A|=\int_{-2}^{2}\left(4-2\sin\frac{\pi y}{2}\right)dy=16.}
$$
Reflection symmetry in the $y$-axis gives $\bar x=0$. For uniform density, the constant density cancels from the <center of mass> ratio. Its first moment in the vertical coordinate is
$$
\begin{aligned}
\int_A y\,dA
&=-4\int_0^2 y\sin\frac{\pi y}{2}\,dy\\
&=-4\left[-\frac{2y}{\pi}\cos\frac{\pi y}{2}+\frac4{\pi^2}\sin\frac{\pi y}{2}\right]_0^2
=-\frac{16}{\pi}.
\end{aligned}
$$
Consequently
$$
\boxed{(\bar x,\bar y)=\left(0,-\frac1\pi\right).}
$$
The wider part below the horizontal axis accounts for the negative vertical coordinate.

\Image[/past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2017/continuous-mathematics-plate-centroid.png]
{title=Uniform-density plate with area 16 and centroid at (0, -1/π)}
{description=Original plot of the strip-defined region. The marked centroid lies below the horizontal axis; the highlighted sample strip illustrates the width used in the area and moment integrals.}