WhatsApp us
University Maths25 Nov 2026

Line Integrals of Vector Fields and Conservative Fields: Worked Examples

How to compute scalar and vector line integrals, how to test whether a vector field is conservative, how to find a potential function and use the fundamental theorem for line integrals, with six graded worked examples and practice answers.

Line Integrals of Vector Fields and Conservative Fields: Worked Examples

A line integral of a vector field F along a curve C adds up the component of F along the curve: parametrise C as r(t) for a ≤ t ≤ b and compute ∫_C F · dr = ∫ from a to b of F(r(t)) · r′(t) dt. If F is conservative, meaning F = ∇f for some potential f, the answer depends only on the end points: ∫_C F · dr = f(end) − f(start), and around any closed curve it is 0.

So every line-integral question starts with one decision: is the field conservative or not? This guide shows how to decide, then works through six examples, from a scalar arc-length integral to the field that breaks the usual test.

Two kinds of line integral

Scalar line integralLine integral of a vector field
Notation∫_C f ds∫_C F · dr, or ∫_C P dx + Q dy + R dz
What it adds upf times arc lengththe tangential component of F
Working formula∫ f(r(t)) ‖r′(t)‖ dt∫ F(r(t)) · r′(t) dt
Reversing the direction of CNo changeChanges the sign
Typical meaningMass of a wire, average valueWork done by a force, circulation

The direction rule in the last but one row explains many sign errors: ds is always positive, but dr points along the direction of travel.

This topic sits near the end of a Calculus III / Multivariable Calculus course. Our online tutoring for advanced and vector calculus page explains how sessions with Ajay Vatsyayan work through it on your own course.

Is the field conservative?

For F = (P, Q) in the plane, the test is P_y = Q_x. For F = (P, Q, R) in space, the test is ∇ × F = 0, that is

R_y = Q_z, P_z = R_x, Q_x = P_y

The test is only conclusive when F is smooth on a simply connected domain (one with no holes, such as the whole plane or all of space). On such a domain these statements are equivalent:

  1. F = ∇f for some potential f.
  2. ∫_C F · dr depends only on the end points of C.
  3. ∮_C F · dr = 0 for every closed curve C.
  4. The curl test above holds.

Since F = ∇f means every component of F is a partial derivative of f, our guide to partial derivatives and the gradient is the background for everything in this section.

Which method to use

What you seeMethod
∫ f dsParametrise and use ‖r′(t)‖ dt
∫ F · dr, field fails the curl testParametrise each piece of the path
∫ F · dr, field passes the test on a simply connected domainFind the potential, then f(end) − f(start)
Closed curve in the plane, field not conservativeGreen's theorem may be quicker
Closed curve in spaceStokes' theorem may be quicker
Field undefined at a point inside the loopDo not trust the curl test; integrate around a small circle

Worked examples

Example 1: a scalar line integral along a parabola

Evaluate ∫_C x ds, where C is the arc of y = x² from (0, 0) to (2, 4).

Parametrise with x as the parameter: r(x) = (x, x²), so r′(x) = (1, 2x) and ds = √(1 + 4x²) dx.

∫₀² x √(1 + 4x²) dx

Substitute u = 1 + 4x², du = 8x dx, with u running from 1 to 17:

(1/8) ∫₁¹⁷ √u du = (1/12)(17^(3/2) − 1) ≈ 5.758

Example 2: work along a helix

Find the work done by F = (y, z, x) along the helix r(t) = (cos t, sin t, t), 0 ≤ t ≤ 2π.

Check the curl first: ∇ × F = (0 − 1, 0 − 1, 0 − 1) = (−1, −1, −1) ≠ 0, so F is not conservative and we must parametrise.

r′(t) = (−sin t, cos t, 1) and F(r(t)) = (sin t, t, cos t), so

F · r′ = −sin²t + t cos t + cos t

Over 0 to 2π: ∫ sin²t dt = π, ∫ t cos t dt = [t sin t + cos t] = 0, and ∫ cos t dt = 0. The work is −π.

Example 3: same end points, different answers

Let F = (x², xy). Compute ∫ F · dr from (0, 0) to (1, 1) along the line y = x and along the parabola y = x².

Along y = x, with r(t) = (t, t): F · r′ = t² + t², so the integral is ∫₀¹ 2t² dt = 2/3.

Along y = x², with r(t) = (t, t²): F · r′ = t² · 1 + t · t² · 2t = t² + 2t⁴, so the integral is 1/3 + 2/5 = 11/15.

The answers differ, which proves F is not conservative. The test agrees: P_y = 0 but Q_x = y.

Example 4: finding a potential and using it

