Physics Library
 An open source physics library
Encyclopedia | Forums | Docs | Random |  
Work by Variable Forces (Topic)

Work by Variable Forces

For a constant force, M03-01 established the familiar result

W   = F ⋅ Δr.
(1)

That formula is a special case. When the force changes in magnitude, direction, or both as the particle moves, the displacement must be divided into sufficiently small pieces and the work contributions added.

The general definition is the line integral

|-----∫--------|
|              |
W  =     F ⋅ dr,
-------C--------
(2)

where C is the actual path followed by the particle.

In one-dimensional motion along the x axis, this reduces to

|-----∫-xf----------|
W  =      Fx (x )dx. |
-------xi------------
(3)

This article develops the meaning and use of that integral, connects it to the signed area under a force-position graph, applies it to springs and piecewise forces, and shows why the path itself can matter in more than one dimension.

PIC

Figure 1. Constant-force work is the special case in which every small displacement experiences the same force. For a variable force, the total work is obtained by summing differential contributions dW = F ⋅ dr.

1 From a finite sum to an integral

Suppose a particle moves from position ri to rf along a path C. Divide the path into many short displacement vectors

Δr1, Δr2, ...,ΔrN .
(4)

If each segment is sufficiently short, the force over that segment can be approximated by a nearly constant value Fk. The work on segment k is approximately

ΔWk   ≈ Fk ⋅ Δrk.
(5)

Adding all segments,

     ∑N
W  ≈     Fk ⋅ Δrk.
     k=1
(6)

In the limit of increasingly fine subdivisions,

|----------------------------------|
|           N             ∫        |
W  =   lim  ∑   F  ⋅ Δr =     F ⋅ dr.
|     N→ ∞      k     k    C       |
-----------k=1----------------------
(7)

Thus the work integral is the continuum limit of ordinary constant-force work.

2 Differential work

The differential amount of work associated with an infinitesimal displacement dr is

|-------------|
dW--=--F-⋅ dr.|
(8)

If 𝜃 is the instantaneous angle between F and dr, then

dW   = F ds cos𝜃,
(9)

where ds = |dr| is the infinitesimal path length.

Therefore:

  • dW > 0 if the force has a component along the displacement,
  • dW = 0 if the force is perpendicular to the displacement,
  • dW < 0 if the force has a component opposite the displacement.

The total work is obtained by integrating these signed contributions.

3 One-dimensional variable force

For motion along the x axis,

dr = dx e .
         x
(10)

If

F =  Fx(x)ex,
(11)

then

dW  = Fx (x)dx.
(12)

Hence

|-----∫-------------|
|       xf          |
W  =      Fx (x )dx. |
-------xi------------
(13)

This result should be interpreted carefully. The integration variable x carries a sign through dx. If the particle moves toward decreasing x, then dx < 0 along that part of the motion.

4 Force-position graphs and signed area

The integral

      ∫ x
         f
W   =  x  Fx (x)dx
        i
(14)

has a direct geometric interpretation.

On a graph of Fx versus x:

  • area above the x axis contributes positive work,
  • area below the x axis contributes negative work,
  • the net signed area equals the total work.

PIC

Figure 2. The work done by a one-dimensional variable force equals the signed area under the Fx versus x curve between the initial and final positions.

Because

[W ] = [F][x],
(15)

the area under a force-position graph has units

N m  = J.
(16)

5 Example 1: a quadratic force law

Suppose

Fx (x) = ax2,
(17)

where a is a constant.

The work from x = 0 to x = L is

W = ∫ 0Lax2 dx (18)
= a[  3]
  x--
  30L (19)
= aL3
----
 3 . (20)

A common mistake would be to multiply the final force aL2 by the distance L. That would give aL3, which is three times too large. The force varies throughout the motion, so the integral is required.

6 Average force in one dimension

For motion from xi to xf, define an average force over the interval by

               ∫  x
