Where Exploration Meets Excellence
Jupiter Academy · Lesson

Work Done by a Variable Force

work done by a variable force
work done by a variable forceAI-generated representative image

Constant forces are the exception rather than the rule in the physical world. A spring stiffens as it stretches, gravity weakens with altitude, and the drag on a falling body grows with speed. Once the applied force changes from point to point, the elementary recipe ##W = F\,d## collapses, because there is no single value of ##F## to multiply by the displacement. The remedy is one of the most elegant ideas in mechanics: slice the motion into infinitesimal steps, treat the force as constant within each step, and add the contributions. That limiting sum is a definite integral, and it converts a bookkeeping problem into geometry — the work done becomes the area under the force–displacement curve.

A force-versus-position graph with a curved force line above the horizontal position axis, thin rectangles approximating the area beneath it, and the region from x_i to x_f shaded as the work done.
A variable force plotted against position, with the work done shown as the area under the curve between the start and end points.Programmatically generated contextual illustration.

This lesson develops that idea carefully, beginning with the rectangular-strip approximation and passing to the exact integral ##W = \int_{x_i}^{x_f} F(x)\,dx##. Two worked cases anchor the method: a force that decreases linearly with distance, mirroring the tired woman pushing a trunk across a railway platform, and a force that falls off as the inverse of position. Beyond the core derivation, the discussion widens to force fields, the one-dimensional line integral and its three-dimensional generalisation, sinusoidal and quadratic forces, the sign conventions that make negative work meaningful, and the persistent error of replacing a varying force with its average.

Because this lesson sits between the work–energy theorem for constant forces and its general proof, the treatment is deliberately staged. Everything here prepares the ground for showing that ##K_f - K_i = W## survives when the force varies, a result whose derivation belongs to the next lesson. Learners at senior secondary or introductory undergraduate level will find the mathematics familiar — integration is the only new tool — but the physical reasoning about paths, signs and areas is where genuine understanding is built.

From Rectangles to Integrals: The Logic of Variable Work

The starting point is a graph. Plot the force component along the direction of motion against position, and the curve tells you everything the force does. Over a tiny displacement ##\Delta x##, the force barely changes, so the work contributed is approximately ##\Delta W = F(x)\,\Delta x## — the area of a thin rectangle of height ##F(x)## and width ##\Delta x##. Stacking successive rectangles from ##x_i## to ##x_f## gives the total work as the sum ##W \simeq \sum_{x_i}^{x_f} F(x)\,\Delta x##, an approximation that improves as the strips narrow.

A decreasing force curve above the position axis with several narrow rectangular strips drawn beneath it, showing that summing strip areas approximates the work done.
The area under the force–position curve is sliced into thin rectangles whose heights are the local force, and their total approaches the work as the strips narrow.Programmatically generated contextual illustration.

Letting ##\Delta x \to 0## turns the sum into a definite integral, and the staircase of rectangles into the smooth region beneath the curve. The exact statement is

###W = \lim_{\Delta x \to 0} \sum_{x_i}^{x_f} F(x)\,\Delta x = \int_{x_i}^{x_f} F(x)\,dx###

This is the central formula of the lesson. It says that work is a signed area: regions above the position axis count positively, regions below count negatively. The integral also handles the awkward case where the force reverses direction mid-path, because the sign of ##F(x)## is carried inside the integrand rather than patched on afterwards.

Reading the Force–Displacement Graph

A force–displacement graph is a compact physical document. Its height at any point gives the instantaneous force, its slope indicates how rapidly the force is changing, and the area between the curve and the axis gives the work. When the curve crosses the axis, the force momentarily vanishes and then reverses, so the work accumulated beyond that crossing subtracts from what came before. Recognising these features lets a student estimate work qualitatively before writing a single integral, which is a powerful check on any algebraic answer.

An annotated force–displacement graph with a curve above the axis and a curve below it, labelled height equals force, slope equals rate of change, area above axis is positive work and area below axis is negative work.
Height gives the force, slope gives how fast the force changes, and the signed area between the curve and the axis gives the work.Programmatically generated contextual illustration.

Consider a force that is constant at 100 N for the first 10 m and then declines linearly to 50 N over the next 10 m. The graph is a rectangle followed by a trapezium. The rectangle contributes ##100 \times 10 = 1000\ \text{J}##; the trapezium contributes ##\tfrac{1}{2}(100 + 50)\times 10 = 750\ \text{J}##. The total work is 1750 J, obtained entirely by geometry, with no calculus required because the pieces are simple shapes.

Why the Average Force Is a Trap

