Line Integral Calculator

Integrate F · dr along a parametric path, the work done by a field along a curve.

Line Integral Calculator

What Is a Line Integral of a Vector Field?

The line integral ∫C F · dr totals a vector field's push along a curve: at each step of the journey, take the component of F pointing your way, times the step length, and accumulate. Physically it is work the energy a force field gives to (or takes from) a particle traversing the path C. With the curve parameterized as r(t) = (x(t), y(t)), the recipe becomes an ordinary integral:

C F · dr = ∫ab [ P(x(t), y(t))·x′(t) + Q(x(t), y(t))·y′(t) ] dt

Everything gets translated into the parameter: positions via the curve, direction via its derivatives, and the dot product marries field to motion. Where the field aids the motion the integrand is positive; where it opposes, negative; sideways pushes contribute nothing, a field can be strong yet do zero work if it always meets the path at right angles.

How to Use This Calculator

Enter the field's components P and Q, the parametric curve x(t), y(t), and the parameter window. The calculator differentiates the curve symbolically, assembles the P·x′ + Q·y′ integrand, and evaluates it with high-precision quadrature. The plot overlays the field's arrows with the path drawn through them, the fastest way to predict the sign of the answer before reading it: arrows along the path mean positive work, against mean negative, perpendicular mean zero.

Worked Example: Circulation of the Rotation Field

Take F = ⟨−y, x⟩ around the unit circle (cos t, sin t), t from 0 to 2π. The integrand:

P·x′ + Q·y′ = (−sin t)(−sin t) + (cos t)(cos t) = sin²t + cos²t = 1

C F · dr = ∫₀^{2π} 1 dt = 2π

The field circulates with the path everywhere, at unit strength, total circulation 2π. Green's theorem confirms it from the inside: curl F = 2 over the unit disk of area π gives 2·π = 2π ✓. Meanwhile the first chip, F = ⟨y, x⟩ around the same loop, returns 0, that field is the gradient of xy, and conservative fields do no net work around any closed loop.

The Fundamental Theorem for Line Integrals

When F is conservative, F = ∇f for a potential f, line integrals collapse to endpoint arithmetic: ∫C F · dr = f(end) − f(start), regardless of the path. The three-way equivalence (conservative ⟺ path-independent ⟺ zero on closed loops) is the organizing theorem of the subject, and the curl test is its practical gatekeeper: curl ≠ 0 anywhere rules a potential out; curl ≡ 0 on a hole-free domain rules one in. The gravity chip runs the physics version: work by constant gravity along a parabolic arc depends only on the height drop, the path's shape is irrelevant, which is exactly why potential energy is a useful concept.

Common Mistakes to Avoid

  • Forgetting the curve derivatives. dr = ⟨x′, y′⟩dt, integrating P + Q or P·x + Q·y instead of P·x′ + Q·y′ is the standard setup error. Every piece of the integrand must be expressed through t before integrating.
  • Ignoring orientation. Traversing C backward negates the integral: work with the motion differs from work against it. Check which direction your parameterization actually travels (the circle above runs counterclockwise).
  • Confusing the two line-integral species. ∫F·dr (this tool, work, orientation-sensitive) is not ∫f ds (scalar line integral, mass of a wire, orientation-blind, using the speed |r′| instead of the dot product). Same curves, different integrands, different physics.
  • Applying path-independence without checking. Endpoint shortcuts require a conservative field, using them on ⟨−y, x⟩ (curl 2) produces nonsense, as the 2π-versus-0 contrast of the first two chips dramatizes.

Real-World Applications

Work integrals are mechanics' currency: the energy a rocket gains through a gravity assist, the work magnetic forces do on a charged particle spiraling through a field, and the energy cost of moving cargo along a mountain road through Earth's gravity field are all ∫F·dr along actual trajectories. Thermodynamics runs its engines on closed-loop line integrals, the net work per cycle is the loop integral around the P-V diagram, nonzero precisely because the "field" there isn't conservative, which is the entire point of an engine.

In electromagnetism, the electromotive force driving current around a circuit is the line integral of the electric field around the loop, Faraday's law equates it to changing magnetic flux, making every generator a physical line-integral evaluator, while Ampère's law reads current from the circulation of B around a wire. Aerodynamics completes the tour: the circulation of airflow around a wing section, a closed line integral, is directly proportional to lift (Kutta–Joukowski), so this page's mathematics is, quite literally, what holds airliners up.

Frequently Asked Questions

Does the parameterization of the curve change the answer?

No, any parameterization tracing the same curve in the same direction gives the same integral; the x′ and y′ factors rescale exactly to compensate for faster or slower traversal. Only the geometric path and its orientation matter.

What does a negative line integral mean?

The field opposed the motion on net, the particle had to spend energy against it, as when lifting against gravity. Reversing the path's direction would flip the sign to positive.

How does Green's theorem connect loops to curl?

For a closed counterclockwise curve, the circulation ∫F·dr equals the double integral of the scalar curl over the enclosed region, microscopic spins summing to macroscopic circulation. The worked example verifies it numerically: curl 2 × area π = 2π.

How do I integrate over a path made of several segments?

Additivity: integrate each piece with its own parameterization and sum. A square loop is four straight-line integrals; orientation must flow consistently around the whole circuit.

What's the 3D version?

Identical with a third component: ∫[P·x′ + Q·y′ + R·z′]dt along r(t) = (x, y, z). Work done by 3D force fields on 3D trajectories, same recipe, one more coordinate, with Stokes' theorem replacing Green's for the loop-to-surface story.

Does a line integral depend on the speed of traversal?

No. Any reparameterization tracing the same curve in the same direction yields the same value, because the curve derivatives rescale to compensate. Only the geometric path and its orientation matter, which is why orientation reversal simply flips the sign.