Line Integral Calculator - Integrate Along Curves

Line Integral Calculator

Evaluate vector and scalar line integrals along curves

Dimension:

Try These Examples

Line Integrals Quick Reference

Scalar Line Integral (∫C f ds)

  • Integrates a scalar function along a curve
  • Represents mass, charge, or arc length weighting
  • Always non-negative (uses arc length element ds)
  • Independent of curve orientation

Vector Line Integral (∫C F · dr)

  • Computes work done by a force along a path
  • Can be positive, negative, or zero
  • Depends on curve orientation (direction matters)
  • For conservative fields: equals φ(B) − φ(A)

Common Parametrizations

  • Line segment: x = (1−t)x₀ + tx₁, y = (1−t)y₀ + ty₁
  • Circle: x = r·cos(t), y = r·sin(t), t ∈ [0, 2π]
  • Parabola: x = t, y = t², t ∈ [a, b]
  • Helix (3D): x = cos(t), y = sin(t), z = t

Share this calculator

Help others solve their calculations

Found this calculator helpful? Share it with your friends, students, or colleagues who might need it!

Line Integral Calculator — Solve Vector & Scalar Path Integrals

📅 Published:
Line integral calculator with parametric curve inputs, vector field components, and step-by-step solution display.

A line integral calculator evaluates integrals of scalar functions and vector fields along parametric curves in 2D and 3D. Whether you need to compute the work done by a force field along a curved path (∫C F · dr) or find the total mass of a wire with variable density (∫C f ds), this line integral solver handles both types with step-by-step solutions.

Enter your function or vector field, define the parametric curve r(t), set parameter bounds, and get an instant numerical result. The calculator automatically computes derivatives, the arc length element ds, detects conservative vector fields, and supports both 2D and 3D curves including circles, parabolas, helices, and custom paths.

How to Use the Line Integral Calculator

Using this line integral calculator requires three inputs: the function or vector field, the parametric curve, and the parameter bounds. Here is the step-by-step process:

  1. Select the integral type — choose between a scalar line integral (∫C f ds) or a vector line integral (∫C F · dr). Scalar integrals measure accumulated quantity along the curve; vector integrals measure work or circulation.
  2. Choose 2D or 3D — toggle between two-dimensional curves (x,y) and three-dimensional curves (x,y,z) for problems involving helices, space curves, or 3D vector fields.
  3. Enter the function or vector field — for scalar integrals, type f(x,y) such as x^2 + y^2. For vector integrals, enter the P and Q components (and R for 3D) of F = ⟨P, Q⟩ or F = ⟨P, Q, R⟩.
  4. Define the parametric curve — enter x(t) and y(t) (and z(t) for 3D). For a unit circle use cos(t) and sin(t). For a parabola use t and t^2.
  5. Set parameter bounds — specify the start and end values of t. You can use expressions like 0 and 2*pi.
  6. Click Calculate — the calculator computes the integral numerically using Simpson's rule or the trapezoidal method and displays the result with detailed solution steps.

The calculator supports standard math functions (sin, cos, tan, sqrt, exp, log) and constants (pi, e). Since parametric curve analysis requires computing derivatives dx/dt and dy/dt, understanding differentiation is helpful — our partial derivative calculator covers these foundational concepts.

What Is a Line Integral? Scalar vs. Vector Explained

A line integral (also called a path integral or curve integral) generalizes ordinary integration to functions evaluated along a curve rather than an interval. There are two fundamental types:

Scalar Line Integral: ∫C f(x,y) ds

The scalar line integral sums the values of a scalar function f along a curve C, weighted by arc length. The formula is:

C f ds = ∫ab f(x(t), y(t)) · √[(dx/dt)² + (dy/dt)²] dt

This computes quantities like the mass of a wire with variable density, the total charge along a filament, or the average value of a field along a curve. The scalar line integral is always independent of curve orientation — reversing the path gives the same result.

Vector Line Integral: ∫C F · dr

