Work done by a variable force is an important concept in Physics. Unlike a constant force, a variable force changes its magnitude or direction as the position of a body changes. This topic explains how to calculate work done by a variable force using the graphical method and mathematical integration. It also covers the area under a force–displacement graph, work done by variable vector forces in three dimensions, and solved numerical problems based on these concepts.
Work Done by a Variable Force Using Graphical Method
In many practical situations, the force acting on a body does not remain constant. Instead, its magnitude changes with the position of the body. Such a force is called a variable force.
Consider a variable force acting along a fixed direction, such as the positive x-axis. Its magnitude changes with the position x. We need to calculate the total work done by this force when a body moves from an initial position A (x = xA) to a final position B (x = xB).

Derivation of Work Done using Graphical Method
Suppose the body moves from A to B. Divide its total displacement into a large number of very small parts. Consider one such small displacement from P to Q, represented by dx.
Since the displacement dx is very small, the force can be considered approximately constant during this small movement. If the force at position x is F(x), then the small amount of work done is:
dW = F(x) × dx
On the force–displacement graph, this small work is represented by the area of the narrow rectangular strip PQRS.
dW = PS × PQ
The total work done in moving the body from A to B is obtained by adding the work done during all the small displacements.
W = Σ dW
W = Σ F(x) × dx
As the width of each displacement strip becomes smaller and approaches zero (dx → 0), the number of strips increases towards infinity. In this limit, the sum of the work done over all the small displacements becomes a definite integral. When the body moves from position xA to xB, the work done is given by:
From the graphical representation, this integral gives the algebraic area under the force–displacement curve. If the force remains positive throughout the displacement, the work done is equal to the area ABCDA enclosed by the curve and the displacement axis.
W = Total area under the curve between F and x-axis from x = xA to x = xB
W = Area enclosed between ABCDA
Hence, work done by a variable force is numerically equal to the area under the force curve and the displacement axis.
Important Notes:
Net Work Done: The algebraic sum of positive and negative areas gives the net work done by the variable force.
Sign of Area: Areas lying above the displacement axis (F > 0) represent positive work, while areas lying below the displacement axis (F < 0) represent negative work.
Learn Work, Formula, Dimensions, Absolute & Gravitational Units
Mathematical Treatment of Work Done by a Variable Force
Suppose a body moves from point A (at displacement SA from a reference origin) to point B (at displacement SB) under the action of a continuously varying force .

At any intermediate position P, let the instantaneous force acting on the body be . Under the action of this force, suppose the body undergoes an infinitesimally small displacement .
Because is vanishingly small, the force can be treated as effectively constant over this tiny step. The small amount of work done (dW) during this displacement is:
dW = F dS cos θ
where θ is the angle between the force vector and the displacement vector .
To find the total work done (W) in moving the body from A (S = SA) to B (S = SB), we sum (integrate) the work elements dW over the entire path:
In three-dimensional Cartesian coordinates, where:
Force vector:
Displacement element:
Thus, the total work done is given by:
General Expression for Work Done by a Variable Vector Force in Three Dimensions
In the previous cases, we considered forces that varied in magnitude but acted along a fixed straight-line direction. However, in real-world situations, a force may vary in both magnitude and direction as a particle moves through space.
To calculate the work done by such a force, we use the vector dot product and line integration.
When a particle moves through a very small displacement d𝐫 under the action of a variable force 𝐅, the small amount of work done is given by the dot product of force and displacement:
= ·
Suppose a particle moves along an arbitrary path from its initial position 𝐫i to its final position 𝐫f. The total work done is obtained by adding all the infinitesimal amounts of work along the path.
Therefore,
This is called the line integral of force along the path.
In three-dimensional Cartesian coordinates, the infinitesimal displacement vector can be written as:
= dx î + dy ĵ + dz k̂
The force vector can be expressed as:
= Fₓ î + Fᵧ ĵ + F𝓏 k̂
· = Fₓ dx + Fᵧ dy + F𝓏 dz
Therefore, the total work done is:
W = ∫ (Fₓ dx + Fᵧ dy + F𝓏 dz)
The integration is performed along the actual path followed by the particle.
Where:
𝐫ᵢ = Initial position vector of the particle.
𝐫𝒻 = Final position vector of the particle.
𝐅 = Variable force vector acting on the particle.
d𝐫 = Infinitesimal displacement vector.
Fₓ, Fᵧ, F𝓏 = Components of force along the x-, y-, and z-axes.
dx, dy, dz = Infinitesimal displacements along the respective coordinate axes.
The line-integral expression helps us determine whether the work done by a force depends on the path followed by the particle or only on its initial and final positions.
Numerical Problem
A force F acting on a particle varies with its position x, as shown in the figure. Calculate the work done by this force when the particle moves through the following intervals:
(a) From x = −2 m to x = 0
(b) From x = 0 to x = 2 m