F    =  ---1----  f F (x) dx.
  avg    xf − xi  x   x
                 i
(21)

Then

W  =  Favg(xf − xi).
(22)

This is useful when the force-position curve is simple enough that its average value is obvious.

For example, if Fx increases linearly from 0 to F0 over a displacement L, then

F    =  F0,
  avg    2
(23)

so

      1-
W  =  2F0L.
(24)

This is the area of a triangle.

7 Piecewise variable forces

Many problems specify a force graph made of straight-line or constant segments. The easiest method is often geometric area rather than direct integration.

Consider the force-position graph in Figure 3.

PIC

Figure 3. A piecewise force-position graph. The total work is the sum of the signed geometric areas of the rectangle, triangle, and negative triangle.

Suppose the graph contains:

  • a constant force +F0 from x = 0 to x = L,
  • a linear decrease from +F0 at x = L to 0 at x = 2L,
  • a linear decrease from 0 at x = 2L to −F0 at x = 3L.

The three signed areas are

W1 = F0L, (25)
W2 = 1-
2F0L, (26)
W3 = −1
--
2F0L. (27)

Therefore

|--------------|
|W     =  F L. |
---total----0---
(28)

The positive and negative triangular contributions cancel.

8 Spring force

An ideal spring obeys Hooke’s law:

|----------|
Fx  = − kx,|
------------
(29)

where x is the displacement from equilibrium and k is the spring constant.

The negative sign means that the spring force points opposite the displacement.

The work done by the spring as its endpoint moves from xi to xf is

Ws = ∫ xixf (−kx) dx (30)
= −k[   ]
  x2
  2--xixf . (31)

Thus

|--------------------|
|W  =  1kx2 −  1kx2 .|
---s---2---i---2---f-|
(32)

PIC

Figure 4. For Fx = −kx, the work done by the spring between two positions is the signed area under the straight-line force-position graph.

Several special cases are important.

8.1 Spring released from extension x0 to equilibrium

Set

xi = x0,    xf =  0.
(33)

Then

|------------|
|      1   2 |
|Ws =  -kx 0.|
-------2-----
(34)

The spring does positive work while moving toward equilibrium.

8.2 Stretching from equilibrium to x0

Set

xi = 0,    xf =  x0.
(35)

Then

|--------------|
|        1-  2 |
|Ws  = − 2kx 0.|
---------------
(36)

The spring does negative work because its force opposes the outward displacement.

9 Work done by an external agent on a spring

If a spring is stretched very slowly so that the endpoint is approximately in mechanical equilibrium throughout the process, the external applied force is

Fext ≈ +kx.
(37)

The work done by the external agent in stretching from 0 to x0 is

       ∫  x0        |-----|
W    =      kx dx = |1kx2 |.
  ext    0          -2---0-
(38)

This has the same magnitude as the negative work done by the spring:

W    =  − W .
  ext       s
(39)

The distinction between “work done by the spring” and “work done on the spring” is essential.

10 Using variable-force work with the work-energy theorem

M03-02 established

Wnet = ΔK.
(40)

If the net force varies with position in one dimension,

|∫-------------------------------|
|  xf             1    2   1   2 |
|    Fnet(x)dx  = -mv f −  -mv i.|
--xi--------------2--------2------
(41)

This relation often determines speed without solving for acceleration as a function of time.

11 Example 2: speed under a linearly increasing net force

A 2.0 kg particle starts from rest at x = 0. The net force is

Fnet(x) = 4x,
(42)

with F in newtons when x is in meters.

Find the speed at x = 3.0 m.

The net work is

Wnet = ∫ 034xdx (43)
= [2x2] 03 (44)
= 18 J. (45)

From the work-energy theorem,

18 = 1(2.0)v2.
     2      f
(46)

Therefore

|----------------------|
|     √ ---            |
-vf-=---18-=-4.24-m-∕s.
(47)

12 Parameterized paths in several dimensions

