<<Notation`
Symbolize[(NotationTemplateTag[(Subscript[ρ, 0])])]
ClearAll[COM,COM3D]

COM[𝒟_/;RegionQ[𝒟],(Subscript[ρ, 0]):_]:=Module[{x,y},
((Integrate[(Subscript[ρ, 0])[x,y]{x,y},{x,y}∈𝒟])/(Integrate[(Subscript[ρ, 0])[x,y],{x,y}∈𝒟]))
]

COM3D[𝒟_/;RegionQ[𝒟],(Subscript[ρ, 0]):_]:=Module[{x,y,z},
((Integrate[(Subscript[ρ, 0])[x,y,z]{x,y,z},{x,y,z}∈𝒟])/(Integrate[(Subscript[ρ, 0])[x,y,z],{x,y,z}∈𝒟]))
]


(Subscript[ρ, 0])[x_,y_]:=1;
𝒟=Region@ParametricRegion[{r Cos[θ], r Sin[θ]},{{r,0,1},{θ,0,π}}]
𝓅=COM[𝒟,(Subscript[ρ, 0])]
Show[𝒟,Graphics[{Red,Point[𝓅]}]]

(Subscript[ρ, 0])[x_,y_]:=1;
𝒟=Region@ParametricRegion[{x, y},{{x,0,1.1},{y,0,2}}]
𝓅=COM[𝒟,(Subscript[ρ, 0])];
Show[𝒟,Graphics[{Red,Point[𝓅]}]]

(Subscript[ρ, 0])[x_,y_]:=1;
𝒟=Region@Triangle[{{-1,0},{0,0},{1,1}}]
𝓅=COM[𝒟,(Subscript[ρ, 0])]
Show[𝒟,Graphics[{Red,Point[𝓅]}]]

Suppose that a 2 m by 3 m rectangle is cut from a square piece of plywood which originally had sides of length 4 m (as shown at right). What is the center of mass of the resulting “U-shaped” piece of plywood?

?Region

Square=ParametricRegion[{{x,y}, 0≤ x≤ 4 && 0≤ y≤ 4 },{x,y}];
CutOut=ParametricRegion[{{x,y}, 1≤ x≤ 3 && 1≤ y≤ 4 },{x,y}];
𝒟=Region@RegionDifference[Square,CutOut];
𝓅=COM[𝒟,(Subscript[ρ, 0])]//N
Show[𝒟,Graphics[{Red,Point[𝓅]}]]

ClearAll[(Subscript[ρ, 0])];
(Subscript[ρ, 0])[x_,y_,z_]=1
𝒟=Cone[{{0,0,1},{0,0,0}},1]
𝓅=COM3D[𝒟,(Subscript[ρ, 0])]//N
Show[Graphics3D[{Opacity[0.3],𝒟}],Graphics3D[{Red,Point[𝓅]}]]

RegionQ[𝒮]

Disk[{0,0},2]//Region

Assuming[0<a<1 && 0<b<1 && 0<c<1,Integrate[If [((((x/a)))^2)+((((y/b)))^2)+((((z/c)))^2)≤ 1,1.0,0.0]  ,{x,-1,1},{y,-1,1},{z,-1,1}]]

?RegionQ

?If

ClearAll["Global`*"]
Remove["Global`*"]
<<Notation`
Symbolize[(NotationTemplateTag[(OverBar[X])])]
Symbolize[(NotationTemplateTag[(Subscript[J, 0])])]
Symbolize[(NotationTemplateTag[(Subscript[E, 0])])]
Symbolize[(NotationTemplateTag[(Subscript[X_, i_])])]
Unprotect[E,I];
Ι=IdentityMatrix[3];
Module[{Π,X,(OverBar[X])},
X={(Subscript[X, 1]),(Subscript[X, 2]),(Subscript[X, 3])};
(OverBar[X])=Assuming[0<a && 0<b && 0<c,Integrate[(Subscript[ρ, 0])X,X∈Ellipsoid[{0,0,0},{a,b,c}]]];
(Subscript[E, 0])=Assuming[0<a && 0<b && 0<c,Integrate[(Subscript[ρ, 0])(X-(OverBar[X]))⊗(X-(OverBar[X])),{(Subscript[X, 1]),(Subscript[X, 2]),(Subscript[X, 3])}∈Ellipsoid[{0,0,0},{a,b,c}]]];
(Subscript[J, 0])=Tr[(Subscript[E, 0])]Ι-(Subscript[E, 0])
(*Π=X-(OverBar[X])*)]

(Subscript[J, 0])//Simplify//MatrixForm