Solution:
The work done by a variable force is equal to the signed area under the F–x graph.
(i) Area below the x-axis represents negative work.
(ii) Area above the x-axis represents positive work.
(a) Work Done from x = −2 m to x = 0
In this interval, the graph lies below the x-axis. Therefore, the work done is negative.
The area of the triangular region is:
W = −½ × Base × Height
W = −½ × 2 × 10
W = −10 J
(b) Work Done from x = 0 to x = 2 m
In this interval, the graph lies above the x-axis. Therefore, the work done is positive.
The area of the triangular region is:
W = ½ × Base × Height
W = ½ × 2 × 10
W = 10 J
Numerical Problem
A man moves a trunk across a rough railway platform by applying a force of 120 N over the first 15 m. As he becomes tired, the applied force decreases uniformly from 120 N to 80 N over the next 10 m. The trunk covers a total displacement of 25 m, while the frictional force remains constant at 40 N. Plot the applied force and frictional force against displacement, and calculate the work done by applied force and frictional force over the total displacement of 25 m. Also calculate net work done on the trunk.
Solution:
1. Forces and Displacements
Applied force (F₁): 120 N for 0 ≤ x ≤ 15 m.
Applied force (F₂): Decreases uniformly from 120 N to 80 N for 15 m ≤ x ≤ 25 m.
Frictional force (f): −40 N throughout the 25 m displacement because friction acts opposite to the direction of motion.
The applied force is plotted above the displacement axis, while the frictional force is plotted below it.

