line integral calculator

Supported functions: sin, cos, tan, asin, acos, atan, exp, log, ln, sqrt, abs, min, max. Use * for multiplication and ^ for powers.

What is a line integral?

A line integral adds up values of a function along a curve instead of across an interval or area. In multivariable calculus, this is one of the most useful tools for computing quantities like work done by a force field, mass of a wire with varying density, circulation, and flux-related ideas.

Think of a curve C as a path traced by a parameter t. If that path is written as x = x(t), y = y(t), and t runs from a to b, then line integrals convert into ordinary single-variable integrals in t.

Two common line integral types

1) Scalar line integral

This form is:

∫C f(x,y) ds

After parameterization, it becomes:

∫[a,b] f(x(t), y(t)) * sqrt((dx/dt)^2 + (dy/dt)^2) dt

You use this when a scalar quantity (like density or temperature) is defined along a path.

2) Vector line integral (work/circulation form)

This form is:

∫C P dx + Q dy (equivalently ∫C F · dr with F = (P,Q))

After parameterization, it becomes:

∫[a,b] [P(x(t),y(t))x'(t) + Q(x(t),y(t))y'(t)] dt

You use this when computing work done by a force field along a trajectory.

How this calculator works

  • You choose scalar or vector mode.
  • You enter a parameterized curve x(t), y(t) and bounds a,b.
  • The tool evaluates derivatives numerically and integrates with Simpson's Rule.
  • It reports the approximate line integral value.

Quick examples you can try

Unit circle circulation

Use vector mode with:

  • P = -y, Q = x
  • x(t) = cos(t), y(t) = sin(t)
  • t: 0 to 2*pi

The result is approximately 2π ≈ 6.283185....

Scalar example with constant density on unit circle

Use scalar mode with:

  • f(x,y) = 1
  • x(t)=cos(t), y(t)=sin(t), 0 to 2*pi

This gives the arc length of the circle, also .

Input tips for accurate results

  • Use enough subintervals (e.g., 400, 800, 2000) for oscillatory functions.
  • Make sure your curve is differentiable on the full interval.
  • If the integral is path dependent, a different parameterization of a different path gives a different value.
  • Use parentheses generously: sin(t)^2, (x+y)^2, etc.

Common mistakes

  • Forgetting multiplication signs (write 2*x, not 2x).
  • Using degrees instead of radians in trig functions.
  • Mismatching bounds with your intended orientation.
  • Entering log expecting base 10; here log and ln both mean natural log.

Why orientation matters

For vector line integrals, reversing the direction of travel flips the sign of the result. If your answer seems opposite of what you expected, check whether your parameterization goes clockwise vs. counterclockwise (or from endpoint A to B vs. B to A).

Final note

This calculator is designed for learning and quick checks. For formal proofs or high-precision symbolic results, pair numerical computation with analytic methods from your calculus or vector analysis workflow.

🔗 Related Calculators