Integral Definition of Center of Mass: Rope in the Plane If the placement of a rope is defined by an even function $y (x) $ from $x=-a $ to $x=a $, what is the the center of mass of the rope?)


I imagined it would be the average value of the function over the interval, but that is not the case. Or if it is I am making an error in a larger problem I'm working on. 

Can anyone explain more about the integral definition of center of mass? The Wikipedia page isn't very helpful.
If $\rho$ is the density mass and $S$ is the surface of the rope, the mass $M$ is
$$
M=\iint_S\rho\,\mathrm dA
$$
and the moments are 
$$
M_x=\iint_S\rho\,y\,\mathrm dA\qquad M_y=\iint_S\rho\,x\,\mathrm dA
$$
Hence the center of mass coordinates are
$$
\begin{align}
\bar x&amp;=\frac{M_y}{M}=\frac{\iint_S x\,\mathrm dA}{\iint_S\mathrm dA}\\
\bar y&amp;=\frac{M_x}{M}=\frac{\iint_S y\,\mathrm dA}{\iint_S\mathrm dA}
\end{align}
$$
If the rope is between $f(x)$ and $g(x)$ and between $a$ and $b$
the center of mass coordinates are
$$
\begin{align}
\bar x&amp;=\frac{M_y}{M}=\frac{\int_{a}^b \int_{g(x)}^{f(x)} x\,\mathrm dy\,\mathrm dx}{\int_{a}^b \int_{g(x)}^{f(x)} \mathrm dy\,\mathrm dx}=\frac{\int_{a}^b x\left[f(x)-g(x)\right]\mathrm dx}{\int_{a}^b \left[f(x)-g(x)\right]\mathrm dx}=\frac{1}{S}\int_{a}^b x\left[f(x)-g(x)\right]\mathrm dx\\
\\
\bar y&amp;=\frac{M_x}{M}=\frac{\int_{a}^b \int_{g(x)}^{f(x)} y\,\mathrm dy\,\mathrm dx}{\int_{a}^b \int_{g(x)}^{f(x)} \mathrm dy\,\mathrm dx}=\frac{\int_{a}^b \frac{1}{2}\left[f^2(x)-g^2(x)\right]\mathrm dx}{\int_{a}^b \left[f(x)-g(x)\right]\mathrm dx}=\frac{1}{S}\int_{a}^b \frac{1}{2}\left[f^2(x)-g^2(x)\right]\mathrm dx
\end{align}
$$
where $S=\int_{a}^b \left[f(x)-g(x)\right]\mathrm dx$ is the area of the rope.

If the rope is the surface between $y=f(x)$ even, $y=0$, $x=-a$ and $x=a$
we have
$$
\begin{align}
\bar x&amp;=\frac{M_y}{M}=\frac{\int_{-a}^a xf(x)\mathrm dx}{\int_{-a}^a f(x)\mathrm dx}=\frac{\int_{-a}^a xf(x)\mathrm dx}{2\int_{0}^a f(x)\mathrm dx}=0\\
\\
\bar y&amp;=\frac{M_x}{M}=\frac{\int_{-a}^a \frac{1}{2}f^2(x)\mathrm dx}{\int_{-a}^a f(x)\mathrm dx}=\frac{1}{2}\frac{\int_{0}^a f^2(x)\mathrm dx}{\int_{0}^a f(x)\mathrm dx}
\end{align}
$$
You'll need line integrals:
$$ y_c = \frac{\int y(x)\,d\ell}{\int d\ell} = \frac{\int y(x)\sqrt{(y'(x))^2+1}\,dx}{\int\sqrt{(y'(x))^2+1}\,dx}, $$
where $d\ell=\sqrt{dx^2+dy^2}$ is the little portion of length (and thus mass).