Learning Objectives
By the end of this section, you will be able to:
- Derive and apply the work integral for forces that vary with position
- Calculate gravitational work at large distances where the constant-g approximation fails
- Apply Coulomb's law to compute electrical work moving charged particles
- Analyze velocity-dependent forces such as air resistance and fluid drag
- Connect work to potential energy for conservative force fields
- Recognize the deep analogy between physical work and optimization in machine learning
The Big Picture: When Forces Aren't Constant
"In the real physical world, forces almost always vary—with position, velocity, time, or configuration. The integral is our tool for handling this complexity."
In introductory physics, we often treat forces as constant: the weight of an object near Earth's surface, the tension in a rope, the normal force from a floor. This simplification lets us use . But nature rarely offers such simplicity.
Consider these real-world scenarios where force varies:
| Physical System | Force Variation | Mathematical Form |
|---|---|---|
| Gravity at altitude | Weakens with distance | F = GMm/r² |
| Electric charges | Inverse square law | F = kq₁q₂/r² |
| Springs | Proportional to stretch | F = kx |
| Air resistance | Depends on velocity | F = ½ρC_dAv² |
| Magnetic force | Varies with position | F = qv × B(r) |
| Molecular bonds | Complex potential | F = -dU/dr |
In every case, the elementary formula fails because changes throughout the motion. We must integrate to account for how force varies along the path.
The Essential Insight
When force varies with position, work becomes an integral: . This computes the accumulated effect of a continuously changing force—the sum of infinitely many infinitesimal contributions .
Historical Development: From Newton to Modern Physics
The concept of work as we understand it today emerged from the interplay of mechanics, thermodynamics, and calculus in the 17th-19th centuries.
Newton and the Inverse Square Law (1687)
Isaac Newton's Principia Mathematica established that gravitational force follows an inverse square law: . This immediately raised the question: how much work is required to move an object from one distance to another in such a field?
Newton himself developed the tools (calculus) needed to answer this question, showing that:
Coulomb and Electrical Forces (1785)
Charles-Augustin de Coulomb demonstrated that electrical forces also follow an inverse square law: . This meant the same mathematical machinery developed for gravity applied directly to electrostatics.
The Energy Revolution (1840s-1850s)
James Joule, Hermann von Helmholtz, and others established the conservation of energy, showing that work done against a force is stored as potential energy. This profound insight—that for conservative forces—unified mechanics with thermodynamics.
Why This History Matters
Understanding that arose from studying real physical systems (planetary motion, electric charges) helps us appreciate why calculus is the language of physics. The integral isn't an abstract mathematical construct—it's the precise tool needed to describe how nature accumulates effects.
The Work Integral: Mathematical Foundation
Let's establish the work integral rigorously. Consider a force acting on an object as it moves along the x-axis from position to .
Derivation from First Principles
- Partition the path: Divide into small intervals of width
- Approximate force as constant on each interval: On the -th interval, take as the force value
- Compute work on each piece:
- Sum all contributions:
- Take the limit: As , the Riemann sum becomes a definite integral
The Work Integral
Work equals the definite integral of force over the path of motion
Geometric Interpretation
The work integral has a beautiful geometric meaning: work equals the signed area under the force-position curve.
- When and motion is in the positive direction: positive work (force assists motion)
- When and motion is in the positive direction: negative work (force opposes motion)
Gravitational Work at Large Distances
Near Earth's surface, we approximate gravity as constant: with m/s². But for space missions, satellites, and planetary science, we must use Newton's Law of Universal Gravitation:
where is the gravitational constant, is the planet's mass, is the object's mass, and is the distance from the planet's center
Work to Reach Altitude h
To lift an object from the surface (radius ) to altitude above the surface:
Comparison with W = mgh
For small altitudes (), we can show that this reduces to . But for or larger, the full integral is necessary. The approximation overestimates work by increasingly large amounts as altitude grows.
Escape Velocity Derivation
A fascinating application: what velocity is needed to escape a planet's gravity entirely? We need enough kinetic energy to do work against gravity from to :
Setting :
For Earth, this gives km/s—the speed required to leave Earth's gravitational influence without further propulsion.
Interactive: Gravitational Work
Explore how gravitational work varies with altitude. Notice how the constant-g approximation increasingly fails at higher altitudes:
Gravitational Work Visualizer
Calculations:
Electromagnetic Work
Electric forces between charged particles follow Coulomb's Law:
where N·m²/C² is Coulomb's constant
The key difference from gravity: sign matters. Unlike mass (always positive), charge can be positive or negative, leading to both attractive and repulsive forces.
Work Moving a Charge
To move charge from distance to from fixed charge :
Interpretation by charge signs:
| Charges | Force | Moving Apart | Moving Together |
|---|---|---|---|
| Same sign (+/+ or -/-) | Repulsive | W > 0 (field helps) | W < 0 (work against) |
| Opposite sign (+/-) | Attractive | W < 0 (work against) | W > 0 (field helps) |
Interactive: Coulomb Force Work
Experiment with different charge configurations and see how the work depends on both the charges and the path:
Coulomb Force Work Visualizer
Results:
Variable Friction and Drag Forces
Many real-world forces depend on velocity rather than (or in addition to) position. The most important example is fluid drag:
where = fluid density, = drag coefficient, = frontal area, = velocity
Why v² Matters
The dependence has profound implications:
- Doubling speed quadruples the drag force
- Power required to overcome drag scales as
- Fuel efficiency at highway speeds is dominated by aerodynamic drag
- Terminal velocity occurs when drag equals weight:
Work Against Drag at Constant Velocity
If an object moves at constant velocity for distance :
This is the energy that must be supplied (e.g., by an engine) to maintain constant speed against air resistance.
Interactive: Drag Force Work
See how drag force and the work required scale with velocity, drag coefficient, and distance:
Drag Force Work Visualizer
Results:
Work and Potential Energy
For certain special forces—conservative forces—the work done depends only on the starting and ending positions, not on the path taken. This leads to the concept of potential energy.
Conservative Forces
A force is conservative if:
- Work done around any closed path is zero:
- Work depends only on endpoints, not the path between them
- The force can be written as the gradient of a scalar potential:
Examples of conservative forces:
| Force | Potential Energy U(r) |
|---|---|
| Gravity (near surface) | U = mgh |
| Gravity (universal) | U = -GMm/r |
| Coulomb (electrostatic) | U = kq₁q₂/r |
| Spring (Hooke’s law) | U = ½kx² |
The Work-Energy Connection
For conservative forces:
Work done BY the force equals the DECREASE in potential energy
This is incredibly powerful: instead of computing an integral, we can simply evaluate the potential at the endpoints. The integral is "already done" when we define .
Non-Conservative Forces
Friction and drag are not conservative. Work done against them depends on the path length, not just endpoints. Energy "lost" to friction becomes thermal energy—it dissipates into the environment rather than being stored as potential energy.
Machine Learning Connection: Optimization as Physics
There is a profound and beautiful analogy between physical work and machine learning optimization that goes far beyond metaphor.
The Loss-Energy Correspondence
| Physics Concept | Machine Learning Analog |
|---|---|
| Position x | Parameters θ |
| Potential energy U(x) | Loss function L(θ) |
| Force F = -∇U | Negative gradient -∇L |
| Work W = ∫F·dx | Cumulative loss decrease |
| Equilibrium (F = 0) | Optimum (∇L = 0) |
| Rolling downhill | Gradient descent |
| Momentum | Momentum optimizer |
| Friction/damping | Learning rate decay |
This isn't just an analogy—modern optimizers like SGD with momentum literally implement the physics equations of motion in parameter space!
Gradient Descent as Energy Minimization
Each gradient descent step moves parameters "downhill" on the loss landscape:
The "work" done in one step is:
This guarantees loss decreases (for small enough )—just like a ball always rolls downhill!
Why This Matters
Understanding optimization as physics helps us:
- Intuit why momentum helps escape shallow local minima (physical inertia)
- Understand why learning rate schedules work (controlled cooling, like simulated annealing)
- Design better optimizers using physics principles
- Debug training by visualizing "energy landscapes"
Python Implementation
Gravitational Work Analysis
This code compares exact gravitational work calculations with the constant-g approximation:
Electromagnetic Work
Calculate work for various electrostatic scenarios:
Optimization as Physical Work
Explore the deep connection between ML optimization and physical work:
Engineering Applications
Aerospace Engineering
Calculating the energy (and fuel) required for orbital maneuvers requires precise gravitational work calculations:
- Hohmann transfers: Moving between circular orbits requires work against varying gravitational force
- Delta-v budgets: Mission planning relies on work integrals to compute velocity changes
- Atmospheric entry: Drag work converts kinetic energy to heat during reentry
Electrical Engineering
- Particle accelerators: Work done on charged particles by electric fields
- Electrostatic motors: Work done rotating charged components in electric fields
- Capacitor energy: comes from integrating work to move charge
Automotive Engineering
- Fuel efficiency: Work against drag dominates at highway speeds
- Regenerative braking: Recapturing kinetic energy by doing negative work
- Suspension design: Spring work during compression and extension
Common Mistakes to Avoid
Mistake 1: Using W = mgh at Large Distances
Wrong: Using for satellite orbits or space missions.
Correct: Use when altitude is comparable to Earth's radius.
Mistake 2: Forgetting Sign Conventions
Wrong: Confusing work done BY a force with work done AGAINST a force.
Correct: Work by the field: . Work against the field: .
Mistake 3: Ignoring Velocity Dependence
Wrong: Treating drag as constant when velocity changes.
Correct: If velocity varies, you must integrate accounting for how changes with position.
Mistake 4: Assuming All Forces Are Conservative
Wrong: Trying to define potential energy for friction or drag.
Correct: Non-conservative forces (friction, drag) dissipate energy. Work against them depends on path length, not just endpoints.
Summary
Work done by variable forces requires integration—the fundamental tool for accumulating continuously varying contributions. This concept underlies much of physics and engineering.
Key Formulas
| Situation | Work Formula |
|---|---|
| General variable force | W = ∫ F(x) dx |
| Gravitational (inverse square) | W = GMm(1/r₁ - 1/r₂) |
| Coulomb (electrostatic) | W = kq₁q₂(1/r₁ - 1/r₂) |
| Drag at constant v | W = ½ρC_dAv²d |
| Conservative force | W = -ΔU = U(r₁) - U(r₂) |
Key Insights
- Integration handles variation: When force changes with position, we break the path into infinitesimal pieces and sum.
- Inverse square laws: Gravity and electrostatics share the same mathematical structure, leading to similar work formulas.
- Velocity-dependent forces: Drag scales as , making high speeds disproportionately expensive.
- Conservative forces: For gravity, springs, and electrostatics, work equals potential energy change.
- Physics-ML connection: Optimization is "rolling downhill" on a loss landscape—the same math describes both.
Next: In the following section on Fluid Dynamics: Flow Rate, we'll apply integration to understand how fluids move through pipes and channels—another beautiful application of calculus to the physical world.