A tempting shortcut is to compute the average force and multiply by the total displacement. For the example above, the arithmetic mean of the two segments is not the correct average, and even the properly weighted mean fails in general. The mean-value theorem for integrals guarantees some value ##\bar{F}## for which ##W = \bar{F}(x_f - x_i)##, but that value depends on the shape of the curve and is rarely the simple arithmetic average. For a linearly varying force the average is the midpoint value, which happens to work; for a quadratic or sinusoidal force it does not.

A straight declining force line from 100 N to 50 N over 20 m with a horizontal line at the arithmetic mean of 75 N, showing the mean line lies above the curve over part of the path and misstates the work.
For a force falling linearly from 100 N to 50 N, the arithmetic mean of the endpoint values overestimates the true area-average, so multiplying it by the displacement gives too much work.Programmatically generated contextual illustration.

The error matters because it silently corrupts energy budgets. A spring stretched from 0 to ##x## exerts a force ##kx## that ranges from zero to ##kx##; the arithmetic average is ##kx/2##, and multiplying by ##x## gives ##\tfrac{1}{2}kx^2##, which is correct only by coincidence of linearity. Replace the spring law with ##F = kx^2## and the same shortcut yields ##\tfrac{1}{2}kx^3## instead of the true ##\tfrac{1}{3}kx^3## — a fifty per cent overestimate that no amount of careful arithmetic can repair.

Reference Card

Force Laws and Their Work Integrals

Standard variable-force profiles and the work each performs between ##x_i## and ##x_f##.

Force Law Work Integral
Constant ##F## ##F(x_f - x_i)##
Linear ##F = kx## ##\tfrac{1}{2}k(x_f^2 - x_i^2)##
Quadratic ##F = kx^2## ##\tfrac{1}{3}k(x_f^3 - x_i^3)##
Inverse ##F = k/x## ##k\ln(x_f/x_i)##
Sinusoidal ##F = F_0\sin(bx)## ##\tfrac{F_0}{b}[\cos(bx_i) - \cos(bx_f)]##
Note:
  • All integrals assume the force acts along the displacement direction.
  • Signs follow the integrand: a force opposing motion yields negative work.

Worked Example: A Linearly Decreasing Force

The reference scenario is worth reconstructing in full because it combines two forces acting simultaneously. A woman pushes a trunk across a rough railway platform, applying 100 N over the first 10 m. She then tires, and her applied force falls linearly with distance until it reaches 50 N at the 20 m mark. Friction, meanwhile, is a constant 50 N directed opposite to the motion. The task is to find the work done by each force over the full twenty metres and to interpret the result physically.

A trunk on a horizontal platform with the applied force falling from 100 N to 50 N over 20 m and a constant 50 N friction force pointing backward.
Situation of the problem: a woman pushes a trunk across a rough platform with a force that weakens after 10 m while friction stays constant.Programmatically generated contextual illustration.

The applied force traces a rectangle of height 100 N and width 10 m, followed by a trapezium whose parallel sides are 100 N and 50 N with a width of 10 m. The rectangle gives 1000 J and the trapezium gives ##\tfrac{1}{2}(100 + 50)\times 10 = 750\ \text{J}##, so the woman does 1750 J of positive work. Friction, acting at ##-50\ \text{N}## across the whole 20 m, does ##(-50)\times 20 = -1000\ \text{J}##. The net work is therefore 750 J, which by the work–energy theorem appears as kinetic energy of the trunk.

Setting Up the Integral Formally

The same answer follows from integration, and doing it formally builds the habit needed for less friendly force laws. For ##0 \le x \le 10##, ##F = 100\ \text{N}##, so the integral is simply ##100 \times 10##. For ##10 < x \le 20##, the force obeys ##F(x) = 100 - 5(x - 10)##, since it drops 50 N over 10 m, giving a slope of ##-5\ \text{N\,m}^{-1}##. Integrating this linear expression from 10 to 20 reproduces the trapezium area of 750 J, confirming that the geometric and calculus routes agree.

Writing the full computation as a single expression makes the structure transparent:

###W_F = \int_{0}^{10} 100\,dx + \int_{10}^{20} \bigl[100 - 5(x-10)\bigr]dx = 1000 + 750 = 1750\ \text{J}###

Notice that the force at ##x = 20\ \text{m}## is 50 N, not zero. The woman has not stopped pushing; she has merely weakened. Students often assume a linearly decreasing force must reach zero at the end of the motion, and that assumption distorts the trapezium into a triangle, producing 500 J instead of 750 J for the second segment. Reading the problem statement carefully prevents this.

Interpreting the Negative Work of Friction