Let F = (2xy + z², x² + 3z, 2xz + 3y + 1). Find ∫_C F · dr for any path C from (1, 0, 2) to (2, −1, 1).

Curl test: R_y − Q_z = 3 − 3 = 0, P_z − R_x = 2z − 2z = 0, Q_x − P_y = 2x − 2x = 0. F is smooth everywhere, so it is conservative.

Build the potential one variable at a time:

f = ∫ (2xy + z²) dx = x²y + xz² + g(y, z)

f_y = x² + g_y must equal x² + 3z, so g_y = 3z and g = 3yz + h(z).

f_z = 2xz + 3y + h′(z) must equal 2xz + 3y + 1, so h′(z) = 1 and h = z.

f(x, y, z) = x²y + xz² + 3yz + z

∫_C F · dr = f(2, −1, 1) − f(1, 0, 2) = (−4 + 2 − 3 + 1) − (0 + 4 + 0 + 2) = −4 − 6 = −10

The straight-line path gives −10 too. The step-by-step build of f is the same as solving an exact differential equation, covered in our first-order differential equations guide.

Example 5: an ugly path you never need to parametrise

Evaluate ∫_C (y e^(xy) + 1) dx + x e^(xy) dy, where C is r(t) = (t³, sin(πt/2)), 0 ≤ t ≤ 1.

P_y = e^(xy) + xy e^(xy) and Q_x = e^(xy) + xy e^(xy), so the field is conservative on the whole plane. A potential is f = e^(xy) + x.

The curve starts at (0, 0) and ends at (1, 1), so the answer is

f(1, 1) − f(0, 0) = (e + 1) − (1 + 0) = e ≈ 2.718

Direct substitution would give an integral with e^(t³ sin(πt/2)) in it. A numerical check of that integral also gives 2.71828.

Example 6: zero curl, but not conservative

Let F = (−y, x)/(x² + y²). Find ∮ F · dr around the unit circle, around the square with corners (±1, ±1), and around the circle of radius 1 centred at (3, 0), all anticlockwise.

A direct calculation gives Q_x − P_y = 0 wherever F is defined. But F is undefined at the origin, so the plane minus the origin has a hole and the test is not conclusive.

Unit circle: r(t) = (cos t, sin t), so F(r(t)) = (−sin t, cos t) and F · r′ = sin²t + cos²t = 1. The integral is 2π, not 0.

Square: the region between the square and the unit circle has no hole and zero curl, so by Green's theorem the two loops give the same value: 2π. Integrating along the four sides directly also gives 2π.

Off-centre circle: this loop does not enclose the origin, so the region inside is free of the singularity and Green's theorem gives 0.

The rule: for this field, every anticlockwise loop around the origin gives 2π and every loop not around it gives 0. The same 2π reappears in complex analysis, where contour integrals are line integrals; see our Cauchy residue theorem examples.

Where students lose marks

  • Wrong direction. Going from B to A instead of A to B flips the sign of ∫ F · dr. Check that the parameter runs from start to end, or reverse it with t → 1 − t.
  • Forgetting ‖r′(t)‖ in ∫ f ds. ds is not dt. In Example 1, leaving out √(1 + 4x²) gives 2 instead of 5.758.
  • Trusting the curl test on a domain with a hole. Example 6 has zero curl and a non-zero loop integral.
  • Integrating each component and adding. Building f by adding ∫P dx, ∫Q dy and ∫R dz double counts shared terms such as x²y. Use the step-by-step method in Example 4.
  • Mixing up r(t) and r′(t). Substitute r(t) into F, then dot with r′(t). Students often dot F with r(t) itself.
  • Splitting a path and losing a piece. For a triangle or a square, list each segment with its own parametrisation and limits before integrating.

Practice questions

  1. Evaluate ∫_C (x² + y²) ds around the circle x² + y² = 9.
  2. Evaluate ∫_C y dx + x² dy along y = x² from (0, 0) to (1, 1).
  3. Show that F = (3x²y + 2, x³ + 4y³) is conservative and find ∫ F · dr from (0, 1) to (1, 2).
  4. F = (yz, xz, xy + 2z). Find the work from (0, 0, 0) to (1, 2, 3) along any path.
  5. For which a is F = (axy, x² + 2y) conservative? With that a, find ∫ F · dr from (0, 0) to (2, 1).

Answers:

  1. On the circle x² + y² = 9 and ds = 3 dt, so the answer is 9 × 3 × 2π = 54π.
  2. ∫₀¹ (t² + 2t³) dt = 1/3 + 1/2 = 5/6.
  3. P_y = Q_x = 3x². Potential f = x³y + 2x + y⁴; answer 20 − 1 = 19.
  4. Potential f = xyz + z²; answer 6 + 9 = 15.
  5. a = 2. Potential f = x²y + y²; answer 4 + 1 = 5.

