(* We compute the centroid of the upper hemisphere with radius R centered at the origin *) 
(* parametrization *)
r={R Sin[ph]Cos[th],R Sin[ph]Sin[th],R Cos[ph]}
(* partial derivatives *)
rt=D[r,th]
rp=D[r,ph]
(* normal vector *)
n=Simplify[Cross[rt,rp]]
(* length normal vector *)
nn=Simplify[Norm[n],Assumptions-> R>0 &&0<th<2 Pi&&0<ph<Pi/2]
(* surface integral of 1 *)
m=Integrate[Integrate[nn,{th,0,2 Pi}],{ph,0,Pi/2}]
(* surface integral of z *)
mz=Integrate[Integrate[r[[3]]nn,{th,0,2 Pi}],{ph,0,Pi/2}]
(* centroid *)
zbar=mz/m