Friction's contribution is negative because the force points opposite to the displacement. The area representing frictional work lies below the position axis, and the integral automatically assigns it a minus sign through the negative value of ##F(x)##. This is not a bookkeeping convention but a physical statement: friction removes mechanical energy from the trunk, converting it into thermal energy at the contact surface. The magnitude, 1000 J, quantifies that transfer.

The net work of 750 J is what remains available to accelerate the trunk. If the trunk started from rest, its final kinetic energy would be 750 J, and its final speed would follow from ##\tfrac{1}{2}mv_f^2 = 750##. This is precisely the work–energy theorem at work, and it holds even though one of the forces varied with position — a point the next lesson will prove rigorously rather than assume.

Worked Example: A Force Inversely Proportional to Position

Not every variable force is linear, and the inverse law ##F(x) = k/x## is the standard second example because its integral introduces a logarithm. Suppose a force of this form acts along the positive ##x##-axis with ##k = 200\ \text{N\,m}##, and the object moves from ##x_i = 2\ \text{m}## to ##x_f = 8\ \text{m}##. The work done is the definite integral of ##k/x## over that interval, which evaluates to ##k\ln(x_f/x_i)##. Substituting the numbers gives ##200\ln 4 \approx 200 \times 1.386 \approx 277\ \text{J}##.

A decreasing curve F = k/x above the x-axis with the interval from 2 m to 8 m shaded and the force values marked.
Situation of the problem: an object moves along the x-axis under a force that falls off as k/x.Programmatically generated contextual illustration.

The logarithmic dependence carries a physical message. Equal successive doublings of distance contribute equal amounts of work, so moving from 2 m to 4 m does the same work as moving from 4 m to 8 m, namely ##200\ln 2 \approx 139\ \text{J}## each. The force weakens, but the path lengthens in exactly compensating proportion. This behaviour appears in gravitational and electrostatic contexts, where the ##1/r^2## force produces a ##1/r## potential, and the logarithmic case arises for line charges and long cylinders.

Handling the Singularity at the Origin

The function ##k/x## diverges as ##x \to 0##, so an integral starting at the origin is improper and may fail to converge. Physically, no real force grows without bound, and the inverse law is only an approximation valid over a restricted range. When setting up such problems, always check that the interval of integration lies strictly away from the singularity. If it does not, the model has broken down and a different force law must be used near the origin.

For the interval from 2 m to 8 m there is no difficulty, and the logarithm is well behaved. The lesson for problem solvers is to inspect the integrand before integrating: a quick sketch of ##F(x)## reveals divergences, zeros and sign changes that determine whether the integral is straightforward, improper, or physically meaningless. This preliminary scan is the single most effective defence against wasted algebra.

Additional Cases: Quadratic and Sinusoidal Forces

A force ##F = kx^2## with ##k = 3\ \text{N\,m}^{-2}## acting from ##x = 0## to ##x = 2\ \text{m}## does work ##\int_0^2 3x^2\,dx = [x^3]_0^2 = 8\ \text{J}##. The arithmetic-average shortcut would have given ##\tfrac{1}{2}(0 + 12)\times 2 = 12\ \text{J}##, a fifty per cent error, because the parabola bulges below its chord. The exact answer is smaller than the average-force estimate whenever the force curve is concave upward, and larger when it is concave downward — a useful qualitative rule.

An upward-curving parabola F = kx² from the origin to x = 2 m with the area beneath it shaded.
Situation of the problem: a quadratic force acts from the origin to x = 2 m.Programmatically generated contextual illustration.

A sinusoidal force ##F = F_0\sin(bx)## behaves differently again. Over a full period the positive and negative lobes cancel exactly, so the net work is zero even though the force has been busy throughout. Over a half-period, the work is ##2F_0/b##, a finite positive quantity. This cancellation is the mathematical origin of the statement that conservative forces do no net work around a closed loop, a theme that dominates the study of potential energy later in the course.

Worked Data

Work Computations for Three Force Laws

Exact integrals compared with the naive average-force estimate.

Case Exact Work
##F = 3x^2##, ##0 \to 2\ \text{m}## 8 J (average estimate: 12 J)
##F = 200/x##, ##2 \to 8\ \text{m}## 277 J
##F = F_0\sin(bx)##, full period 0 J (lobes cancel)
Note:
  • The average-force estimate overstates work for concave-up force curves.
  • Zero net work over a closed path signals a conservative force.

Force Fields, Paths and the Line Integral

A force field assigns a force vector to every point in space. Gravity, electrostatics and fluid drag are all fields, and the work done on a particle moving through a field depends on the path taken as well as the endpoints. In one dimension the path is forced — the particle can only move forward or backward along the axis — so the line integral reduces to the ordinary definite integral already derived. The general definition, ##W = \int \vec{F}\cdot d\vec{r}##, is the natural extension, and the dot product ensures that only the component of force along the displacement contributes.

