Line Integral of a Vector Field: Work Done, Formula and Solved Examples
By Dr. Muhammad Amjad Khadim (PhD Mathematics) · Updated November 2026
If you push a shopping trolley along a curved path while the wind blows from different directions at different points, how much work does the wind do on the trolley? Questions like this are exactly what the line integral of a vector field answers. It adds up the component of a vector field along a curve, bit by bit, and it is the foundation for Green's theorem, Stokes' theorem and the whole idea of conservative fields.
In this guide I explain the formula in plain language, give you a reliable four-step method, and solve several examples in 2D and 3D, including work done by a force and a demonstration of path dependence. If you want to check an answer, the line integral calculator on our calculators page can help.
1. What a line integral of a vector field measures
2. The formula
3. A four-step method
4. Worked examples
5. Does the path matter?
6. Useful properties
7. Common mistakes, FAQs and practice
1. What a Line Integral of a Vector Field Measures
Suppose a particle moves along a curve C while a force field F acts on it. Over a tiny step dr, the work done is F · dr: the dot product picks out only the part of the force that points along the motion. The part of the force perpendicular to the motion does no work at all. Adding up all these tiny contributions along the curve gives the total work:
If F is a velocity field of a fluid instead of a force, the same integral measures how much the flow pushes along the curve. Around a closed loop, it is called the circulation.
2. The Formula
To compute a line integral, describe the curve with a parametrisation r(t) = (x(t), y(t), z(t)) for a ≤ t ≤ b. Then dr = r′(t) dt and
You will also see the same integral written in differential form. If F = (P, Q, R), then
∫C F · dr = ∫C P dx + Q dy + R dz
Both notations mean exactly the same thing.
3. A Four-Step Method
- Parametrise the curve r(t) and find the limits a and b. Make sure t increases in the direction the curve is travelled.
- Differentiate: find r′(t).
- Substitute x(t), y(t), z(t) into F to get F(r(t)).
- Dot and integrate: compute F(r(t)) · r′(t), which is now an ordinary function of t, and integrate from a to b.
Line segment from A to B: r(t) = A + t(B − A), 0 ≤ t ≤ 1.
Circle of radius R, counterclockwise: r(t) = (R cos t, R sin t), 0 ≤ t ≤ 2π.
Graph y = g(x) from x = a to x = b: r(t) = (t, g(t)), a ≤ t ≤ b.
4. Worked Examples
Example 1: Along a parabola
Evaluate ∫C F · dr where F = y i + x j and C is the parabola y = x² from (0, 0) to (1, 1).
Parametrise: r(t) = (t, t²), 0 ≤ t ≤ 1.
Differentiate: r′(t) = (1, 2t).
Substitute: F(r(t)) = (t², t).
Dot and integrate: F · r′ = t² + 2t² = 3t², so ∫01 3t² dt = 1.
Example 2: Around part of a circle
Evaluate ∫C −y dx + x dy where C is the quarter circle from (1, 0) to (0, 1), counterclockwise.
Use r(t) = (cos t, sin t), 0 ≤ t ≤ π/2. Then dx = −sin t dt and dy = cos t dt, so
−y dx + x dy = (−sin t)(−sin t) dt + (cos t)(cos t) dt = dt.
The integral is ∫0π/2 dt = π/2. Around the full circle it would be 2π, which matches the result we found using Green's theorem.
Example 3: A 3D helix
Find the work done by F = x i + y j + z k on a particle moving along the helix r(t) = (cos t, sin t, t) from t = 0 to t = 2π.
r′(t) = (−sin t, cos t, 1) and F(r(t)) = (cos t, sin t, t). Then
F · r′ = −cos t sin t + sin t cos t + t = t.
So W = ∫02π t dt = 2π².
Example 4: Work along a straight line
A force F = 3x i + 2y j (newtons) moves an object in a straight line from (0, 0) to (2, 1) (metres). Find the work done.
Parametrise the segment: r(t) = (2t, t), 0 ≤ t ≤ 1, so r′ = (2, 1) and F = (6t, 2t). Then F · r′ = 12t + 2t = 14t and W = ∫01 14t dt = 7 joules.
5. Does the Path Matter?
Sometimes it does, and sometimes it does not. Let us test F = y i − x j between (0, 0) and (1, 1) along two different paths.
Path 1 (straight line): r(t) = (t, t). F = (t, −t), r′ = (1, 1), F · r′ = t − t = 0. Integral = 0.
Path 2 (parabola): r(t) = (t, t²). F = (t², −t), r′ = (1, 2t), F · r′ = t² − 2t² = −t². Integral = −1/3.
Different paths, different answers, so this line integral is path dependent. That tells us F is not conservative.
By contrast, every field in Examples 1, 3 and 4 above is conservative. In Example 1, F = ∇(xy), so the integral is simply f(1, 1) − f(0, 0) = 1. In Example 3, F = ∇((x² + y² + z²)/2), and f(1, 0, 2π) − f(1, 0, 0) = (1 + 4π²)/2 − 1/2 = 2π², matching our answer. In Example 4, F = ∇(3x²/2 + y²), giving 6 + 1 = 7. This shortcut is the fundamental theorem for line integrals. To learn how to spot conservative fields and find their potentials, see how to check if a vector field is conservative and how to find the potential function.
6. Useful Properties
- Reversing direction flips the sign: ∫−C F · dr = −∫C F · dr. Work done going backwards is the negative of work done going forwards.
- Piecewise curves add: if C is made of pieces C1, C2, ..., integrate over each piece with its own parametrisation and add the results. This is how you handle triangles, squares and other polygons.
- The parametrisation does not matter, as long as it traces the same curve in the same direction. Using r(t) = (t, t²) or r(s) = (2s, 4s²) with 0 ≤ s ≤ 1/2 gives the same answer.
- Perpendicular force does no work: if F is always perpendicular to the curve, the integral is zero. For example, a magnetic force on a moving charge does no work.
7. Common Mistakes
- Forgetting r′(t). Integrating F(r(t)) alone, without the dot product with r′(t), is the most common error.
- Wrong direction. If the curve goes from B to A but your parametrisation goes from A to B, flip the sign.
- Confusing the two kinds of line integral. The scalar line integral ∫ f ds uses |r′(t)| dt and measures things like mass of a wire. The vector line integral ∫ F · dr uses F · r′(t) dt and measures work or circulation.
- Not substituting fully. Every x, y and z in F must be replaced by its expression in t before integrating.
Frequently Asked Questions
What does a negative line integral mean?
It means the field mostly pushes against the direction of travel, so the field does negative work. You would have to do positive work against it.
Why is it called a "line" integral if the path is curved?
The name is historical. "Line" here just means a one-dimensional path, which can bend and twist as much as it likes. Some books call it a "curve integral" or a "path integral", which are more descriptive. Whatever the name, the idea is the same: you integrate along a path rather than over an interval of the x-axis, a flat region or a solid volume.
Is the line integral the same as the arc length?
No. Arc length is ∫ ds, a scalar line integral of the constant function 1. The vector line integral ∫ F · dr depends on the field.
When should I use Green's or Stokes' theorem instead?
When the curve is closed and the direct parametrisation is messy. See our guides to Green's theorem and Stokes' theorem.
Practice Problems
- F = x i + y j along r(t) = (t, t), 0 ≤ t ≤ 1. (Answer: 1)
- F = y i around the unit circle, counterclockwise. (Answer: −π)
- F = 2x i + 2y j + 2z k along any path from (0, 0, 0) to (1, 2, 2). (Answer: 9)
For further reading, see Paul's Online Notes on line integrals of vector fields and the MathWorld entry on line integrals. For quick unit conversions between newtons, joules and other units, try PakMath, and for everyday calculators, Adzita has a good free collection.
Comments
Post a Comment