MULTIVARIABLE CALCULUS • LINE INTEGRALS

Line Integrals: Scalar Fields — Compute line integrals of scalar fields

Learn how to add up values of a function along a curve to find totals like length, mass, or energy.

Historical Context & Motivation

Imagine you are hiking along a mountain trail and you want to know the total elevation change you experience along the way. You are not simply measuring the height at the start and end — you care about every point along the path. This is exactly the kind of question a line integral answers. Line integrals grew out of centuries of mathematical progress as scientists and engineers needed tools to compute quantities that vary along curves, not just at single points.

1660s
Newton & Leibniz Develop Calculus
Isaac Newton and Gottfried Leibniz independently invented calculus, giving mathematicians the power to compute areas under curves and rates of change — the foundations needed for more advanced integrals.
1760s
Euler Studies Curves in Space
Leonhard Euler extended calculus to functions of several variables and began analyzing curves in two and three dimensions, setting the stage for integrating along paths.
1820s
Cauchy Formalizes Complex Integrals
Augustin-Louis Cauchy rigorously defined integrals along curves in the complex plane. His work provided the theoretical backbone for what we now call line integrals.
1850s
Riemann & Multivariable Integration
Bernhard Riemann generalized integration theory, making it possible to define integrals over curves, surfaces, and higher-dimensional objects with full mathematical rigor.
1900s
Modern Physics Applications
Line integrals became essential tools in electromagnetism and thermodynamics, computing work done by forces along paths and circulation of fields around loops.

The central question that line integrals answer is: How do we accumulate the values of a function along a curve, rather than over a flat interval on the number line? A regular definite integral adds up values along a straight segment of the x-axis. A line integral generalizes this idea so you can add up values along any curved path in two or three dimensions.

Core Principles & Definitions

Before jumping into calculations, you need to understand a few foundational ideas. A scalar field is a function that assigns a single number (a scalar) to every point in space — think of a temperature map where every location has a temperature value. A parametric curve is a path described by equations that express x and y (and possibly z) as functions of a single parameter, usually t. These two ingredients — a scalar field and a curve — combine to form the line integral of a scalar field.

1

Scalar Field f(x, y)

A function that assigns a single real number to each point in the plane or in space. Examples include temperature, altitude, or density at each location.
2

Parametric Curve C

A path defined by r(t) = (x(t), y(t)) for t in [a, b]. The parameter t traces out the curve from its start point to its end point.
3

Arc Length Element ds

A tiny piece of the curve's actual length. It accounts for both the horizontal and vertical changes so you measure distance along the curve, not just along an axis.
4

Line Integral ∫_C f ds

The sum of the scalar field's values at every point along the curve, weighted by the arc length element. It generalizes the idea of 'area under a curve' to curved paths.
KEY TAKEAWAY
Think of a line integral like walking through a city and recording the temperature at every step. A regular integral would be like driving in a straight line and noting temperatures along the way. The line integral lets you follow any winding route through the city and compute the average or total temperature you experience — weighted by how far you actually walk along each section.

Visual Explanation

The diagram below shows the key geometric idea behind a scalar line integral. A curve C sits in the x-y plane, and above each point on the curve, the scalar field f(x, y) gives a height. The line integral ∫C f ds equals the area of the curtain (or fence) that hangs from the graph of f down to the curve C. This is analogous to the area under a curve in single-variable calculus, except the base is now a curved path instead of a straight interval.

The shaded curtain represents the area calculated by the line integral. The purple curve is the path C in the x-y plane, while the cyan curve shows the height f(x, y) above each point on C. The dashed lines connect corresponding points.

Notice that the curtain stretches from the curve C up to the graph of f. Where f is large, the curtain is tall; where f is small, the curtain is short. The line integral captures the total area of this curtain. This is exactly why we need the arc length element ds — it measures the actual width of each thin strip along the curve, not just a horizontal or vertical increment.

Mathematical Framework

To actually compute a line integral, you need to convert everything into terms of the parameter t. Suppose a curve C is given by the parametrization r(t) = (x(t), y(t)) for t in [a, b], and f(x, y) is a scalar field. The line integral of f along C is defined by the following formula.

LINE INTEGRAL OF A SCALAR FIELD
∫_C f ds = ∫_a^b f(x(t), y(t)) · √((dx/dt)² + (dy/dt)²) dt
f(x(t), y(t)) is the scalar field evaluated along the curve; ds = √((dx/dt)² + (dy/dt)²) dt is the arc length element; a and b are the parameter bounds.