In three dimensions the integral becomes a sum of three one-dimensional integrals, one per coordinate, each weighted by the corresponding component of force. For a path parameterised by time, ##d\vec{r} = \vec{v}\,dt##, and the work becomes ##\int \vec{F}\cdot\vec{v}\,dt##, which is the integral of instantaneous power over time. This equivalence between the spatial and temporal formulations is a recurring theme: work is the accumulation of power, just as displacement is the accumulation of velocity.

Path Dependence and Conservative Forces

For some fields the work depends only on the endpoints, not the route. These are conservative fields, and they admit a potential energy function whose difference equals the negative of the work done. Gravity and the ideal spring are the canonical examples. For other fields — friction, air resistance, viscous drag — the work depends on the path length, and no potential energy can be defined. Recognising which category a force belongs to determines whether energy methods can be used or whether the full integral must be evaluated.

The one-dimensional integral conceals this distinction because there is only one path between two points on a line. The distinction becomes visible only in two or three dimensions, where a particle can wander. A useful test is to compute the work around a closed loop: if it vanishes for every loop, the force is conservative. The sinusoidal force examined earlier passes this test over a full period, which is why it can be associated with a periodic potential.

Sign Conventions and Negative Work

Work is negative whenever the force has a component opposite to the displacement. The integral handles this automatically: if ##F(x)## is negative over a stretch where ##dx## is positive, the contribution is negative. Friction on the sliding trunk is the clearest illustration, contributing ##-1000\ \text{J}## while the woman contributes ##+1750\ \text{J}##. The net work, 750 J, is the algebraic sum, and it is this net value that enters the work–energy theorem.

Students sometimes try to force all work to be positive by taking magnitudes. This destroys the energy accounting. A negative work term represents energy leaving the mechanical system, usually as heat or sound, and omitting the sign produces a spurious energy surplus. The discipline of keeping signs inside the integrand, rather than fixing them afterwards, is the reliable habit.

Sign Guide

Signs of Work in Common Situations

How the integrand's sign translates into energy transfer.

Situation Sign of Work
Force along displacement Positive
Friction opposing sliding Negative
Normal force on a level floor Zero
Spring restoring force during stretch Negative
Note:
  • Zero work does not mean zero force; it means perpendicularity.
  • Negative work removes mechanical energy from the system.

Springs, Energy Storage and the Work–Energy Theorem

The ideal spring is the archetype of a variable force. Hooke's law states ##F = -kx##, where the minus sign records that the force always opposes the extension. To stretch the spring from 0 to ##x##, an external agent must apply ##+kx##, and the work done by that agent is ##\int_0^x kx'\,dx' = \tfrac{1}{2}kx^2##. This quantity is stored as elastic potential energy and is recovered when the spring is released. The spring force itself does negative work during the stretch, equal in magnitude and opposite in sign.

The spring example also exposes a subtlety about reference points. The integral ##\int_{x_i}^{x_f} kx\,dx = \tfrac{1}{2}k(x_f^2 - x_i^2)## depends only on the endpoints, confirming that the spring force is conservative. Choosing ##x_i = 0## as the natural reference makes the stored energy ##\tfrac{1}{2}kx^2##, but any other reference is equally valid provided it is used consistently. The physics lies in differences of potential energy, never in the absolute value at a single point.

Extending the Theorem to Variable Forces

The work–energy theorem states that the net work done on a particle equals its change in kinetic energy. For a variable force, the proof begins with Newton's second law written as ##F = m\,dv/dt## and uses the chain rule to convert the time derivative into a spatial one: ##m\,dv/dt = mv\,dv/dx##. Integrating both sides with respect to ##x## gives ##\int F\,dx = \int mv\,dv = \tfrac{1}{2}mv_f^2 - \tfrac{1}{2}mv_i^2##, which is exactly ##W = K_f - K_i##.

This derivation is the bridge to the next lesson, where it is presented in full. The essential point for now is that nothing in the argument requires the force to be constant; the integral absorbs the variation. The theorem is therefore an integral form of Newton's second law, trading instantaneous detail for a statement about the cumulative effect of a force over a displacement. That trade is what makes energy methods so powerful in problems where the force law is complicated but the endpoints are known.

Common Pitfalls and How to Avoid Them

