Work done by a variable force
A hand stretching a spring feels the pull grow stronger with every centimetre — the force is not the same throughout the motion. The formula from constant-force work quietly assumes never changes, so it simply cannot answer "how much work did I do stretching this spring by 15 cm?" Physics fixes this by chopping the displacement into infinitesimally small steps, treating the force as constant over each sliver, and adding up (integrating) the tiny bits of work. The same idea has a picture: plotting force against position turns work into the area under the curve, so even a spring's straight-line force graph gives its work as the area of a simple triangle. This article builds the integral definition of variable-force work, connects it to the force-displacement (F-S) graph, and applies both routes — calculus and geometry — to a linear force and to a stretching spring, checking that they agree.
When force varies with position, work is found not from but from the integral , which equals the area under the force-displacement graph.
The core idea
Why the constant-force formula breaks down. treats as a single fixed number multiplying the whole displacement. The moment depends on position — a spring's tension, a rocket's thrust, air drag on a falling body — that formula has nothing to multiply by, because there is no single "the force" for the whole journey.
Slicing the motion. The fix is to break the total displacement into infinitesimally small steps , so small that over each one the force is essentially unchanged. The work done in one such tiny step is:
where: is the infinitesimal work in one slice, is the force during that slice (treated as constant), and is the tiny displacement vector of the slice. Adding up every slice between the starting position and the final position gives the total work as an integral:
For straight-line motion where the force component along the motion is a function of position , this becomes the one-dimensional form used throughout this topic:
where: is the force as a function of position, and , are the initial and final positions. This is exactly what integration means physically here — summing infinitely many "force times tiny displacement" contributions.
The graphical shortcut. Plot on the vertical axis against displacement on the horizontal axis. Because is literally the definite integral of the F-S curve, the work done between two positions is the area under the graph between them, above the S-axis counting as positive work and any area below the axis (negative ) counting as negative work. This matters practically: for graphs made of straight-line segments — as with a spring's tension — the area is often just elementary geometry (a triangle or trapezium), no calculus required.
The spring case. For a spring stretched by from its natural length, Hooke's law gives the restoring force needed as , where is the spring constant. This is a straight line through the origin on the F-S graph, so the work done in stretching from to is the area of a right triangle — leading directly to the elastic potential energy result , worked out below.
The goal is to find the work done in stretching a spring of force constant from its natural length to an extension , using the fact that the applied force must grow in step with the extension, and to show that the calculus route () and the geometric route (area of a triangle on the F-S graph) give the identical answer, confirming why the work is half, not all, of the final-force-times-extension product that a careless reading of would suggest.
Step 1. Write the variable force. By Hooke's law, to hold the spring stretched by an amount (a running variable between and the final extension ) requires a force , growing linearly from zero at to at .
Step 2. Integrate to get the work. . The factor of one-half appears because the force was not constant at its final value throughout — it started at zero.
Step 3. Confirm with the area under the graph. On the F-S graph, is a straight line through the origin ending at the point . The region under it, from to , is a right triangle with base and height , so its area is — identical to Step 2.
Step 4. State the result. is the work done in stretching (or compressing) a spring by from its natural length; it is not because the force is only at the very end of the stretch, averaging to over the whole motion.
Worked example
The force acting on a body moving along the x-axis varies as , with in metres. Find the work done as the body moves from to , and confirm the answer using the F-S graph.
Step 1. Set up the integral. Since varies linearly with , .
Step 2. Evaluate. .
Step 3. Check with the graph. is linear, so the F-S graph is a straight line from at to at . This region is a trapezium, with area . Both routes agree: .
Competitive stretch
A spring of force constant is stretched from its natural length by . Using the spring result derived above, . Equivalently, the triangular area on the F-S graph has base and height , giving — the same 2.25 J.
Common traps
- Using directly when depends on position — this constant-force formula is only valid when does not change over the displacement; a varying force needs or the area-under-graph method.
- Using the wrong limits of integration, especially when motion does not start at ; the limits must be the actual initial and final positions, not and the extension by default.
- Reading the F-S graph as if the work equals the force value at some point — it is the area between the curve and the x-axis over the interval, not a single ordinate, and area below the axis represents negative work.
- Writing a spring's stretching work as instead of — this ignores that the force grows from zero, so its average over the stretch is , not .
Ask the tutor: Want a few extra F(x) integration or spring-stretching problems to practise the calculus-versus-geometry check?
Why is the work done stretching a spring half of the final force times the extension, and not just Fx?
Because the force is not constant during the stretch — it starts at zero when the spring is at its natural length and grows to only at the final extension. The work is the area under the F-S line, which is a triangle, not a rectangle. A rectangle of height and width would give , but that assumes the full force acted throughout the motion, which it did not. The triangle's area, , correctly uses the average force over the stretch.
When can I just use the area-under-graph method instead of integrating?
Whenever the F-S graph is made of straight-line segments — a linear force like a spring's, or a force given piecewise as straight lines — the area is a triangle, rectangle, or trapezium, and elementary geometry gives the exact answer with no calculus needed. If the graph is curved (for example varying as or some other nonlinear function), you either integrate directly or estimate the area under the curve (for instance by counting grid squares), since simple geometric shapes will not fit it exactly.
How do I know which limits to use when the motion does not start at x equals zero?
The limits of the integral (or the endpoints of the region whose area you take) must always be the actual starting and ending positions of the body, not and the total distance moved by default. If a body moves from to under a force , the work is , evaluated using those exact limits — plugging in and (the displacement) instead would silently compute the work over the wrong stretch of the force function.