In more than one dimension, the work integral is

      ∫
W  =     F ⋅ dr.
       C
(48)

A convenient way to evaluate it is to parameterize the path using a variable λ:

r = r(λ ).
(49)

Then

dr = dr-dλ.
     dλ
(50)

Therefore

|--------------------------|
|     ∫  λf                 |
|W  =      F (r(λ )) ⋅ dr-dλ.|
|       λi           dλ     |
---------------------------
(51)

If time itself is used as the parameter,

dr = v dt,
(52)

so

-----------------------------
|      ∫ tf                   |
|W  =      F(r(t),t) ⋅ v (t) dt.
|       ti                    |
-----------------------------|
(53)

This form remains valid even if the force depends explicitly on time.

13 Example 3: work along a two-dimensional path

Let

F (x, y) = ayex,
(54)

where a is a constant.

Suppose the particle moves from (0, 0) to (L,L) along two different paths.

13.1 Path A: first along x, then along y

Along the first segment,

y = 0,
(55)

so

F  = 0.
(56)

Hence

W1 =  0.
(57)

Along the vertical segment,

dr = dy ey.
(58)

Since F points in the x direction,

F  ⋅ dr = 0.
(59)

Therefore

|--------|
|W   = 0.|
---A------
(60)

13.2 Path B: first along y, then along x

Along the first vertical segment,

dr = dy ey,
(61)

so the work is again zero.

Along the top horizontal segment,

y = L
(62)

and

F  = aL ex.
(63)

Thus

WB = ∫ 0LaLdx (64)
= aL2 . (65)

The same endpoints give different work:

WA  ⁄=  WB.
(66)

PIC

Figure 5. For the field F = ay ex, the work from (0,0) to (L,L) depends on the path. Path A gives zero work, while Path B gives aL2.

This example demonstrates path-dependent work. A later mechanics article will develop the special class of forces for which the work depends only on the endpoints.

14 Reversing a path

For a force field that is evaluated along the same geometric path in reverse order,

dr →  − dr.
(67)

Therefore

|W------=--− W------.|
---reverse-------forward--
(68)

This sign reversal is a direct consequence of the line integral.

For example, an ideal spring does positive work while returning from x0 to equilibrium and negative work while being stretched from equilibrium to x0.

15 Work around a closed path

If a particle returns to its starting point, the path is closed. The work is written

|---------∮--------|
|                  |
Wclosed =  C F ⋅ dr.
--------------------
(69)

A closed path does not automatically imply zero work. The result depends on the force field.

For the path-dependent example

F = ay ex,
(70)

one can construct a rectangular closed loop for which the total work is nonzero.

The conditions under which

∮

  C F ⋅ dr = 0
(71)

for every closed path will be developed later with conservative forces and potential energy.

16 Units and dimensional checks

The work integral

     ∫
W  =    Fx dx
(72)

has dimensions

[W ] = [F][x].
(73)

Since

[F ] = M LT −2,
(74)

we obtain

          2  −2
[W  ] = M L T   .
(75)

For a spring,

F = kx,
(76)

so

[k] = F- = N ∕m.
      x
(77)

Then

    2   N   2
[kx ] = m-m   = N m  = J,
(78)

which confirms the dimensions of

1kx2.
2
(79)

17 Common mistakes

  1. Using W = FΔx when the force varies substantially with position.
  2. Using the final force instead of integrating over the full interval.
  3. Forgetting that area below the axis on an Fx versus x graph contributes negative work.
  4. Confusing area under an F versus x graph with area under an F versus t graph.
  5. Forgetting that ∫ Fx dx has units of joules, while ∫ Fx dt has units of impulse.
  6. Dropping the minus sign in Hooke’s law Fx = −kx.
  7. Confusing work done by a spring with work done on a spring.
  8. Assuming that the work between two points is always independent of path.
  9. Evaluating a multidimensional line integral without first specifying the path.
  10. Forgetting that reversing the path reverses the sign of the work along that same path.

