# Center of mass of 2D region

The problem states:
Find the center of mass of a thin plate covering the region between the​ x-axis and the curve $$y=20/x^2, 5 \leq x \leq8$$ if the​ plate's density at a point​ (x,y) is $\delta(x)=2x^2$.
If the density were uniform I would find the center of mass using RegionCentroid:
In:= reg = ImplicitRegion[{5 <= x <= 8, 0 <= y <= 20/x^2}, {x, y}]; RegionCentroid[reg] Out= {40/3 Log[8/5], 43/160}
Is there an "easy" way like this to compute the center of mass when the density function is given? I'm trying to avoid setting up integrals manually.
It seems to me that what I need is Geometric Centroid. "http://mathworld.wolfram.com/GeometricCentroid.html" says:

The centroid is center of mass of a two-dimensional planar lamina or a three-dimensional solid. The mass of a lamina with surface density function $\sigma(x,y)$..."*. "The geometric centroid of a region can be computed in the Wolfram Language using Centroid[reg].

However it doesn't work for me. Does this function still exist in Mathematica 11 or do I need to use Needs?

Since it is a thin plate and so essentially 2D, you can use the density as the third dimension.

reg = ImplicitRegion[{5 <= x <= 8, 0 <= y <= 20/x^2, 0 <= z <= 2 x^2}, {x, y, z}];
RegionCentroid[reg]//Most

out = {13/2, 1/4}

• Nice! I think this solution is valid for 3 dimension regions by adding a density function as the 4th dimension. Am I right? May 22, 2017 at 16:44
• I believe so... May 22, 2017 at 16:55

You can use region integrals:

reg=ImplicitRegion[{5<=x<=8,0<=y<=20/x^2},{x,y}];

δ[x_,y_]:=2x^2

Integrate[{x,y} δ[x,y], {x,y} ∈ reg] / Integrate[δ[x,y], {x,y} ∈ reg]


{13/2, 1/4}