The most frequent error is the average-force shortcut, already illustrated with the quadratic law. A second is forgetting that the area below the axis is negative, which leads to adding frictional work instead of subtracting it. A third is misreading the limits of integration, particularly when the force changes form partway along the path, as in the trunk problem where the applied force switches from constant to linear at ##x = 10\ \text{m}##. Each segment needs its own integral.

A fourth pitfall is treating the work done by the applied force and the work done by the net force as interchangeable. They are not. The woman does 1750 J, friction does ##-1000\ \text{J}##, and only the net 750 J changes the trunk's kinetic energy. Confusing the two produces energy statements that violate conservation. A fifth is neglecting units: force in newtons, displacement in metres, work in joules, and the slope of a force–displacement graph in ##\text{N\,m}^{-1}##.

Error Audit

Diagnostic Checklist for Variable-Force Problems

Frequent mistakes and the corrective habit for each.

Mistake Correction
Using average force times displacement Integrate the actual force law
Dropping the sign of opposing work Keep signs inside the integrand
One integral across a piecewise force Split at each change of form
Confusing applied and net work Sum all forces before applying the theorem
Note:
  • Sketch the force curve before integrating.
  • Check units at every stage of the calculation.

Computational Practice and Real-World Contexts

Numerical integration is the practical fallback when a force law has no elementary antiderivative. The trapezoidal rule approximates the area under ##F(x)## by summing trapezium areas between sample points, and its accuracy improves as the spacing shrinks. The following Python snippet evaluates the work done by the inverse force ##F = k/x## between two limits, comparing the exact logarithmic result with a numerical estimate. Running it with different step counts shows the convergence directly.

A line plot of estimated work in joules against number of strips on a logarithmic scale, rising steeply at first and flattening toward a horizontal line at 277 J.
As the number of trapezoidal strips increases, the numerical estimate of the work settles toward the exact value of 277 J.Programmatically generated contextual illustration.

import math

def work_inverse(k, xi, xf, n=1000):
    dx = (xf - xi) / n
    total = 0.0
    for i in range(n):
        x_left = xi + i * dx
        x_right = x_left + dx
        f_left = k / x_left
        f_right = k / x_right
        total += 0.5 * (f_left + f_right) * dx
    return total

k = 200.0
exact = k * math.log(8.0 / 2.0)
approx = work_inverse(k, 2.0, 8.0, n=10000)
print(f"Exact: {exact:.3f} J")
print(f"Numerical: {approx:.3f} J")

The output confirms that the numerical estimate converges to 277 J as the step count rises. This is the same limiting process that defines the integral, executed by a machine rather than by hand. In engineering practice, force–displacement data from sensors is almost always integrated numerically, and the trapezoidal rule is the standard first tool. Understanding the underlying limit makes the numerical result trustworthy rather than mysterious.

Where Variable Work Appears in Engineering

Vehicle braking is a variable-force problem: the braking force grows with pedal pressure and with speed-dependent friction, so the stopping distance follows from integrating the deceleration over the path. Wind turbines extract energy from a fluid whose force on the blades varies with wind speed and blade angle, and the annual energy yield is an integral over the wind-speed distribution. Even the compression of a gas in a cylinder is a variable-force process, with the work given by ##\int P\,dV## rather than ##\int F\,dx##.

These contexts share a common structure: a force that changes with position, a path along which it acts, and a need to accumulate the contributions. The mathematics developed here transfers directly. Recognising the pattern is more valuable than memorising any single formula, because the same integral appears under many different physical names — work, energy yield, pressure–volume work, and electrical energy dissipation among them.

Preparing for the General Proof

The next lesson takes the result sketched here and proves it rigorously for an arbitrary variable force. The key step is the chain-rule manipulation ##F = m\,dv/dt = mv\,dv/dx##, followed by integration over position. The present lesson has supplied the integral machinery and the physical intuition; the next supplies the formal theorem and its consequences. Together they complete the bridge from Newton's second law to the energy methods that dominate the rest of the course.

Before moving on, consolidate the essentials: work is the area under the force–displacement curve, computed exactly by ##W = \int_{x_i}^{x_f} F(x)\,dx##; the sign of the integrand carries the sign of the work; piecewise forces require piecewise integrals; and the average-force shortcut is valid only for linear force laws. With these in hand, the general theorem will read as a natural consequence rather than a new idea.

Course Map

Lesson Roadmap: Variable Force Work

How this lesson connects to its neighbours in the sequence.

Lesson Focus
Lesson 4 Kinetic energy and the work–energy theorem
Lesson 5 (this) Work done by a variable force
Lesson 6 Work–energy theorem for a variable force
Note:
  • Lesson 5 supplies the integral; Lesson 6 supplies the proof.
  • Review Lesson 4 before attempting the general theorem.

RESOURCES