Find the centre of mass of that portion of homogeneous hemispherical surface $x^2 + y^2 + z^2 = a^2$ lying above the first quadrant in the xy-plane
I did the necessary calculation and the transformations of the axis to the spherical coordinates and last step was the following:
$$\vec{r}_{cm} = \frac{\int_0^{\pi/2} \int_0^{\pi/2} [(\sin\phi \cos\theta)\hat x + (\sin\phi \sin\theta )\hat y + (\cos\phi)\hat z ] a^3 \sin\phi d\phi d\theta}{\frac{\pi a^2}{2}}$$
The x and the y coordinates of $\vec{r}_{CM}$ are correct, but not the z coordinate.I mean with this construction r becomes
$$\vec{r}_{CM}=a/2 (\hat x + \hat y) + 2a(\hat z).$$
I couldn't find where is my mistake.
The problem setup looks fine; I would just check the arithmetic at each step.
For the $z$ coordinate, we first have $$\int_0^{\pi/2} (\cos\phi) a^3 \sin\phi\, d\phi = \frac12a^3.$$
Next, $$\int_0^{\pi/2} \frac12a^3 = \frac{\pi a^3}{4}.$$
Finally, $$\frac{\pi a^3/4}{\pi a^2/2} = \frac a2.$$