The vector line integral computes the dot product of a vector field F with the tangent vector along C. The formula is:

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

This measures the work done by a force field along a path, the circulation of a fluid flow around a curve, or the voltage drop in an electric circuit. Unlike scalar integrals, vector line integrals depend on curve orientation — reversing the path negates the result.

Line Integral Formulas and Parametric Curve Setup

Every line integral computation starts with parametrizing the curve. A curve C in 2D is described by r(t) = ⟨x(t), y(t)⟩ for t ∈ [a, b]. In 3D, add a z-component: r(t) = ⟨x(t), y(t), z(t)⟩. Here are common parametrizations used in our line integral calculator:

Curvex(t)y(t)Bounds
Unit circlecos(t)sin(t)[0, 2π]
Circle radius rr·cos(t)r·sin(t)[0, 2π]
Line segment(1−t)x₀ + t·x₁(1−t)y₀ + t·y₁[0, 1]
Parabola y = x²t[a, b]
Helix (3D)cos(t)sin(t), z = t[0, 2π]

Once parametrized, the line integral solver substitutes x(t) and y(t) into the function, computes the derivatives x'(t) and y'(t), forms the integrand, and evaluates it numerically. For vector integrals, the dot product F · r'(t) replaces f · |r'(t)|.

Conservative Vector Fields and Path Independence

A vector field F = ⟨P, Q⟩ is conservative if there exists a potential function φ such that F = ∇φ. For conservative fields, the line integral depends only on the endpoints, not the path taken:

C F · dr = φ(endpoint) − φ(startpoint)

Our line integral calculator automatically tests whether a 2D vector field is conservative by checking if ∂P/∂y = ∂Q/∂x at sample points along the curve. If the field passes the test, the result display notes that the integral is path-independent. For a closed curve with a conservative field, the circulation integral ∮C F · dr equals zero.

To find the potential function of a conservative field or verify gradient computations, use our gradient calculator. For problems where you need to convert a line integral to a double integral using Green's theorem, our double integral calculator handles the area integral ∬R (∂Q/∂x − ∂P/∂y) dA.

About the Author

Marko Šinko - Co-Founder & Lead Developer

Marko Šinko

Co-Founder & Lead Developer, AI Math Calculator

Lepoglava, Croatia
Advanced Algorithm Expert

Croatian developer with a Computer Science degree from University of Zagreb and expertise in advanced algorithms. Co-founder of award-winning projects, ensuring precise mathematical computations and reliable calculator tools.

Worked Examples: Line Integral Step by Step

Example 1: Scalar Line Integral on Unit Circle

Problem: Evaluate ∫C (x² + y²) ds where C is the unit circle.

  1. Parametrize: x(t) = cos(t), y(t) = sin(t), t ∈ [0, 2π]
  2. Compute: x² + y² = cos²(t) + sin²(t) = 1
  3. Arc length element: ds = √[sin²(t) + cos²(t)] dt = 1 dt
  4. Integral: ∫₀²π 1 · 1 dt = 2π ≈ 6.283185

Try this example in the calculator above to verify!

Example 2: Work Done by a Vector Field

Problem: Compute ∫C ⟨y, −x⟩ · dr around the unit circle (counterclockwise).

  1. F = ⟨y, −x⟩, r(t) = ⟨cos(t), sin(t)⟩, t ∈ [0, 2π]
  2. r'(t) = ⟨−sin(t), cos(t)⟩
  3. F · r' = sin(t)(−sin(t)) + (−cos(t))(cos(t)) = −sin²(t) − cos²(t) = −1
  4. Integral: ∫₀²π (−1) dt = −2π ≈ −6.283185

The negative result means the field opposes the direction of travel. This is a non-conservative field (∂P/∂y = 1 ≠ −1 = ∂Q/∂x).

Example 3: Conservative Field ∇(x²y)

