Calculate center of mass with respect to radius I want to calculate the center of mass of a half circle with respect to the radius to avoid using x,y coordinates directly. Such that I can write $S_x=S_r\cdot \cos(S_{\phi})$
See here on Wolfram Alpha:

https://www.wolframalpha.com/input/?i=(2%2Fpi)+integrate+r%5E2+dphi+dr,+phi%3D0..pi,+r%3D0..1
The result is obviously wrong. Is there a mistake in my formula or is it just not possible to calculate the center of mass with respect to radius/angle, whether in polar or spheric coordinates?
 A: This can be readily solved in the complex plane without reference to the Cartesian or even polar coordinates. We begin with the definition of the centroid
$$
A=\frac{1}{2}\int\Im\{z^*\dot z\}d\theta\\
Z_c=\frac{1}{3A}\int z\ \Im\{z^*\dot z\}d\theta
$$
We the consider a semicircle of unit radius
$$
z=e^{i\theta},\quad \theta\in[0,\pi]\\
\dot z=ie^{i\theta}\\
z^*\dot z=i\\
\Im\{z^*\dot z\}=1\\
\begin{align}
Z_c
&=\frac{1}{3A}\int e^{i\theta} ~d\theta,\quad A=\pi/2\\
&=\frac{2}{3\pi}\frac{e^{i\theta}}{i}\biggr|_0^{\pi} \\
&=\frac{4 i}{3\pi},\quad (\text{i.e., on the } y \text{-axis})
\end{align}
$$
as expected.
A: The centre of mass $\bar{\bf r}$ of an object $D$ is simply given by
$$
\bar{\bf r} = \frac{\int_{{\bf r} \in D} d {\bf r} {\bf r}}{\int_{{\bf r} \in D} d {\bf r} }
$$
In particular in 2D cartesian coordinates this gives for the $y$-component
$$
\bar{y} = \frac{\int dx \int d y ~y}{\int dx \int d y}
$$
which in the case of a half circle $x^2+y^2\leq 1$ and $y \geq 0$ results in:
$$
\bar{y} = \frac{\int_{-1}^1 dx \int_0^\sqrt{1-x^2} d y ~y}{\int_{-1}^1 dx \int_0^\sqrt{1-x^2} d y}
$$
If you want to do this in polar coordinates $(x,y) = (r \cos \phi,r \sin \phi)$, the transformation replaces $\int dx \int dy \rightarrow \int dr \int r d\phi$. So the last bit you need to do is reformulate the integrand, in this case $y$, also in polar coordinates, i.e., $y=r \sin \phi$ and you get
$$
\bar{y} = \frac{\int_{0}^1 dr \int_0^{\pi} r d \phi  ~ r \sin \phi}{\int_{0}^1 dr \int_0^{\pi} r d \phi}
$$
So what you missed in your integral is the $\sin \phi $ term. This means that rather than determining the average $y$-coordinate, you were measuring the average distance from the origin. Since that average distance $r = \sqrt{x^2+y^2} > y$ also depends on the $x$-coordinate you result is too large. 
It is not really possible to use a similar approach to determine an average $\phi$ and $r$ value that would correspond to the centre of mass. The reason lies in the nature of the $r$ and $\phi$ coordinate system, where their directions depend on the location in the plane, which is not the case for cartesian coordinates. The only thing you can do is determine the integrals above in a coordinate representation of choice and after the centre of mass is obtained transform this to the relevant $(r,\phi)$ values.
In this particular case you could in principle obtain the average $\phi$ value which happens to correspond to the one for the actual centre of mass. This is accidental and only works here because there is a mirror symmetry of the object (the line $x=0$). In general however such calculation would be incorrect.
A: You need a $sin(\phi)$ in the integration.
See: https://www.wolframalpha.com/input/?i=(2%2Fpi)+integrate+sin(phi)+r%5E2+dphi+dr,+phi%3D0..pi,+r%3D0..1
That gives $4\over3\pi$.
