Work Done by a Variable Force

Last Updated : 11 Mar, 2026

In our daily lives, most forces we experience, like stretching a rubber band or pushing a swing, don’t stay the same. These are called variable forces because they change depending on how or where they’re applied. When such a force causes an object to move, we say that work is done. But unlike constant forces, we can’t use a simple formula to determine this work. Instead, we need to add up the small amounts of work done at each step, which is done using integration in physics.

Imagine a block of mass M resting on a surface. A person applies a force F to the block for a certain period of time, causing it to move a distance Δx along the surface. The block's displacement due to the applied force means that work has been done on it.

workdone

The work done by a constant force of magnitude F, which causes an object to move through a displacement Δx, is given by the expression:

\boxed {W = F \cdot \Delta x}

When dealing with a variable force, we can’t use simple multiplication to determine the work done. Instead, we use integration to account for how the force changes over distance. A common example is a spring: the force applied by a horizontal spring on an attached object varies with the stretch or compression and is expressed as

\boxed {F_s = - kx}

where,

  • k is the spring constant
  • x is the displacement of the object attached

This is the dot product between two vectors, so if the force makes an angle θ with the displacement, it is equal to the product of the magnitudes of the two vectors and the cosine of the angle between them. Then the work done will be given by, 

W = |F|\,|x|\cos(\theta)

vaibhav

Force-Displacement Plot

This force-displacement graph offers a visual interpretation of the force, helping us grasp the concept more effectively. Let’s take a look at the graph showing how force varies with displacement. In this plot, each small segment along the displacement axis, denoted as Δx, represents a tiny shift in position caused by the force F(x) at that point.

When Δx is tiny, we can consider the force over that segment to be nearly constant. The work done over this short interval is then approximately equal to the area of a rectangle, where the height is the force F(x) and the width is the displacement Δx.

Force- Displacement Plot

Take a look at the graph showing how force varies with displacement. In this plot, each small segment along the displacement axis, denoted as Δx, represents a tiny shift in position caused by the force F(x) at that point. When Δx is tiny, we can consider the force over that segment to be nearly constant. The work done over this short interval is then approximately equal to the area of a rectangle, where the height is the force F(x) and the width is the displacement Δx.

Mathematically, 

\Delta W = F(x)\,\Delta x

By summing the areas of all the small rectangles, the total work done can be expressed as

The resulting number represents the work done over a tiny segment of displacement.

Now, by adding up all such small contributions over the entire range of motion, we achieve the total work done. In calculus, this is done using integration. So, the total work W done by a variable force F(x) over a displacement from x = a to x = b is given by:

W = \int_{a}^{b} F(x) \, dx

This integral gives the area under the force-displacement curve, which represents the total work performed by the variable force along the path.

Solved Problems

Question 1: Find the work done when a force of 20 N acting in the direction of displacement produces a displacement of 5 m.

Solution: The work done by a constant force is given by, 
W = |F||d|cos(θ)
Here, θ = 0°
W = ||F||d|cos(θ)
⇒ W = (20)(5)(cos(0)) 
⇒ W= 100 J

Question 2: Find the work done when a force of F = 30i + 5j produces a displacement r = 5i + 2j. 

Solution:  The work done by a constant force is given by, 
W = \vec{F}.\vec{r}
\vec{F} = 30i + 5j and \vec{r} = 5i + 2j 
Calculating the dot product. 
W = \vec{F}.\vec{r}
⇒ W = (30i + 5j). (5i + 2j) 
⇒ W= (30)(5) + (5)(2) 
⇒W = 150 + 10 
⇒W = 160 J

Question 3: Find the work done when a force of F = x produces a displacement of 4 m. 

Solution:  The work done by a variable force is given by, 
W = ∫Fdx
F(x) = x
Calculating the work done.
W = \int^{x}_{0}Fdx \\ = \int^{x}_{0}xdx \\ = [\frac{x^2}{2}]^{x}_{0} \\ = \frac{x^2}{2}
Here, the displacement is x = 4 
W = \frac{x^2}{2}
⇒ W = \frac{4^2}{2}
⇒ W = 8 J

Question 4: Determine the work done when a force of F = x2 produces a displacement of 3 m. 

Solution: The work done by a variable force is given by, 
W = ∫ Fdx
F(x) = x2
Calculating the work done. 
W = \int^{x}_{0}Fdx \\ = \int^{x}_{0}x^2dx \\ = [\frac{x^3}{3}]^{x}_{0} \\ = \frac{x^3}{3}
Here, the displacement is x = 3 
W = \frac{x^3}{3}
⇒ W = \frac{3^3}{3}
⇒ W = 27/3 ⇒ 9J

Question 5: Determine the work done when a force of F = sin(x) produces a displacement from -1 to 1. 

Solution: The work done by a variable force is given by, 
W = ∫ Fdx
F(x) = sin(x)
Calculating the work done. 
W = \int^{1}_{-1}Fdx \\ = \int^{1}_{-1}sin(x)dx \\ = [-cos(x)]^{1}_{-1} \\ = cos(-1) - cos(1) \\ = 0

Unsolved Problems

Question 1: A spring exerts a force F= kx on a particle, where k=10 N/m. Find the work done in stretching the spring from x = 0 to x = 0.5 m.

Question 2: Find the work done by a variable force F(x) = 5x − 2 as a particle moves from x = 1 m to x = 3 m.

Question 3: A particle moves under a force F(x) = 2x + x2. Calculate the work done in moving the particle from x = 0 to x = 2 m.

Question 4: A force acting on a particle along the x-axis is given by F(x) = sin⁡ x. Find the work done when the particle moves from x = 0 to x = π.

Question 5: A particle moves along the x-axis under a variable force given by \overrightarrow {F}(x) = (4x^2 - 3x + 2)\hat{i} \,\text{N}. The particle moves from x = 0 to x = 4 m.

Comment

Explore