Vector calculusFree · No sign-up

Line Integral Calculator

This line integral calculator finds the work ∫F·dr of a vector field or the scalar integral ∫f ds along a 2D or 3D parametric curve, with every step and a picture of the path. A line integral adds up a function or the push of a field along a curve; students and engineers use it for work, circulation, wire mass and arc length in Calculus III and physics.

See the path
  • Vector (work) and scalar (mass) types
  • Conservative check + potential
  • Green's theorem on closed curves
2D + 3D
curves
3
independent checks
8
ready-made examples
Line integral engine
Type
Space
Vector field F = ⟨P, Q⟩
P =
Q =
Curve r(t) or pick one below
x(t) =
y(t) =
t from
to
Preview
—Full solution ↓

Results

Your line integral, along the path

Green parts of the path push with the field (F·T > 0) and orange parts push against it. For ∫f ds the curtain shows f above the curve; its area is the integral.

Interactive diagram

Path and field

with F·T > 0against F·T < 0
t—
integrand at t—
integral so far—

Line integral

Integral in t

Step-by-step solution

—

    Step by step

    How to Use the Line Integral Calculator

    To use the line integral calculator, follow these 5 steps. The value and the picture update as you type.

    1. 1

      Pick the type and the space

      ∫F·dr for work or circulation, ∫f ds for mass or curtain area; 2D or 3D.

    2. 2

      Type the field or the function

      For example P = -y, Q = x, or f = x*y.

    3. 3

      Describe the curve

      Type x(t), y(t) (and z(t)) with the range of t, or tap a common curve.

    4. 4

      Read the value and the checks

      See the integral in t, the potential function shortcut and Green's theorem when they apply.

    5. 5

      Walk along the path

      Move the point to see the field there and the running total of the integral.

    Try an example:

    Definition

    What Is a Line Integral?

    A line integral is an integral taken along a curve instead of along an interval, adding up the values of a function or the push of a vector field at every point of the curve. Line integrals are called path integrals, curve integrals or contour integrals, and the curve C is called the path.

    There are 2 types of line integrals:

    • Scalar line integral ∫C f ds: a scalar field f weighted by arc length, for the mass of a wire or the area of a curtain.
    • Vector line integral ∫C F · dr: the tangential part of a vector field F, for the work done by a force or the circulation of a flow.

    Both types turn into an ordinary definite integral in t once the curve is written as a parametric curve r(t), a ≤ t ≤ b. The arc length element is ds = |r′(t)| dt, and the vector element is dr = r′(t) dt, the velocity vector times dt.

    Line integrals belong to Calculus III (multivariable calculus) and vector calculus, next to double, triple and surface integrals.

    Accumulation explorer: the integral builds up as the point moves along the curve
    point r(t)—
    work so far ∫ F · dr—
    length so far ∫ ds—
    curve, field(t, t²), ⟨x², xy⟩

    The traced part of the curve turns orange where F points along the motion (F · T > 0) and teal where F points against it. At t = 1, the work is 11/15 ≈ 0.7333 and the length is 1.4789.

    Types of line integrals
    TypeNotationParametric formMeasures
    Scalarmass, curtain area, arc length (f = 1)
    Vector (work)work of a force
    Circulationclosed curve, r(a) = r(b)flow around a loop
    Flux across a curveflow out through a loop
    Complex (contour)

    ∫ f ds

    Scalar Line Integral ∫ f ds

    The scalar line integral adds up a scalar field f along a curve, with each piece weighted by its arc length ds; the direction of travel does not matter.

    01

    Formula With a Parametrized Curve

    For a curve r(t) = (x(t), y(t), z(t)), a ≤ t ≤ b, the scalar line integral is:

    The square root is the speed |r′(t)|, so ds = speed × dt. With f = 1, the integral is the arc length of C: the segment from (1, 2) to (4, 6) has length √(3² + 4²) = 5.

    02

    Mass of a Wire and Curtain Area

    A scalar line integral gives the mass of a wire, when f is the density δ, and the area of a curtain, when f is its height.

    • Mass: m = ∫C δ ds. The quarter circle with δ = xy has mass ∫ cos t sin t dt = 1/2.
    • Curtain: the area of the surface between C and the graph of f. Over the half circle of radius 2 with height 1 + y, the area is ∫₀^π (1 + 2 sin t) · 2 dt = 2π + 8 ≈ 14.2832.
    Curtain under f = 1 + y along a half circle of radius 2 (drag to rotate)
    curve(2 cos t, 2 sin t), 0 ≤ t ≤ π
    area ∫ f ds2π + 8 ≈ 14.2832

    The base curve sits in the xy-plane (dark) and the top edge follows the height 1 + y (orange). The speed |r′(t)| = 2, so ds = 2 dt.

    ∫ F · dr

    Vector Line Integral ∫ F · dr

    The vector line integral adds up the dot product of a vector field F with the tangent direction of the curve, so only the part of F along the curve counts.

    03

    Work Done by a Force Field

    The work done by a force field F moving an object along C is W = ∫C F · dr. In parametric form and in differential form:

    F · dr = |F| cos θ ds, with θ the angle between F and the tangent vector T. Work is positive where F points with the motion, negative where it points against it, and 0 where F is perpendicular to the path. Units: newton-metres, or joules (J).

    04

    Circulation Around a Closed Curve

    Circulation is the vector line integral around a closed curve, written ∮C F · dr. It measures how much F flows around the loop. For F = ⟨−y, x⟩ and a circle of radius r, F · T = r at every point, so the circulation is r × 2πr = 2πr². A conservative field has circulation 0 around every closed curve.

    Work explorer: F = ⟨−y, x⟩ along an arc of a circle
    work = r² × angle—
    F · T on the circle—

    —. F is tangent to every circle around the origin, so the whole arc is orange and the work grows steadily with the angle.

    Method

    How to Evaluate a Line Integral in 4 Steps

    To evaluate a line integral, parametrize the curve, differentiate the parametrization, substitute into the integrand, and integrate in t. The 4 steps below find ∫C F · dr for F = ⟨x², xy⟩ along y = x² from (0, 0) to (1, 1).

    01

    Parametrize the curve

    To parametrize y = x², let x = t:

    02

    Find r′(t)

    To get dr, differentiate each component:

    For ∫ f ds, use the speed |r′(t)| = √(1 + 4t²) here.

    03

    Substitute and take the dot product

    To substitute, replace x by t and y by t²:

    04

    Integrate in t

    To finish, integrate over 0 ≤ t ≤ 1:

    ≈ 0.7333.

    Parametric equations

    How to Parametrize Common Curves (Segment, Circle, Parabola, Helix)

    To parametrize a curve, write x, y and z as functions of one parameter t on an interval [a, b], with r(a) at the start and r(b) at the end of the path.

    Parametrizations of common curves
    Curver(t)t rangeSpeed |r′(t)|
    Segment P → Q(1 − t)P + tQ[0, 1]|Q − P|
    Circle, centre (h, k), radius R(h + R cos t, k + R sin t)[0, 2π]R
    Ellipse(a cos t, b sin t)[0, 2π]
    Parabola y = x²(t, t²)[x₀, x₁]
    Graph y = g(x)(t, g(t))[x₀, x₁]
    Helix(R cos t, R sin t, ct)[0, 2πn]

    Equal steps in t do not always give equal steps along the curve. The gallery marks 9 equally spaced values of t on each curve; the gap between dots is the speed |r′(t)| times the step.

    iSplit a piecewise curve, such as a triangle or a square, into smooth pieces, parametrize each piece, and add the integrals. In the calculator, enter x(t), y(t) and, for a 3D curve, z(t), then the limits a and b; pi, sqrt and the usual functions are accepted.
    Curve gallery: 9 equally spaced values of t on each curve (drag to rotate)
    parametrization—
    arc length ∫ ds—

    Teal dot: t = a. Red dot: t = b. Equal steps in t give equal steps in arc length only when the speed |r′(t)| is constant: on the parabola, the dots spread out as the curve steepens.

    Direction

    Orientation: Why Reversing the Curve Flips the Sign

    Reversing the curve flips the sign of a vector line integral, since every tangent vector r′(t) points the other way: ∫−C F · dr = −∫C F · dr. A scalar line integral does not change, since ds = |r′(t)| dt stays positive: ∫−C f ds = ∫C f ds.

    • Forward, (0, 0) → (1, 1): ∫ ⟨x², xy⟩ · dr = 11/15.
    • Backward, r(t) = (1 − t, (1 − t)²): the same path, −11/15.

    The speed of travel does not matter, only the direction. The reparametrization r(t) = (t², t⁴), 0 ≤ t ≤ 1, covers the same parabola in the same direction and gives the same 11/15.

    Closed curves follow a convention: positive orientation is counterclockwise, with the enclosed region on the left. Green's theorem and Stokes' theorem both use this direction.

    Orientation explorer: the same parabola in both directions
    direction—
    ∫ F · dr—
    ∫ ds (length)—
    field⟨x², xy⟩

    Backward, every piece of the curve swaps colour: F now points against the motion, and the work changes sign. The length stays 1.4789.

    Path independence

    Fundamental Theorem for Line Integrals (Path Independence)

    The Fundamental Theorem of Line Integrals states that for a conservative field F = ∇f, the line integral from A to B equals the change in the potential function: ∫C ∇f · dr = f(B) − f(A).

    The result depends only on the endpoints, so every path from A to B gives the same value, and every closed curve gives 0. For F = ⟨sin y, x cos y + y⟩, the potential is f = x sin y + y²/2, and the work from (0, 0) to (2, π/2) is 2 + π²/8 ≈ 3.2337 on every path.

    There are 3 tests for a conservative field on a simply connected domain:

    • 2D: ∂Q/∂x = ∂P/∂y.
    • 3D: curl F = ∇ × F = 0.
    • Direct: a potential f with ∇f = F exists.

    The calculator runs the curl test on every vector problem; when it finds a polynomial potential f as well, it shows f and the shortcut f(B) − f(A) next to the direct integral. Curl and potentials are covered in depth by the curl calculator.

    Path explorer: 3 paths from A = (0, 0) to B = (2, π/2)
    ∫ F · dr on this path—
    f(B) − f(A)—

    Conservative field: all 3 paths give 3.2337, and the green curves are the level curves of f. Rotation field: the straight path gives 0, the L-shaped path gives π ≈ 3.1416, and the arc gives yet another value; no potential exists.

    Closed curves

    Green's Theorem for Closed Curves

    Green's theorem turns the line integral around a positively oriented, simple closed curve C into a double integral over the region D inside it.

    The theorem works in both directions. A hard line integral becomes an easy double integral, and an area becomes a line integral: with F = ⟨−y, x⟩, ∂Q/∂x − ∂P/∂y = 2, so the area of D is ½ ∮ (x dy − y dx).

    • Ellipse x = 2 cos t, y = sin t: ∮ ⟨−y, x⟩ · dr = 2 × area = 2 × 2π = 4π ≈ 12.566.
    • F = ⟨x², xy⟩ on a circle: ∂Q/∂x − ∂P/∂y = y, so the circulation equals ∬ y dA, the y-coordinate of the centre times the area.

    The calculator applies the check on closed 2D curves with a constant scalar curl: it multiplies the curl by the enclosed area and compares the product with the direct integral. The double integral side is covered by the double integral calculator; the 3D version, Stokes' theorem, uses a surface integral.

    Green's theorem explorer: ∮ F · dr = ∬ (Qx − Py) dA
    line integral ∮ F · dr—
    double integral ∬ curl dA—

    F = ⟨x², xy⟩. Shading shows the scalar curl Qx − Py. Move the circle: the 2 totals stay equal. For ⟨x², xy⟩, both equal the centre's y times the area πr².

    Practice

    Worked Examples

    There are 4 worked examples below: a circulation, work along a parabola, a 3D helix and the mass of a wire. Each one loads into the calculator with one click.

    circulation

    Circulation of ⟨−y, x⟩ Around the Unit Circle = 2π

    1. Curve:
    2. Derivative:
    3. Dot product:
    4. Integrate:

    Answer: . Green's theorem agrees: curl 2 × area π = 2π.

    work

    Work Along a Parabola

    F = ⟨x², xy⟩ along y = x² from (0, 0) to (1, 1).

    1. Curve:
    2. Field on the curve:
    3. Dot product:
    4. Integrate:

    Answer: . The field is not conservative (Qx − Py = y), so a different path between the same points gives a different work.

    3D

    Line Integral Along a Helix

    F = ⟨−y, x, z⟩ along r(t) = (cos t, sin t, t), 0 ≤ t ≤ 2π.

    1. Derivative:
    2. Field on the curve:
    3. Dot product:
    4. Integrate:

    Answer: . The 2π comes from the turning and the 2π² from the climb in z.

    scalar

    Mass of a Quarter-Circle Wire

    Density δ = xy along the unit circle from (1, 0) to (0, 1).

    1. Curve:
    2. Speed:
    3. Integrand:
    4. Integrate:

    Answer: unit of mass. The wire is heaviest at 45°, where xy = ½, and weightless at both ends.

    Wolfram Alpha, Symbolab and eMathHelp evaluate line integrals as text; GeoGebra and Desmos draw the parametric curve, and Mathematica and MATLAB integrate the parametric form. This line integral calculator combines the exact answer, the steps, the potential-function shortcut and the Green's theorem check with a picture of the path.

    Questions

    Frequently Asked Questions

    What is the difference between ds and dr?

    The difference is that ds is a scalar arc length element, ds = |r′(t)| dt, while dr is a vector element, dr = r′(t) dt, that points along the curve. ds goes with scalar line integrals ∫ f ds, such as mass and arc length; dr goes with vector line integrals ∫ F · dr, such as work. The 2 are linked by dr = T ds, with T the unit tangent vector.

    Does the parametrization change the answer?

    No, the parametrization does not change the answer, as long as it traces the same curve once in the same direction. r(t) = (t, t²) and r(t) = (t², t⁴), 0 ≤ t ≤ 1, both give 11/15 for F = ⟨x², xy⟩. Reversing the direction flips the sign of a vector line integral, and tracing the curve twice doubles it; a scalar line integral ignores the direction.

    When is a line integral path-independent?

    A line integral is path-independent when the vector field is conservative, F = ∇f, for a potential function f. On a simply connected domain, the test is ∂Q/∂x = ∂P/∂y in 2D or curl F = 0 in 3D. The integral then equals f(B) − f(A): for F = ⟨2xy, x²⟩ with f = x²y, every path from (0, 0) to (1, 1) gives 1.

    What does a closed-curve line integral of 0 mean?

    A closed-curve line integral of 0 means the field does no net work around that loop: the positive and negative contributions cancel. When the integral is 0 around every closed curve, the field is conservative and path-independent. A single zero loop proves less: ⟨x², xy⟩ around a circle centred on the x-axis gives 0, but the field is not conservative.

    Can a line integral be negative?

    Yes, a vector line integral is negative when the field points mostly against the direction of travel. Reversing the curve flips the sign: ⟨x², xy⟩ along y = x² gives 11/15 from (0, 0) to (1, 1) and −11/15 back. A scalar line integral ∫ f ds is negative only when f is negative along the curve, since ds is always positive.

    This line integral calculator evaluates ∫F·dr and ∫f ds along 2D and 3D curves with steps, a potential function shortcut and a Green's theorem check.