Systems and Center of Mass found the center of mass of a few separate objects as a mass-weighted average, $x_{\text{cm}} = \dfrac{\sum m_ix_i}{\sum m_i}$. A bat, a tapered beam or a rod of mixed materials is one continuous object. Slice it thin and the sums become the integrals of Moments and Centers of Mass.
Why it works
Cut a rod lying on the $x$-axis into slices of width $dx$. If the linear density (mass per length) at $x$ is $\lambda(x)$, the slice there has mass $dm = \lambda(x)\,dx$ and sits at position $x$. The weighted average over infinitely many thin slices is $$x_{\text{cm}} = \dfrac{\int x\,dm}{\int dm} = \dfrac{\int_0^L x\lambda(x)\,dx}{\int_0^L \lambda(x)\,dx}.$$ The bottom integral is just the total mass $M$.
Key idea
For a rod from $x = 0$ to $L$: $M = \int_0^L \lambda\,dx$ and $x_{\text{cm}} = \dfrac{1}{M}\int_0^L x\lambda\,dx$. Uniform rods balance at the middle; a rod that gets denser toward one end balances closer to that end.
Worked example: A tapered rod
A rod of length $2\ \text{m}$ has $\lambda(x) = 2 + 3x$ (kg/m). Find its mass and its center of mass.
- $$M = \int_0^2 (2 + 3x)\,dx = \left[2x + 1.5x^2\right]_0^2 = 4 + 6 = 10\ \text{kg}$$
- $$\int_0^2 x(2 + 3x)\,dx = \left[x^2 + x^3\right]_0^2 = 4 + 8 = 12\ \text{kg·m}$$
- $x_{\text{cm}} = 12/10 = 1.2\ \text{m}$, past the middle (1 m), toward the heavy end.
Answer: $M = 10\ \text{kg}$, $x_{\text{cm}} = 1.2\ \text{m}$.
Worked example: A power-law density
A rod of length $L$ has $\lambda = kx^2$. Where is its center of mass?
- $M = \int_0^L kx^2\,dx = \tfrac{1}{3}kL^3$.
- $\int_0^L x \cdot kx^2\,dx = \tfrac{1}{4}kL^4$.
- $x_{\text{cm}} = \dfrac{kL^4/4}{kL^3/3} = \tfrac{3}{4}L$. The constant $k$ cancels.
Answer: $x_{\text{cm}} = \tfrac{3}{4}L$.
Common mistake
Two slips: forgetting to divide by $M$ (then the "position" comes out in kg·m), or integrating $x\,dx$ without the density (which finds the middle of a uniform rod whatever the real density is). Check the units: $\int x\lambda\,dx$ is in kg·m, $M$ in kg, so $x_{\text{cm}}$ is in meters. And check the range: the answer must lie between 0 and $L$, nearer the denser end.
Why care where the center of mass is? Because the whole object's motion is simplest there: gravity acts as if it pulled at that one point, a thrown bat spins around it while it follows a clean parabola, and Newton's Second Law for a System shows that the external forces alone decide how it accelerates. You'll also need $\int x^2\,dm$, a close cousin of $\int x\,dm$, for Moment of Inertia by Integration.
The same idea works in two and three dimensions, one coordinate at a time: $y_{\text{cm}} = \dfrac{1}{M}\int y\,dm$. Symmetry often saves work: a uniform disk, ring or sphere has its center of mass at its geometric center.