Learning Objectives
By the end of this section, you will be able to:
- Understand the physical meaning of moments and center of mass
- Calculate centers of mass for discrete point masses
- Use integration to find centers of mass for continuous distributions
- Find centroids of planar regions using double integrals
- Apply Pappus's theorem to compute volumes and surface areas
- Connect center of mass to weighted averages in machine learning
The Big Picture: Balance and Distribution
"Give me a place to stand, and I will move the Earth." — Archimedes
The center of mass is one of the most powerful concepts in physics and engineering. It's the single point where we can consider all the mass of an object to be concentrated for purposes of analyzing motion and balance. But this concept extends far beyond physics — it appears whenever we need to find the "average position" of a distribution.
Why Center of Mass Matters
The center of mass answers a fundamental question: Where is the "average location" of distributed mass? This concept appears in physics (balance points, projectile motion), engineering (structural design), statistics (expected values), and machine learning (attention mechanisms, weighted averages).
In this section, we'll use integration to extend the simple discrete formula for center of mass to continuous distributions — finding the balance point of curves, regions, and solids.
Historical Context: Archimedes and the Lever
The study of center of mass began with Archimedes of Syracuse (287–212 BCE), who discovered the law of the lever. He showed that two masses balance on a lever when:
where and are the distances from the fulcrum. This principle — that the product of mass and distance (the moment) must balance — is the foundation of all center of mass calculations.
From Discrete to Continuous
For a finite set of point masses, finding the center of mass is simple summation. But what about a continuous object like a rod with varying density? This is where calculus becomes essential — we replace sums with integrals.
Discrete Point Masses
Let's start with the simplest case: a collection of point masses along a line.
One-Dimensional System
Given point masses located at positions on the x-axis:
Center of Mass (Discrete, 1D)
Understanding Moments
The moment of a mass about a point measures the tendency of that mass to cause rotation. For a mass at distance from a pivot:
The center of mass is the point where the net moment is zero — if you placed a fulcrum there, the system would balance perfectly.
Interactive: 1D Center of Mass
Drag the masses and adjust their weights to see how the center of mass responds. Toggle "Show Moments" to see how each mass contributes:
Center of Mass: Point Masses on a Line
Adjust masses and positions to see how the center of mass changes
Center of Mass Formula
Physical Interpretation
The center of mass at x̄ = 3.500 is the balance point. If you placed a fulcrum here, the system would be in perfect equilibrium. The total mass is 6.0 kg.
Connection to Integration
For discrete masses, we sum: x̄ = Σmᵢxᵢ / Σmᵢ. For a continuous distribution with density ρ(x), this becomes an integral: x̄ = ∫x·ρ(x)dx / ∫ρ(x)dx. The integral is the continuous version of the sum!
Continuous Mass in One Dimension
For a continuous object like a rod with density (mass per unit length), we replace sums with integrals. Consider a rod from to :
Setting Up the Integral
A small segment of length at position has mass:
The total mass and moment become integrals:
Continuous 1D Center of Mass
Special Case: Uniform Density
If the density is constant (), the formulas simplify:
For a uniform rod, the center of mass is simply the midpoint — exactly what intuition suggests!
Density Cancels for Uniform Objects
When density is uniform, it cancels in the ratio M_y/M. This means the center of mass depends only on the geometry, not the material. For uniform objects, we call this the centroid.
Moments and Center of Mass in 2D
For a two-dimensional region (called a lamina) with density , we need two coordinates for the center of mass.
The Formulas
Center of Mass (2D Lamina)
Understanding the Moments
- (moment about the y-axis) measures how mass is distributed horizontally. We multiply by because we're measuring distance from the y-axis.
- (moment about the x-axis) measures how mass is distributed vertically. We multiply by because we're measuring distance from the x-axis.
A Common Point of Confusion
The subscripts may seem backwards: gives us , and gives us . Remember: the subscript tells you which axis you're computing the moment about, and moment about an axis determines the perpendicular coordinate of the centroid.
Interactive: 2D Center of Mass
Explore how the centroid changes for different 2D shapes. For uniform density, the centroid depends only on geometry:
Center of Mass: 2D Planar Regions
Explore how the centroid (center of mass for uniform density) changes with different shapes
Triangle: vertices at (0,0), (a,0), (0,b)
Area & Mass
Area A = 6.000
Mass M = ρA = 6.000
Centroid
x̄ = 1.333
ȳ = 1.000
Moments
Mx = ȳ·M = 6.000
My = x̄·M = 8.000
Centroid Formulas for Common Shapes
x̄ = a/2, ȳ = b/2
x̄ = a/3, ȳ = b/3
x̄ = r, ȳ = 4r/(3π)
x̄ = 3a/4, ȳ = 3b/5
Centroid Formulas for Regions
For a region bounded by curves, with uniform density, we can derive explicit formulas. Consider the region between and from to , where :
Centroid of a Region Between Two Curves
Why the y-formula Has a 1/2
For the y-coordinate, we're averaging the vertical position within each vertical strip. The "center" of a strip from to is at height . Working out the integral leads to the formula above.
Common Centroids Reference
| Shape | Centroid Location | Notes |
|---|---|---|
| Rectangle (a × b) | (a/2, b/2) | Center of the rectangle |
| Right Triangle | (a/3, b/3) | 1/3 from right-angle vertex |
| General Triangle | Avg of vertices | (x₁+x₂+x₃)/3, (y₁+y₂+y₃)/3 |
| Semicircle (radius r) | (r, 4r/(3π)) | ≈ 0.424r from flat edge |
| Quarter Circle | (4r/(3π), 4r/(3π)) | Same distance from each axis |
| Parabolic Segment | (3a/4, 3h/5) | y = h(1-(x/a)²) from 0 to a |
Interactive: Moments via Integration
Watch how integration builds up the moment by summing infinitely many infinitesimal contributions:
Moments and Center of Mass via Integration
See how integration computes moments by summing x·f(x)·dx contributions
A linear density increasing from left to right
Total Mass (Area)
Moment My
Center of Mass
How Integration Computes the Center of Mass
Step 1: Divide the region into thin vertical slices of width dx. Each slice at position x has "mass" dm = f(x) dx.
Step 2: The moment of each slice about the y-axis is x · dm = x · f(x) · dx.
Step 3: Sum all moments: My = ∫ x · f(x) dx.
Step 4: Divide by total mass: x̄ = My / M = [∫ x·f(x) dx] / [∫ f(x) dx].
Worked Examples
Example 1: Non-uniform Rod
Problem: A rod of length 2 meters has density kg/m. Find its center of mass.
Solution:
Step 1: Find total mass:
Step 2: Find moment about origin:
Step 3: Compute center of mass:
Physical interpretation: Since density increases with x, the center of mass is to the right of the midpoint (1 m), at 4/3 m from the left end.
Example 2: Triangular Lamina
Problem: Find the centroid of the triangular region with vertices at (0, 0), (4, 0), and (0, 3).
Solution:
The line connecting (4, 0) and (0, 3) has equation .
Step 1: Find area:
Step 2: Find :
Step 3: Find :
Verification: For any triangle, the centroid is at the average of the vertices: ((0+4+0)/3, (0+0+3)/3) = (4/3, 1). ✓
Pappus's Theorem
Pappus of Alexandria (c. 290–350 CE) discovered a remarkable connection between centroids and volumes/surfaces of revolution.
Pappus's Theorem (First)
If a plane curve is revolved about an external axis in its plane, the surface area of the resulting surface of revolution is:
where is the distance from the centroid to the axis and is the arc length.
Pappus's Theorem (Second)
If a plane region is revolved about an external axis in its plane, the volume of the resulting solid of revolution is:
where is the distance from the centroid to the axis and is the area.
Example: Volume of a Torus
Problem: Find the volume of a torus formed by revolving a circle of radius about an axis at distance from its center (where ).
Solution:
The centroid of the circle is at its center, which is at distance from the axis.
The area of the circle is .
By Pappus's theorem:
This formula is much simpler than setting up and evaluating the integral directly!
Real-World Applications
Structural Engineering
Application: In structural engineering, the centroid of a beam's cross-section determines how it resists bending. The moment of inertia (second moment of area) about an axis through the centroid is minimum, which is crucial for calculating deflection and stress.
For an I-beam, the cross-section is designed to maximize the moment of inertia while minimizing material — putting mass far from the neutral axis (the centroid line).
Physics: Projectile Motion
Application: When analyzing the motion of an extended object (like a thrown wrench), the center of mass follows a simple parabolic trajectory, even as the object rotates. All the complex rotational motion happens around the center of mass.
Aerospace: Stability
Application: Aircraft stability depends critically on the position of the center of mass relative to the center of lift. If the center of mass is too far forward or back, the aircraft becomes difficult or impossible to control.
Machine Learning Connection: Weighted Averages Everywhere
The center of mass formula is fundamentally a weighted average. This concept appears throughout machine learning.
Expected Value = Continuous Center of Mass
In probability, the expected value of a continuous random variable is:
This is exactly the center of mass formula with as the density! The expected value is the "center of mass" of a probability distribution.
Attention Mechanisms
In transformer models, attention computes:
where are the attention weights. This is a weighted average of value vectors — a center of mass in embedding space! Tokens with higher attention "pull" the output toward their embedding.
L2 Regularization and Moments
The L2 regularization term is related to the second moment (moment of inertia) about zero. Keeping weights small is analogous to keeping mass close to the origin.
Python Implementation
Computing Centers of Mass
Machine Learning Connections
Common Mistakes to Avoid
Mistake 1: Confusing moment subscripts
gives , and gives . The subscript indicates which axis you're taking the moment about.
Mistake 2: Forgetting the 1/2 in the y-centroid formula
For the region between two curves, the formula has a factor of 1/2:
This comes from averaging the height within each vertical strip.
Mistake 3: Using the wrong axis for Pappus
The axis of revolution must be external to the region — the region cannot cross the axis. Also, measure the distance from the centroid, not from the edge of the region.
Mistake 4: Assuming centroid is at the midpoint
For non-uniform density or non-symmetric shapes, the center of mass is generally not at the geometric center. Always integrate to find the actual center of mass.
Test Your Understanding
Test Your Understanding
1 / 8What is the center of mass of a uniform rod of length L?
Summary
The center of mass is the "balance point" of a mass distribution — the point where the net moment is zero. Integration extends this concept from discrete point masses to continuous distributions.
Key Formulas
| System | Center of Mass Formula | Notes |
|---|---|---|
| Discrete (1D) | x̄ = Σmᵢxᵢ / Σmᵢ | Sum of (mass × position) / total mass |
| Continuous (1D) | x̄ = ∫x·ρ(x)dx / ∫ρ(x)dx | Replace sums with integrals |
| 2D Lamina | x̄ = ∬x·ρ dA / M, ȳ = ∬y·ρ dA / M | Double integrals for area |
| Pappus (Volume) | V = 2πr̄·A | Centroid distance × Area × 2π |
Key Takeaways
- The moment of a mass about a point is mass × distance. The center of mass is where the net moment is zero.
- For continuous distributions, moments become integrals of position × density.
- For uniform density, the center of mass is called the centroid and depends only on geometry.
- (moment about y-axis) gives , and (moment about x-axis) gives .
- Pappus's theorem connects centroids to volumes and surface areas of revolution.
- Center of mass = weighted average, which appears throughout ML in expected values, attention, and more.
Coming Next: In the next section, we'll explore Probability Density Functions — where the center of mass formula becomes the expected value, connecting calculus to probability theory.