Line Integral Formula- Complete Guide

What Is a Line Integral?

A line integral is an integral where you evaluate a function along a curve. Instead of integrating over an interval like you do in regular calculus, you're integrating over a path in space. The curve can be in two dimensions or three dimensions.

Think of it this way: if you have a wire with a density function along it, a line integral tells you the total mass. That's the basic idea.

The Two Types of Line Integrals

Line integrals split into two categories. You need to know which one you're working with before you start calculating.

Scalar Line Integral (Path Integral of a Scalar Field)

This applies when you have a scalar function f(x, y, z) and you integrate it along a curve C. The formula is:

C f(x, y, z) ds

Here, ds represents the differential arc length along the curve. This measures the "weight" of the function at each point, accounting for how long the path is at that point.

Vector Line Integral (Work Integral)

This applies when you have a vector field F and you want to calculate work done along a curve. The formula is:

C F · dr

The dot product means you only count the component of the force that actually moves along the path. This is the one engineers and physicists use most often.

The Line Integral Formulas

Scalar Line Integral Formula

If your curve C is parameterized by r(t) where a ≤ t ≤ b, then:

C f ds = ∫ab f(r(t)) |r'(t)| dt

That's the whole thing. The |r'(t)| is the magnitude of the velocity vector, which gives you the correct arc length element.

Vector Line Integral Formula

For a vector field F = ⟨P, Q, R⟩ and curve parameterized by r(t):

C F · dr = ∫ab F(r(t)) · r'(t) dt

This can expand to:

ab [P(x(t),y(t),z(t))x'(t) + Q(x(t),y(t),z(t))y'(t) + R(x(t),y(t),z(t))z'(t)] dt

Scalar Line Integral in the Plane

For a 2D curve y = g(x) from x = a to x = b:

C f(x,y) ds = ∫ab f(x, g(x)) √(1 + [g'(x)]²) dx

This is just the arc length formula multiplied by the function value at each point.

Line Integral vs Surface Integral

Don't confuse these. A line integral integrates over a curve. A surface integral integrates over a 2D surface. The formulas are different. The line integral uses ds or dr. The surface integral uses dS.

FeatureLine IntegralSurface Integral
DomainCurve (1D)Surface (2D)
Differential elementds or drdS
Formula type∫ f ds or ∫ F·dr∬ f dS or ∬ F·dS
ApplicationsWork, circulationFlux, surface area

How to Calculate a Line Integral

Here's the step-by-step process. No shortcuts.

  1. Parameterize your curve. Find r(t) = ⟨x(t), y(t), z(t)⟩ for t from a to b.
  2. Find r'(t). Take the derivative of each component.
  3. Compute |r'(t)| for scalar integrals, or F(r(t)) for vector integrals.
  4. Set up the integral. Substitute into the formula and multiply by the derivative.
  5. Evaluate from a to b. Just like any definite integral.

Example: Scalar Line Integral

Calculate ∫C (x² + y) ds where C is the line segment from (0,0) to (1,2).

Step 1: Parameterize the line. From (0,0) to (1,2):

r(t) = ⟨t, 2t⟩ for 0 ≤ t ≤ 1

Step 2: Find r'(t) = ⟨1, 2⟩

Step 3: |r'(t)| = √(1² + 2²) = √5

Step 4: f(r(t)) = t² + 2t

Step 5:01 (t² + 2t)√5 dt = √5 [t³/3 + t²]01 = √5(4/3) = 4√5/3

Done.

Example: Vector Line Integral (Work)

Calculate ∫C F · dr where F = ⟨y, x⟩ and C is the unit circle x² + y² = 1.

Step 1: Parameterize: r(t) = ⟨cos t, sin t⟩ for 0 ≤ t ≤ 2π

Step 2: r'(t) = ⟨-sin t, cos t⟩

Step 3: F(r(t)) = ⟨sin t, cos t⟩

Step 4: F · r' = sin t(-sin t) + cos t(cos t) = -sin²t + cos²t = cos(2t)

Step 5:0 cos(2t) dt = [sin(2t)/2]0 = 0

The work done around this closed loop is zero. This field is conservative — more on that below.

Conservative Vector Fields

A vector field is conservative if it represents the gradient of some scalar potential function. If F = ∇φ, then F is conservative.

Key properties:

You can test if a 2D field F = ⟨P, Q⟩ is conservative by checking if ∂P/∂y = ∂Q/∂x. In 3D, you need curl F = 0.

Fundamental Theorem for Line Integrals

If F is conservative with potential φ, then:

C F · dr = φ(r(b)) - φ(r(a))

No curve parameterization needed. Just find the endpoints and the potential function. This makes life much easier when it applies.

Common Applications

Getting Started: Quick Reference

Keep this checklist nearby when solving line integral problems:

Line Integral Formula Summary

The core formulas to remember:

That's it. The line integral formula is just a parameterization trick — you're converting a curve problem into a standard integral problem. Once you see that, the calculations become straightforward.