# The center of mass of a semiellipsoid

I am trying to find the center of mass of a semiellipsoid using cylindrical coordinates.

r^2/a^2+z^2/b^2 < 1, z < 0 the density = 1.

I know that the center of mass is (1/M int,int,int rcos(theta) f(x) dr dtheta dz),(1/M int,int,int rsin(theta) f(x) dr dtheta dz). I am having trouble figuring out the bounds.. can anyone help?

This problem can be solved with Mathematica as follows. First, define the half-ellipsoid.

reg = ImplicitRegion[(x^2 + y^2)/a^2 + z^2/b^2 < 1, {x, y, {z, -b, 0}}]


and then compute its centroid.

RegionCentroid[reg, Assumptions -> {a > 0, b > 0}]
(* {0, 0, -(3 b)/8} *)


Note that specifying {a > 0, b > 0} is necessary and also that the computation is surprising slow, of order a minute.

To obtain the centroid for a half-ellipsoid with non-uniform mass, use

Integrate[{x, y, z} f[x, y, z], {x, y, z} \[Element] reg,
Assumptions -> {a > 0, b > 0}];
Integrate[f[x, y, z], {x, y, z} \[Element] reg,
Assumptions -> {a > 0, b > 0}];
%%/%


where f is the distribution of mass. For instance, f[x_, y_, z_] := z^2 yields {0, 0, -(5 b)/8}.

Lets make an example and set a=1 and b=2. To get an idea how it looks, we first make a picture:

a = 1; b = 2;
ContourPlot3D[(x^2 + y^2)/a^2 + z^2/b^2 == 1, {x, -1, 1}, {y, -1,
1}, {z, -b, 0}]


Now we see that z changes from -b to 0. This gives for x and y:

x^2+y^2 < a^2 (1-z^2/b^2)


Therefore if y changes:

Sqrt[a^2 -(1-z^2/b^2)] < y < Sqrt[a^2 (1-z^2/b^2)]


Then x changes:

Sqrt[a^2 -(1-z^2/b^2)-y^2] < x < Sqrt[a^2 (1-z^2/b^2)+y^2]


Therefore the mass of our example is:

mass = Integrate[
1, {z, -b, 0}, {y, - Sqrt[a^2 (1 - z^2/b^2)],
Sqrt[a^2 (1 - z^2/b^2)]}, {x, - Sqrt[a^2 (1 - z^2/b^2) - y^2],
Sqrt[a^2 (1 - z^2/b^2) - y^2]}]

(4 \[Pi])/3


and the center of mass:

com = 1/mass Integrate[{x, y, z}, {z, -b,
0}, {y, - Sqrt[a^2 (1 - z^2/b^2)],
Sqrt[a^2 (1 - z^2/b^2)]}, {x, - Sqrt[a^2 (1 - z^2/b^2) - y^2],
Sqrt[a^2 (1 - z^2/b^2) - y^2]}]

{0, 0, -(3/4)}


Or for general a and b:

a =.; b =.;
mass = Integrate[
1, {z, -b, 0}, {y, - Sqrt[a^2 (1 - z^2/b^2)],
Sqrt[a^2 (1 - z^2/b^2)]}, {x, - Sqrt[a^2 (1 - z^2/b^2) - y^2],
Sqrt[a^2 (1 - z^2/b^2) - y^2]}]

2/3 a^2 b \[Pi]

com = 1/mass Integrate[{x, y, z}, {z, -b,
0}, {y, - Sqrt[a^2 (1 - z^2/b^2)],
Sqrt[a^2 (1 - z^2/b^2)]}, {x, - Sqrt[a^2 (1 - z^2/b^2) - y^2],
Sqrt[a^2 (1 - z^2/b^2) - y^2]}]

{0, 0, -((3 b)/8)}

• Thanks for catching my sign error, which I now have corrected. Commented Dec 1, 2023 at 17:30