Learning Objectives
By the end of this section, you will be able to:
- Understand why work done by a variable force requires integration rather than simple multiplication
- Calculate work as the definite integral
- Apply Hooke's Law to compute work done on springs
- Set up and evaluate integrals for lifting problems with variable mass (ropes, chains, cables)
- Calculate work done pumping fluids from tanks of various shapes
- Connect work-energy concepts to optimization in machine learning
The Big Picture: Why Integration?
"Work is not just force times distance—it's the accumulation of infinitely many infinitesimal contributions when force varies."
In elementary physics, you learned that work equals force times distance:. This formula works perfectly when the force is constant. But what happens when the force changes as you move?
Consider these scenarios:
- Stretching a spring: The farther you stretch, the harder it gets. Force increases with displacement.
- Lifting a heavy rope: As you pull up more rope, less remains hanging, so you lift less weight.
- Pumping water: Water at the bottom must be lifted higher than water at the top.
- Rocket escaping Earth: Gravitational force weakens with altitude.
In all these cases, the simple formula fails because is not constant. We need integration to sum up infinitely many small contributions:
Work equals the integral of force over the path of motion.
The Central Idea
Work is accumulated force times distance. When force varies, we break the path into infinitesimal pieces where force is approximately constant, compute the tiny work , and integrate to find the total.
Historical Context: From Machines to Energy
The concept of work emerged from the study of simple machines—levers, pulleys, inclined planes—during the Renaissance. Engineers wanted to quantify the "effectiveness" of machines.
Gaspard-Gustave Coriolis (1792–1843)
The French mathematician Coriolis gave the first precise definition of work as in his 1829 treatise on machines. He recognized that only the component of force parallel to motion contributes to work.
The Work-Energy Theorem
The profound insight connecting work to energy came from understanding that work done on an object equals its change in kinetic energy:
This theorem bridges mechanics and thermodynamics, showing that work and energy are two sides of the same coin.
Units of Work
Work is measured in Joules (J) in SI units, where 1 J = 1 N·m = 1 kg·m²/s². In the imperial system, work is measured in foot-pounds (ft·lb).
Work with Constant Force
Let's start with the simple case. When a constant force moves an object from position to :
Geometrically, this is the area of a rectangle with height and width . We can also write this as an integral:
The integral reduces to the familiar formula when force is constant—but the integral form is more general and handles variable forces.
Example: Lifting a Box
Problem: A 5 kg box is lifted 3 meters straight up. How much work is done against gravity?
Solution: The force required equals the weight: N.
Or using integration: J.
Work with Variable Force
When force varies with position, we cannot simply multiply. Instead, we:
- Divide the path from to into small intervals of width
- On each interval, approximate force as constant:
- Compute the work on each piece:
- Sum all contributions:
- Take the limit as :
Work Done by a Variable Force
If a force acts on an object as it moves from to , the work done is:
Geometrically: Work = Area under the force-position curve
Interactive: Work as an Integral
Explore how work is calculated for different force functions. Adjust the bounds and see how the area under the curve (work) changes:
Force increases linearly with position (like a spring)
Work Done on Springs: Hooke's Law
One of the most important applications of work integrals involves springs.Hooke's Law states that the force required to stretch or compress a spring is proportional to the displacement:
where is the spring constant (N/m) and is displacement from natural length.
Deriving the Work Formula
To stretch a spring from its natural length (x = 0) to displacement :
Work to Stretch a Spring
This equals the elastic potential energy stored in the spring.
Geometric Interpretation
Since is linear, the graph is a straight line through the origin. The work is the area of the triangle under this line: Area = × base × height =.
Example: Stretching from One Position to Another
Problem: A spring with k = 200 N/m is stretched from x = 0.1 m to x = 0.3 m. Find the work done.
Solution: We integrate from 0.1 to 0.3 (not from 0):
Interactive: Spring Work Demo
Watch how work accumulates as a spring is stretched. Notice that the force grows linearly, and the work (area under the curve) is a triangle:
Work Lifting Variable Mass: Ropes and Chains
Consider lifting a heavy rope hanging over a cliff. As you pull, the amount of rope remaining decreases, so the weight you lift changes. This requires an integral.
Setup for Rope Problems
Let a rope of length hang from a cliff, with linear density kg/m.
- A segment of length at position from the bottom has mass
- This segment must be lifted a distance to reach the top
- Work to lift this segment:
Total work to pull up the entire rope:
Example: Pulling Up a Chain
Problem: A 10-meter chain weighing 3 kg/m hangs from a rooftop. How much work is done pulling it completely up?
Solution: Here m, kg/m, and m/s².
Note: This equals the work to lift the chain's center of mass (at L/2) by distance L/2, giving .
Work Pumping Fluids
Pumping water (or any fluid) from a tank is a classic work problem. The key insight is that water at different heights must be lifted different distances.
General Setup
Consider a tank with water filled to height . We want to pump all water to an outlet at height (where is the tank height and is how high the outlet is above the tank).
- Consider a thin horizontal slice of water at height with thickness
- The slice has cross-sectional area (depends on tank shape)
- Volume of slice:
- Mass of slice: where is fluid density
- Distance to lift:
- Work to lift slice:
Work to Pump Fluid from a Tank
where is the cross-sectional area at height y
Example: Cylindrical Tank
Problem: A cylindrical tank with radius 2 m and height 4 m is full of water (ρ = 1000 kg/m³). Find the work to pump all water to a spout 1 m above the top.
Solution: For a cylinder, (constant).
Interactive: Pumping Work Demo
Explore work calculations for different tank shapes. Watch the water level drop as you pump, and see how the work accumulates:
Constant cross-section
Connection to Energy
Work and energy are intimately connected through the Work-Energy Theorem and the concept of potential energy.
Work-Energy Theorem
The net work done on an object equals its change in kinetic energy:
Potential Energy
When work is done against a conservative force (like gravity or a spring), that work is stored as potential energy:
| Force Type | Potential Energy |
|---|---|
| Gravity (near Earth) | U = mgh |
| Spring (Hooke's Law) | U = ½kx² |
| Gravity (universal) | U = -GMm/r |
| Coulomb (electrostatic) | U = kq₁q₂/r |
The Energy-Work Connection
Work done by a force decreases its potential energy:. Work done against a force increases potential energy:.
Real-World Applications
Engineering: Elevators and Cranes
Elevator motors must do work against gravity. For a fully-loaded elevator car of mass traveling height , the minimum work is . Real systems account for counterweights, friction, and acceleration.
Physics: Escape Velocity
To escape Earth's gravity, an object must have enough kinetic energy to overcome the gravitational potential energy. This leads to:
Setting this equal to initial kinetic energy gives the escape velocity:.
Biology: Muscle Work
Muscles produce variable force depending on their length and activation. The work done during muscle contraction is the integral of force over the range of motion—critical for understanding athletic performance and biomechanical design.
Machine Learning Connection
The concepts of work and energy have direct analogs in optimization and machine learning.
Loss Functions as Potential Energy
In physics, systems naturally evolve to minimize potential energy. In machine learning, we minimize loss functions. The analogy is precise:
| Physics | Machine Learning |
|---|---|
| Potential energy U(x) | Loss function L(θ) |
| Force F = -∇U | Negative gradient -∇L |
| Equilibrium (F = 0) | Optimum (∇L = 0) |
| Work W = F · d | Loss change ΔL ≈ ∇L · Δθ |
| Energy conservation | Gradient descent dynamics |
Gradient Descent as Rolling Downhill
Gradient descent can be viewed as a ball rolling on a loss landscape, driven by the "force" of the negative gradient. Each parameter update does "work" on the system:
This shows that gradient descent always decreases the loss (for small enough learning rate )—just like a ball rolling downhill always decreases its potential energy.
The Work-Energy Theorem in ML
Just as the physics work-energy theorem relates work to kinetic energy change, in ML the "work" done by parameter updates () relates to the change in loss. This connection underlies momentum methods, learning rate schedules, and second-order optimization.
Python Implementation
Computing Work with Variable Forces
Here's how to calculate work using numerical integration in Python:
Work-Energy Concepts in Machine Learning
This code demonstrates the analogy between physics work-energy concepts and machine learning optimization:
Common Mistakes to Avoid
Mistake 1: Using W = Fd for Variable Forces
Wrong: If force varies, you cannot just multiply an average force by distance.
Correct: Set up and evaluate the integral .
Mistake 2: Wrong Distance in Pumping Problems
Wrong: Assuming all water travels the same distance.
Correct: Water at height y must travel distance to reach an outlet at height .
Mistake 3: Forgetting Cross-Section Varies
For non-cylindrical tanks (cones, hemispheres), the cross-sectional area changes with height. Include this in your integral!
Mistake 4: Confusing Force Direction
Work is positive when force and displacement are in the same direction. When lifting against gravity, you do positive work on the object (increasing its potential energy).
Test Your Understanding
A force F(x) = 3x² N acts on an object as it moves from x = 0 to x = 2 m. What is the work done?
Summary
Work is a fundamental concept connecting force, motion, and energy. When force varies with position, integration becomes essential.
Key Formulas
| Situation | Formula |
|---|---|
| Constant force | W = Fd |
| Variable force | W = ∫ₐᵇ F(x) dx |
| Spring (from natural length) | W = ½kx² |
| Rope/chain lift | W = ½gλL² |
| Pumping fluid | W = ∫ρgA(y)(H+d-y) dy |
Key Takeaways
- Work is accumulated force: When force varies, sums infinitely many infinitesimal contributions.
- Geometric meaning: Work equals the area under the force-displacement curve.
- Springs store energy: Work becomes elastic potential energy.
- Pumping problems: Each layer travels a different distance, requiring careful integral setup.
- ML connection: Loss functions act like potential energy; gradient descent minimizes this "energy."
Coming Next: In the next section on Hydrostatic Force and Pressure, we'll use integration to compute the total force exerted by fluids on submerged surfaces—another beautiful application of calculus to the physical world.