18 Practice exercises

  1. A force varies as Fx = 3x2 in SI units. Find the work from x = 1 m to x = 4 m.
  2. A force increases linearly from 2 N at x = 0 to 10 N at x = 4 m. Find the work geometrically and by integration.
  3. The force-position graph is a triangle above the axis with base 6 m and height 12 N. Find the work.
  4. The force-position graph contains +20 J of positive signed area and −7 J of negative signed area. Find the net work.
  5. A spring with k = 300 N∕m is stretched from x = 0.10 m to x = 0.25 m. Find the work done by the spring.
  6. For the same spring, find the work done by an external agent during a slow stretch from x = 0 to x = 0.25 m.
  7. A 1.0 kg particle starts from rest and experiences a net force Fx = 6x from x = 0 to x = 2.0 m. Find its final speed.
  8. Parameterize the straight-line path from (0, 0) to (L,L) as r(λ) = λLex + λLey, 0 ≤ λ ≤ 1. Evaluate the work for F = ay ex.
  9. For F = ay ex, calculate the work around the rectangular loop (0, 0) → (L, 0) → (L,H) → (0,H) → (0, 0).
  10. Explain why the area under an Fx versus x graph represents work but the area under an Fx versus t graph does not.

19 Summary

For a variable force, work is defined by the line integral

|-----∫--------|
W  =     F ⋅ dr.
|      C       |
----------------
(80)

In one-dimensional motion,

|-------------------|
|     ∫ xf          |
W  =      Fx (x )dx, |
-------xi------------
(81)

which equals the signed area under the force-position curve.

For an ideal spring,

|----------|
-Fx-=-−-kx--
(82)

and

|------1-------1-----|
|Ws =  -kx2i − -kx2f.|
-------2-------2-----|
(83)

Combined with the work-energy theorem,

|∫-------------------------------|
|  xf             1-   2   1-  2 |
|    Fnet(x)dx  = 2mv f −  2mv i.|
--xi------------------------------
(84)

In several dimensions, the path must be specified:

|-----∫--------|
W  =     F ⋅ dr.
|      C       |
----------------
(85)

The next article, M03-04, develops power as the rate at which work is done.

References

References

[1]   J. R. Taylor, Classical Mechanics, University Science Books, 2005.

[2]   D. Kleppner and R. Kolenkow, An Introduction to Mechanics, 2nd ed., Cambridge University Press, 2014.

[3]   H. D. Young and R. A. Freedman, University Physics with Modern Physics, 15th ed., Pearson, 2020.

[4]   OpenStax, University Physics, Volume 1, Rice University, 2016.


"Work by Variable Forces" is owned by bloftin.
(view preamble)
View style:
Other names:  M03-03
Also defines:  variable force, force-position curve, line integral, work integral, path-dependent work
Keywords:  work, variable force, force-position graph, line integral, Hooke's law, spring work, piecewise force, path integral, work-energy theorem, mechanics

Attachments:
GRE Physics Companion: Work by Variable Forces (Example) by bloftin

Cross-references: power, energy, mechanics, field, parameter, work-energy theorem, net work, function, acceleration, speed, relation, M03-02, mechanical equilibrium, equilibrium, Hooke's law, units, vectors, position, dimension, graph, motion, general definition, work, displacement, particle, magnitude, formula, M03-01, force
There are 2 references to this object.

This is version 1 of Work by Variable Forces, born on 2026-10-03.
Object id is 1375, canonical name is WorkByVariableForces.
Accessed 8 times total.

Classification:
Physics Classification: 45.20.Dd (Newtonian mechanics)
 45.50.-j (Dynamics and kinematics of a particle and a system of particles)
Pending Errata and Addenda
None.
Discussion
Style: Expand: Order:

No messages.

Interact
rate | post | correct | update request | add example | add (any)