Why Piecewise Density Requires Care
A lamina may be made from materials with different densities, or its density may change from one part of a region to another. In either case, the density function is defined piece by piece. The mass and moments must account for which density applies at each point.
The central procedure is to divide the lamina into subregions on which the density has a single specified formula, calculate mass and first moments on each subregion, and add those quantities. The center of mass is then found from the totals. This works whether the pieces have constant densities or densities that vary within their respective regions.
Shared boundaries do not affect the integrals: curves and line segments have area zero. If a region is described with overlapping pieces of positive area, it is not a partition as stated; the overlap must be resolved to avoid counting mass twice.
Mass, First Moments, and Center of Mass
For a lamina in the \(xy\)-plane, mass is the integral of density over the region. The first moment about the \(x\)-axis weights each mass element by its \(y\)-coordinate; the first moment about the \(y\)-axis weights it by its \(x\)-coordinate. These conventions determine which moment appears in each coordinate of the center.
When \(m>0\), the center of mass is \((\bar{x},\bar{y})\), where each coordinate is the corresponding first moment divided by total mass.
If \(x,y\) are measured in metres and \(\rho\) in kilograms per square metre, then mass is in kilograms, each first moment is in kilogram-metres, and the center coordinates are in metres. Keep units with the quantities to help catch errors.
Why the Piecewise Calculation Works
The key fact is additivity of the double integral over regions with disjoint interiors. The same fact applies to each integrand \(\rho\), \(y\rho\), and \(x\rho\). Thus, the mass and moments of the whole lamina are sums of the corresponding quantities for its pieces.
To justify the result, write the integral over \(D\) as the sum of the integrals over the partition pieces. Applying this to each defining integral gives the three sums. The center formulas then follow directly from the definitions of \(\bar{x}\) and \(\bar{y}\). No assumption that the densities are constant is needed; each \(\rho_i\) may vary within its piece.
For practical calculations, it is helpful to record each piece’s mass and moments before adding them. In particular, a first moment is not the same quantity as a coordinate: it has units of mass times length, and it must be divided by total mass to produce a coordinate.
Worked Examples
Worked Example: Two Rectangles with Different Constant Densities
Let \(R_1=[0,2]\times[0,1]\) have density \(2\ \text{kg/m}^2\), and let \(R_2=[0,1]\times[1,3]\) have density \(1\ \text{kg/m}^2\). The rectangles share only a boundary. Find the mass and center of mass of their union.
Each rectangle has area \(2\ \text{m}^2\). Thus the masses are \(m_1=(2\ \text{kg/m}^2)(2\ \text{m}^2)=4\ \text{kg}\) and \(m_2=(1\ \text{kg/m}^2)(2\ \text{m}^2)=2\ \text{kg}\). Therefore \(m=4+2=6\ \text{kg}\).
For \(R_1\), its first moment about the \(x\)-axis is \(\iint_{R_1}2y\,dA =2\int_0^2\int_0^1 y\,dy\,dx =2(2)(1/2)=2\ \text{kg}\cdot\text{m}\). Its first moment about the \(y\)-axis is \(\iint_{R_1}2x\,dA =2\int_0^1\int_0^2 x\,dx\,dy =2(1)(2)=4\ \text{kg}\cdot\text{m}\).
For \(R_2\), the first moment about the \(x\)-axis is \(\iint_{R_2}y\,dA =\int_0^1\int_1^3 y\,dy\,dx =1((9-1)/2)=4\ \text{kg}\cdot\text{m}\). The first moment about the \(y\)-axis is \(\iint_{R_2}x\,dA =\int_1^3\int_0^1 x\,dx\,dy =2(1/2)=1\ \text{kg}\cdot\text{m}\).
Adding gives \(M_x=2+4=6\ \text{kg}\cdot\text{m}\) and \(M_y=4+1=5\ \text{kg}\cdot\text{m}\). Hence \(\bar{x}=5/6\ \text{m}\) and \(\bar{y}=6/6=1\ \text{m}\).
Check: The coordinates satisfy \(m\bar{x}=6(5/6)=5=M_y\) and \(m\bar{y}=6(1)=6=M_x\), with the appropriate units. The total area is \(4\ \text{m}^2\), so the average density is \(6/4=3/2\ \text{kg/m}^2\). Replacing the densities by this average preserves mass but gives the geometric centroid \((3/4,5/4)\ \text{m}\), not the actual center \((5/6,1)\ \text{m}\).
Worked Example: Density Changes Across a Rectangle
Let \(D=[0,2]\times[0,1]\). Set \(\rho=1\ \text{kg/m}^2\) on \(D_1=[0,1]\times[0,1]\) and \(\rho=3\ \text{kg/m}^2\) on \(D_2=[1,2]\times[0,1]\). Find the mass and center of mass.
The masses are \(m_1=1(1)(1)=1\ \text{kg}\) and \(m_2=3(1)(1)=3\ \text{kg}\), so \(m=4\ \text{kg}\).
For the first moment about the \(y\)-axis, the two contributions are \(\int_0^1\int_0^1 x\,dy\,dx=1/2\ \text{kg}\cdot\text{m}\) and \(3\int_1^2\int_0^1 x\,dy\,dx =3((4-1)/2)=9/2\ \text{kg}\cdot\text{m}\). Thus \(M_y=1/2+9/2=5\ \text{kg}\cdot\text{m}\), giving \(\bar{x}=5/4\ \text{m}\).
For the first moment about the \(x\)-axis, each piece has the same \(y\)-range: \(\int_0^1\int_0^1 y\,dy\,dx=1/2\ \text{kg}\cdot\text{m}\) and \(3\int_1^2\int_0^1 y\,dy\,dx=3/2\ \text{kg}\cdot\text{m}\). Therefore \(M_x=2\ \text{kg}\cdot\text{m}\) and \(\bar{y}=2/4=1/2\ \text{m}\).
Check: Multiplying back gives \(m\bar{x}=4(5/4)=5=M_y\) and \(m\bar{y}=4(1/2)=2=M_x\). The center lies in the rectangle and is shifted to the right, consistent with the greater density on its right half.
Worked Example: Different Densities on the Two Halves of a Disk
Consider the disk \(D\) of radius \(2\ \text{m}\), divided by the \(x\)-axis into its upper and lower semicircles. Let the upper density be \(2\ \text{kg/m}^2\) and the lower density be \(1\ \text{kg/m}^2\). Find the center of mass. Use polar coordinates \(x=r\cos\theta\), \(y=r\sin\theta\), with area element \(dA=r\,dr\,d\theta\).
Each semicircle has area \(\frac12\pi(2)^2=2\pi\ \text{m}^2\). The mass above the axis is \(4\pi\ \text{kg}\), the mass below is \(2\pi\ \text{kg}\), and the total is \(m=6\pi\ \text{kg}\).
The upper contribution to \(M_x\) is \(2\int_0^\pi\int_0^2(r\sin\theta)r\,dr\,d\theta =2(\int_0^\pi\sin\theta\,d\theta)(\int_0^2r^2\,dr) =2(2)(8/3)=32/3\ \text{kg}\cdot\text{m}\). The lower contribution is \(\int_\pi^{2\pi}\int_0^2(r\sin\theta)r\,dr\,d\theta =(\int_\pi^{2\pi}\sin\theta\,d\theta)(8/3) =(-2)(8/3)=-16/3\ \text{kg}\cdot\text{m}\). Thus \(M_x=16/3\ \text{kg}\cdot\text{m}\).
For \(M_y\), the integrand is \(x\rho=r\cos\theta\,\rho\). On each semicircle, the integral of \(\cos\theta\) over its angular interval is zero: \(\int_0^\pi\cos\theta\,d\theta=0\) and \(\int_\pi^{2\pi}\cos\theta\,d\theta=0\). Hence \(M_y=0\).
It follows that \(\bar{x}=0\) and \(\bar{y}=(16/3)/(6\pi)=8/(9\pi)\ \text{m}\). Check: \(m\bar{x}=0=M_y\), and \(m\bar{y}=6\pi(8/(9\pi))=16/3=M_x\). The positive vertical coordinate is consistent with the denser upper half.
A Common Mistake: Averaging the Densities
The average density over a whole region is total mass divided by total area. It can be useful for describing the lamina’s overall mass per unit area, but it does not preserve where the mass lies. Replacing a piecewise density by its average makes the model uniform, which generally changes both first moments and the center of mass.
In the two-rectangle example, the average is \(3/2\ \text{kg/m}^2\). Using it uniformly gives the geometric centroid: \(\bar{x}=(2(1)+2(1/2))/4=3/4\ \text{m}\) and \(\bar{y}=(2(1/2)+2(2))/4=5/4\ \text{m}\). The true center is \((5/6,1)\ \text{m}\). The shortcut gets the total mass right but the location wrong because it discards the density distribution.
Check Your Understanding
For each question, identify the relevant piecewise integrals before attempting the calculation.
- Why do shared boundaries between partition pieces not change the mass integral?
- If a lamina has total mass \(m\) and first moments \(M_x\) and \(M_y\), which quotient gives \(\bar{x}\), and which gives \(\bar{y}\)?
- A region has two disjoint pieces with masses \(m_1,m_2\) and first moments \(M_{x,1},M_{x,2}\). Write the total mass and first moment about the \(x\)-axis.
- Why can a uniform density equal to the average density yield the correct total mass but the wrong center of mass?
- For a piece symmetric about the \(y\)-axis with density symmetric across that axis, what does symmetry imply about its first moment \(M_y\)?