Where line integrals lead

Closed line integrals in the plane connect to double integrals through Green's theorem, and in space to surface integrals through Stokes' theorem; both are covered in our guide to Green's, Stokes' and the divergence theorem. Converting the region to polar form often helps there, as in our post on double and triple integrals in polar, cylindrical and spherical coordinates. In physics, conservative forces are those with a potential energy, and work around a closed path in an electric or gravitational field is zero. Engineering students meet the same ideas in fluid flow and electromagnetism, which our engineering mathematics tutoring covers.

How Maths Bodhi helps

Students we teach often lose marks on direction, on a missing ‖r′(t)‖, or on trusting a curl test where the domain has a hole. Sessions work through your own course's problem sets and review your attempts step by step. We explain and practise; we don't complete graded assignments or exams. US students can see how this fits Calculus III on our college maths tutoring page.

Home tuition is available in Gurgaon (Gurugram). Students elsewhere in India and abroad learn with us online. You can book a free demo class.

Written and checked by the Maths Bodhi team (November 2026).

Frequently asked questions

How do you compute a line integral of a vector field?
Parametrise the curve as r(t), substitute into F, dot with r′(t) and integrate over the parameter range.
How do I know if a vector field is conservative?
Check P_y = Q_x in 2D or curl F = 0 in 3D, on a domain with no holes where F is smooth.
What is the fundamental theorem for line integrals?
If F = ∇f, then ∫_C F · dr = f(end point) − f(start point) for any path.
Is a line integral around a closed curve always zero?
Only for a conservative field; a field like (−y, x)/(x² + y²) gives 2π around the origin.
What is the difference between ∫ f ds and ∫ F · dr?
∫ f ds uses arc length and ignores direction; ∫ F · dr uses the tangent direction and changes sign if C is reversed.
How do you find a potential function?
Integrate P with respect to x, add an unknown function of the other variables, then match the other components one at a time.
line integralsconservative vector fieldspotential functionmultivariable calculuscalculus 3

Related guides

Keep exploring this maths topic

University Maths2 Nov 2026

Green's, Stokes' and the Divergence Theorem: Which One to Use, With Worked Examples

How Green's theorem, Stokes' theorem and the divergence theorem connect, a decision table for choosing one, six graded worked examples with every step, orientation rules, common mistakes and practice questions with answers.

vector calculusGreen's theoremStokes' theoremdivergence theorem

By Maths Bodhi Team

Read guide

University Maths18 Nov 2026

Partial Derivatives, the Gradient and Directional Derivatives: Worked Examples

How to find partial derivatives, use the multivariable chain rule, build the gradient and compute directional derivatives, with six graded worked examples, a method table, common mistakes and a practice set with answers.

partial derivativesgradientdirectional derivativemultivariable calculus

By Maths Bodhi Team

Read guide

University Maths25 Nov 2026

Triple Integrals in Spherical Coordinates (and Polar and Cylindrical): Worked Examples

How to choose between polar, cylindrical and spherical coordinates, where the Jacobian factors r and ρ² sin φ come from, how to set the limits, and six graded worked examples with practice questions and answers.

triple integralsspherical coordinatespolar coordinatescylindrical coordinates

By Maths Bodhi Team

Read guide

University Maths25 Nov 2026

Lagrange Multipliers Step by Step: Worked Examples With One and Two Constraints

A step-by-step method for Lagrange multipliers, from a single constraint to two constraints and closed regions, with six graded worked examples, the case-splitting that students miss, a method table and practice questions with answers.

Lagrange multipliersconstrained optimisationmultivariable calculuscalculus 3

By Maths Bodhi Team

Read guide

University Maths25 Nov 2026

Cauchy Residue Theorem: Formula and Worked Examples for Engineering Maths

The Cauchy residue theorem explained through six original worked examples: simple and higher-order poles, a Laurent series residue, rational and trigonometric real integrals, and a Jordan's lemma integral, plus the slips that cost marks.

Cauchy residue theoremcomplex analysiscontour integrationengineering mathematics

By Maths Bodhi Team

Read guide

University Maths18 Nov 2026

First Order Differential Equations: Separable, Linear and Exact, with Practice Problems

How to recognise and solve the three main types of first order differential equations (separable, linear and exact), with six graded worked examples, a method-choice table, common mark-losing slips and practice problems with answers.

differential equationsfirst order ODEintegrating factorexact equations

By Maths Bodhi Team

Read guide