2. Work Done by the Man (W₁)
Work done by the applied force is equal to the area under the force–displacement graph.
W₁ = Area of rectangle OABM + Area of trapezium BCNM
Area of rectangle OABM (0 to 15 m):
Area₁ = 120 × 15
Area₁ = 1,800 J
Area of trapezium BCNM (15 m to 25 m):
Area₂ = ½ × (Sum of parallel sides) × Distance between them
Area₂ = ½ × (120 + 80) × 10
Area₂ = ½ × 200 × 10 = 1,000 J
Total work done by the man:
W₁ = 1,800 + 1,000
W₁ = 2,800 J
3. Work Done by the Frictional Force (W₂)
The frictional force remains constant at −40 N throughout the displacement of 25 m.
W₂ = Frictional force × Displacement
W₂ = −40 × 25
W₂ = −1,000 J
4. Total work done on the trunk:
W = W₁ + W₂ = 2800 + (−1,000) = 1800 J
This is the combined work of all forces acting on the trunk, which goes into changing the kinetic energy of the trunk.
Numerical Problem
A particle moves along the x-axis under the action of a variable force given by F = (12 + 0.40x) N, where x is the position in metres. Calculate the work done by this force when the particle moves from x = 0 m to x = 3 m.
Solution
Variable force, F = (12 + 0.40x)
Initial position, x₁ = 0 m and Final position, x₂ = 3 m
In this problem direction of force and displacement position is at same axis, that is θ = 0°
For a small displacement dx, the work done is:
dW = F dx
dW = (12 + 0.40x) dx
Total work done:
W = [12(3) + 0.20(3)²] − [12(0)+0.20(0)²]
W = 36 + 0.20 × 9
W = 36 + 1.8
W = 37.8 J
Numerical Problem
A particle moves along the x-axis under the influence of a variable force given by F = (3x³ + 4x + 2) N. Determine the work done by this force when the particle moves from x = 0 m to x = 2 m.
Solution:
Variable force, F = 3x³ + 4x + 2 N
Initial position, x₁ = 0 m
Final position, x₂ = 2 m
The work done by a variable force acting along the direction of motion is calculated by integrating the force over the displacement.
W = [(3/4)(2)⁴ + 2(2)² + 2(2)] − [(3/4)(0)⁴ + 2(0)² + 2(0)]
W = (12 + 8 + 4) − 0
W = 24 J
Numerical Problem
A body moves from the initial position vector 𝐫₁ = (2î + 3ĵ) m to the final position vector 𝐫₂ = (4î + 6ĵ) m under the action of a variable force 𝐅 = (3x²î + 2yĵ) N. Calculate the work done by this force.
Solution:
Initial position vector, 𝐫₁ = (2î + 3ĵ) m
Final position vector, 𝐫₂ = (4î + 6ĵ) m
Force vector, 𝐅 = (3x²î + 2yĵ) N
The work done by a variable vector force is given by the line integral:
W = ∫ 𝐅 · d𝐫
The infinitesimal displacement vector in two dimensions is:
d𝐫 = dx î + dy ĵ
Substituting the force and displacement vectors:
W = ∫ (3x²î + 2yĵ) · (dx î + dy ĵ)
W = ∫ 3x² dx + ∫ 2y dy
W = ∫₂⁴ 3x² dx + ∫₃⁶ 2y dy
W = [x³]₂⁴ + [y²]₃⁶
W = (4³ − 2³) + (6² − 3²)
W = (64 − 8) + (36 − 9)
W = 56 + 27
W = 83 J
Note: The result is independent of the path because the given force has components that depend only on their respective coordinates (x and y).
Numerical Problem
A uniform chain of length L and mass M is placed on a frictionless table, with (1/n)th of its total length hanging vertically over the edge. Calculate the work required to pull the entire hanging portion back onto the table.
Solution:
Total length of chain = L
Total mass of chain = M
Mass per unit length (m) = M/L
Initial hanging length = L/n
Let y be the instantaneous length of the chain hanging over the edge at any moment. The force needed to support and pull the hanging portion equals its weight:
F = (m y) g
To pull the chain up by a small distance dy, the hanging length decreases. Thus, the displacement element is taken as −dy:
dW = F (−dy) = −(m g y)dy
Integrating dW as the hanging length y changes from y = L/n to y = 0:
Substituting m = M/L:
Alternate solution based on Center of Mass Method
Mass of the hanging portion (m‘):
m‘ = M/n
Since the hanging part is uniform, its center of mass lies at a distance of half its hanging length below the table top:
h = 1/2(L/n) = L/2n
The work required to raise the hanging mass to the tabletop equals the increase in its potential energy:
W = m‘ g h = (M/n) g (L/2n) = (M g L)/2n²
Numerical Problem
A small object of mass m is suspended from a string of length l, as shown in the figure. An external force, initially zero, is gradually increased to pull the object very slowly. The object remains in equilibrium throughout the motion until the string makes an angle θ with the vertical. Calculate the work done by the applied force.

Solution:
Let the string be deflected by an angle θ from the vertical at any instant under the action of the horizontal pulling force F and tension T in the string. Since the object is pulled very slowly, it remains in quasi-static mechanical equilibrium at every point along its path. Resolving the forces vertically and horizontally:
Vertical equilibrium:
T cos θ = mg
Horizontal equilibrium:
T sin θ = F
F = mg tan θ
For an infinitesimal angular displacement dθ, the arc displacement element along the path is dS = l dθ.
The angle between the horizontal force F and the tangential displacement element S is θ. The small amount of work done (dW) is given by:
dW = F dS cos θ
Substitute F = mg tan θ and dS = l dθ:
dW = mg tan θ × l dθ × cos θ
dW = mgl sin θ dθ
To calculate total work done, integrating dW from the initial angle 0° to the final angle θ:
W = −mgl [cos θ − cos 0°]
W = −mgl [cos θ − 1]
W = mgl [1 – cos θ]