Problem: Evaluate ∫C ⟨2xy, x²⟩ · dr along y = x from (0,0) to (1,1).

  1. F = ⟨2xy, x²⟩ = ∇(x²y), so F is conservative with φ(x,y) = x²y
  2. By the fundamental theorem: ∫C F · dr = φ(1,1) − φ(0,0) = 1 − 0 = 1
  3. The path doesn't matter — any curve from (0,0) to (1,1) gives the same answer

The calculator detects this as a conservative field and confirms the path-independent result.

Applications of Line Integrals in Physics and Engineering

Line integrals appear throughout physics, engineering, and applied mathematics whenever you need to accumulate a quantity along a curved path rather than a straight interval.

Line Integral Calculator: Work Done by a Force Field

In mechanics, the work done by a force F moving an object along path C equals W = ∫C F · dr. For a gravitational field, an electric field, or any position-dependent force, this vector line integral gives the exact energy transferred. Our line integral calculator handles these computations with numerical precision.

Circulation and Fluid Flow

In fluid dynamics, the circulation of a velocity field v around a closed curve C is Γ = ∮C v · dr. Positive circulation indicates counterclockwise rotation (vorticity). This connects to Green's theorem: Γ = ∬R (∂v₂/∂x − ∂v₁/∂y) dA, linking the line integral to the curl of the field.

Electromagnetic Applications

Faraday's law uses line integrals to express the electromotive force (EMF) around a loop: EMF = ∮C E · dr. Ampère's law similarly relates ∮C B · dr to the enclosed current. These fundamental laws of electromagnetism rely directly on vector line integral evaluation.

Mass and Center of Mass of Wires

For a wire with variable density ρ(x,y) bent along curve C, the total mass is M = ∫C ρ ds (a scalar line integral). The center of mass coordinates involve ∫C x·ρ ds and ∫C y·ρ ds divided by M. These calculations require the arc length element ds that our calculator computes automatically.

Green's Theorem, Stokes' Theorem, and Related Theorems

Line integrals connect to several fundamental theorems of vector calculus that allow conversion between different types of integrals:

  • Fundamental Theorem for Line Integrals: If F = ∇φ is conservative, then ∫C F · dr = φ(B) − φ(A). The line integral depends only on endpoints.
  • Green's Theorem: For a closed curve C bounding region R: ∮C (P dx + Q dy) = ∬R (∂Q/∂x − ∂P/∂y) dA. This converts a line integral to a double integral.
  • Stokes' Theorem: Generalizes Green's theorem to 3D: ∬S (∇ × F) · dS = ∮C F · dr. A surface integral of the curl equals the line integral around the boundary.

For surface integral problems that connect to line integrals via Stokes' theorem, try our surface integral calculator. For the double integrals that appear in Green's theorem applications, our double integral calculator provides step-by-step solutions. For comprehensive vector calculus theory, MIT's Multivariable Calculus course offers rigorous foundations.

Line Integral Calculator Features Summary

Our line integral solver provides a complete computational toolkit for path integration problems in vector calculus courses and real-world applications:

  • Dual mode: Both scalar line integrals (∫C f ds) and vector line integrals (∫C F · dr)
  • 2D and 3D support: Handle planar curves and space curves including helices
  • Conservative field detection: Automatically checks ∂P/∂y vs. ∂Q/∂x and notes path independence
  • Step-by-step solutions: Shows parametrization, endpoints, derivative computation, and final evaluation
  • Flexible input: Supports sin, cos, sqrt, exp, log, pi, and exponentiation (^)
  • Numerical methods: Simpson's rule and trapezoidal rule with configurable subdivisions
  • Built-in examples: Six pre-loaded problems covering circles, parabolas, conservative fields, and 3D helices
  • Copy results: One-click copy of the complete solution with all steps

Bookmark this line integral calculator for your vector calculus coursework, physics problem sets, and engineering applications. For related tools, explore our integral calculator for single-variable integration and our triple integral calculator for volume integrals.

Frequently Asked Questions

Still Have Questions?

The detailed content on this page provides comprehensive explanations and examples to help you understand better.