The expression under the square root, √((dx/dt)² + (dy/dt)²), is the speed of the parametrization — how fast the point moves along the curve as t changes. Multiplying by dt gives the tiny arc length ds. This formula works because we are chopping the curve into tiny pieces, multiplying the function value by the length of each piece, and summing them all up.

ARC LENGTH ELEMENT
ds = √((dx/dt)² + (dy/dt)²) dt = ||r′(t)|| dt
r′(t) = (dx/dt, dy/dt) is the derivative of the position vector; ||r′(t)|| is its magnitude (length). This factor corrects for how quickly the curve is being traced.
3D EXTENSION
∫_C f ds = ∫_a^b f(x(t), y(t), z(t)) · √((dx/dt)² + (dy/dt)² + (dz/dt)²) dt
In three dimensions, add the (dz/dt)² term under the square root. The concept is identical — sum scalar values weighted by arc length along a space curve.
💡 Important Property
The line integral of a scalar field does not depend on the direction you traverse the curve. Walking from point A to point B along C gives the same value as walking from B to A. This is because ds is always positive — it measures length, which has no direction.

Step-by-Step Computation Process

Computing a scalar line integral follows a systematic process. The diagram below breaks the procedure into clear stages, from identifying the curve to evaluating the final integral.

The flowchart shows the six steps for computing a scalar line integral. Each colored box represents one stage: parametrize, differentiate, compute ds, substitute, multiply, and evaluate.
  1. Step 1 — Parametrize: Write the curve as r(t) = (x(t), y(t)) with t ranging over some interval [a, b].
  2. Step 2 — Differentiate: Compute dx/dt and dy/dt by taking derivatives of the component functions.
  3. Step 3 — Arc length element: Form ds = √((dx/dt)² + (dy/dt)²) dt.
  4. Step 4 — Substitute: Replace x and y in f(x, y) with x(t) and y(t) to get a function of t alone.
  5. Step 5 — Multiply: Multiply the substituted f by the arc length speed factor and dt.
  6. Step 6 — Integrate: Evaluate the resulting single-variable definite integral from a to b.

Worked Example

Let's work through a complete example. We will compute the line integral of the scalar field f(x, y) = xy along the upper half of the unit circle, from (1, 0) to (−1, 0).

Line Integral of f(x, y) = xy over the Upper Semicircle
1
Step 1 — Parametrize the CurveThe upper half of the unit circle can be parametrized as x(t) = cos t, y(t) = sin t, where t goes from 0 to π. At t = 0, we are at (1, 0), and at t = π, we arrive at (−1, 0).
r(t) = (cos t, sin t), t ∈ [0, π]
2
Step 2 — Compute the DerivativesDifferentiate each component with respect to t: dx/dt = −sin t and dy/dt = cos t.
dx/dt = −sin t, dy/dt = cos t
3
Step 3 — Find dsCompute the arc length element: ds = √((−sin t)² + (cos t)²) dt = √(sin²t + cos²t) dt = √1 dt = dt. This makes sense because the unit circle has radius 1, so the speed along the circle is constant at 1.
ds = dt
4
Step 4 — Substitute into fReplace x and y in f(x, y) = xy with the parametric expressions: f(cos t, sin t) = cos t · sin t.
f = cos t · sin t
5
Step 5 — Set Up and Evaluate the IntegralThe line integral becomes ∫₀^π cos t · sin t · dt. To evaluate, use the substitution u = sin t, du = cos t dt. When t = 0, u = 0; when t = π, u = 0. Alternatively, recognize that cos t · sin t = (1/2) sin 2t. So the integral becomes (1/2) ∫₀^π sin 2t dt = (1/2)[−cos 2t / 2]₀^π = (1/4)[−cos 2π + cos 0] = (1/4)[−1 + 1] = 0.
∫_C xy ds = 0
6
Step 6 — Interpret the ResultThe result is 0 because the function xy is positive in the first quadrant (both x and y positive) and negative in the second quadrant (x negative, y positive). Since the semicircle passes symmetrically through both quadrants, the positive and negative contributions exactly cancel out.
Final Answer: ∫_C xy ds = 0

Common Pitfalls & Tips

When computing scalar line integrals for the first time, students frequently make mistakes that can be avoided with awareness. The table below summarizes the most common pitfalls alongside the correct approach.

Common mistakes when computing scalar line integrals
Common MistakeWhy It's WrongCorrect Approach
Forgetting the ds factorWithout ds, you are not accounting for the actual length of curve segments — just integrating with respect to dt.Always compute ||r′(t)|| and multiply it into the integrand.
Using dx or dy instead of dsScalar line integrals use the arc length element ds, not the coordinate differentials dx or dy.Use ds = √((dx/dt)² + (dy/dt)²) dt for scalar fields.
Wrong parametrization boundsIf t doesn't cover the full curve, you integrate over only part of it, yielding an incorrect answer.Verify that r(a) and r(b) match the start and end of the curve.
Forgetting to substitute x(t) and y(t) into ff(x, y) needs to become a function of t alone before you can integrate with respect to t.Replace every x with x(t) and every y with y(t) in the expression for f.
Worrying about directionUnlike vector line integrals, scalar line integrals give the same value regardless of traversal direction.For scalar fields, the integral is direction-independent. Choose whichever direction is most convenient.
KEY TAKEAWAY
Think of ds as the 'correction factor' that converts your parameter steps into actual distance traveled along the curve. Skipping it would be like measuring how long a road trip takes by counting mile markers on a straight highway when you're actually driving on a winding mountain road — the numbers wouldn't match reality. The factor ||r′(t)|| stretches or shrinks dt to reflect the true arc length.

Connection to Advanced Topics

The scalar line integral is just the beginning. As you continue in multivariable calculus, you'll encounter several related types of integrals. The table below shows how the scalar line integral compares to more advanced topics you may study next.

Scalar vs. vector line integrals
FeatureScalar Line Integral ∫_C f dsVector Line Integral ∫_C F · dr
IntegrandA scalar function f(x, y)A vector field F(x, y) = (P, Q)
Differential elementds (arc length — always positive)dr = r′(t) dt (directed displacement)
Direction dependenceNo — same value either directionYes — reversing the path flips the sign
Physical meaningTotal mass, curtain area, average value along curveWork done by a force, circulation
Typical applicationFinding mass of a wire with varying densityComputing work done by gravity or electric fields

Beyond line integrals, you will also encounter surface integrals, which extend the same idea to surfaces rather than curves. Green's Theorem, Stokes' Theorem, and the Divergence Theorem all build bridges between these different types of integrals. Mastering the scalar line integral gives you a strong foundation for all of these, since the core logic — parametrize, compute a differential element, substitute, and integrate — remains the same.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain in your own words why the scalar line integral ∫C f ds does not depend on the direction in which you traverse the curve C. How does this differ from a vector line integral?
PROBLEM 2BASIC CALCULATION
Compute ∫C (x + y) ds, where C is the line segment from (0, 0) to (3, 4). Hint: parametrize C as r(t) = (3t, 4t) for t ∈ [0, 1].
PROBLEM 3INTERMEDIATE
Compute ∫C x² ds, where C is the quarter circle x² + y² = 4 in the first quadrant (from (2, 0) to (0, 2)).
PROBLEM 4APPLIED
A wire has the shape of the parabola y = x² from (0, 0) to (1, 1). The linear density (mass per unit length) at any point is given by ρ(x, y) = 2y grams per centimeter. Find the total mass of the wire.
PROBLEM 5CRITICAL THINKING
If C is any smooth curve from point A to point B and f(x, y) = 1 for all (x, y), what does ∫C f ds equal? Explain why this result makes geometric sense, and then describe what ∫C f ds / (length of C) represents in general.

Summary & Review

A scalar line integral computes the accumulated value of a scalar field f(x, y) along a parametric curve C. The key formula is ∫C f ds = ∫ab f(x(t), y(t)) · ||r′(t)|| dt, where the factor ||r′(t)|| is the arc length element that converts parameter steps into actual distance along the curve. Geometrically, the scalar line integral measures the area of the curtain hanging from the graph of f down to the curve C.

To compute one, follow six steps: parametrize the curve, differentiate the components, compute ds, substitute into f, multiply the pieces together, and evaluate the resulting single-variable integral. Unlike vector line integrals, scalar line integrals are direction-independent because ds is always positive. When f = 1, the line integral gives the arc length of C; dividing ∫C f ds by the arc length yields the average value of f along the curve.

Varsity Tutors • Multivariable Calculus • Line Integrals: Scalar Fields