Line Integral Calculator

Numerically evaluate scalar (∫ f ds) and vector (∫ F · dr) line integrals over a parametrized curve in 2D or 3D. Enter your field, the parametrization x(t), y(t), z(t), and the bounds to get the value instantly. Free, no account, no paywall.

Results are numerical approximations, not exact symbolic answers. They are valid for smooth (C1) parametrizations: a continuously differentiable curve traced once, with no corners and no field singularities on the path.

Used when type is Scalar field

Used when type is Vector field / work

Two values separated by a comma. Each may use pi and e, e.g. 0, 2*pi.

Line integral

Line integral value 2

Integral computed
Scalar line integral ∫_C f ds (2D)
Integration bounds
t = 0 to t = 1.570796327
Subdivisions used
1000

Integrand in t (setup shown back to you): f(r(t)) · ||r'(t)|| with f = x + y, x = cos(t), y = sin(t), ||r'(t)|| = sqrt(x'(t)^2 + y'(t)^2)

Computed by composite Simpson's rule with central-difference derivatives. The value is a numerical approximation valid for a smooth parametrization.

This tool gives you a numerical answer for a line integral over a curve you describe yourself. A line integral adds up the values of a field along a curve, not along a flat interval. You pick the type of integral, type the field and the curve, set the bounds, and read the value. It runs in your browser, so there’s no account and no paywall. Because it works numerically, the result is a very close approximation, not an exact symbolic formula.

How to use this calculator

  1. Pick the type of line integral. Choose a scalar field ∫ f ds for things like mass or average value along a curve, or a vector field ∫ F · dr for the work done by a force field.
  2. Enter your field. For a scalar integral, type f as a function of x, y, and z. For a vector integral, type the components P, Q, and R.
  3. Describe the curve with a parametrization: x(t), y(t), and z(t) if the curve is three-dimensional. Use plain math like cos(t), t^2, sqrt, pi, and e. Leave z(t) blank for a flat 2D curve.
  4. Enter the bounds for t as two numbers separated by a comma, for example 0, pi/2.
  5. Set the number of subdivisions if you want. The default of 1000 is accurate for smooth curves. More subdivisions give a more accurate value.
  6. Select Calculate. You’ll see the value, the integral type, the integrand in t, and the bounds, so you can check the setup.

How it works

A line integral comes in two kinds, and this tool handles both. To compute either one, you describe the curve C with a parametrization: a set of formulas x(t) and y(t), plus z(t) in 3D, that trace the path as the parameter t runs from a lower bound to an upper bound.

A scalar line integral, written ∫_C f ds, is the line integral with respect to arc length. It multiplies the field value f at each point by the local arc length and works out as ∫ f(r(t)) · ||r’(t)|| dt. Here ||r’(t)|| is the length of the velocity vector, sqrt(x’(t)^2 + y’(t)^2) in 2D and sqrt(x’(t)^2 + y’(t)^2 + z’(t)^2) in 3D. That factor measures how fast the point moves along the curve. This definition matches Paul’s Online Math Notes on scalar line integrals and OpenStax Calculus Volume 3.

A vector line integral, written ∫_C F · dr, is the work done by a vector field F along the curve. With components P and Q it works out as ∫ [P·x’(t) + Q·y’(t)] dt, and in 3D it gains an R·z’(t) term. This is the same as ∫_C P dx + Q dy + R dz, the form used in Paul’s Online Math Notes on line integrals of vector fields and Mathematics LibreTexts.

The method is numerical, not symbolic. The tool substitutes your parametrization into the integral, then estimates each derivative x’(t), y’(t), and z’(t) with a central finite difference, a standard approximation that uses values at t plus and minus a tiny step. It then evaluates the resulting single integral in t with composite Simpson’s rule, which fits parabolas to the curve in chunks and adds the areas. That rule comes from a numerical analysis reference on composite Simpson’s rule. The default of 1000 subdivisions is accurate to many decimal places for smooth fields and curves. Because the answer is computed this way, it’s a very close approximation rather than an exact value, and it assumes the curve is smooth on the interval: a continuously differentiable path with no corners and no field singularities along the way.

Examples

These cases match the values the calculator returns, so you can check your own setup against them. Each one has a known exact answer worked out by hand.

If you set the scalar mode with f = x + y over the quarter circle x = cos(t), y = sin(t) for t from 0 to pi/2, the tool returns 2. On the unit circle the speed ||r’(t)|| equals 1, so the integral reduces to ∫ (cos t + sin t) dt from 0 to pi/2, which is exactly 2.

If you set the vector mode with F = (-y, x) over that same quarter circle, the tool returns about 1.5707963, which is pi/2. Along this path F · r’ simplifies to 1, so the work equals the parameter length pi/2.

If you set the scalar mode with f = 1 over the helix x = cos(t), y = sin(t), z = t for t from 0 to 2*pi, the tool returns about 8.885766, which is the arc length of the helix. The speed is sqrt(2) at every point, so the length is 2·pi·sqrt(2).

If you set the vector mode with F = (z, x, y) over that same helix for t from 0 to 2*pi, the tool returns about 9.424778, which is 3·pi. This is the work done by the field as the point climbs the helix once.

Scalar line integral vs vector (work) line integral

This calculator offers two modes, and they answer different questions. Picking the right one starts with what you want to measure along the curve.

Use the scalar mode, ∫_C f ds, when you have one scalar field and want to add it up against arc length. It fits totals like the mass of a wire with density f, the area of a curtain under a surface, or the average value of f along a path. The answer does not depend on which way you travel the curve, because arc length is always positive (OpenStax Calculus Volume 3). In the tool you fill in the single field f.

Use the vector mode, ∫_C F · dr, when you have a vector field and want its component along the direction of travel. This gives the work done by a force field as an object moves along the curve, or the circulation of a flow. Reversing the curve flips the sign of the answer, since reversing the direction reverses the velocity vector (Mathematics LibreTexts, 4.3 Line Integrals). In the tool you fill in the components P and Q, plus R for a 3D field.

A short way to choose:

Where the formula comes from: ds = ||r’(t)|| dt

Both modes rest on one idea: describe the curve with a parametrization, then turn the line integral into an ordinary integral in the parameter t. The tool runs this in three steps (OpenStax Calculus Volume 3).

First, write the curve C as r(t) = (x(t), y(t)) in 2D, or r(t) = (x(t), y(t), z(t)) in 3D, with t running from a lower bound a to an upper bound b. Here r(t) is the position of a point on the curve at parameter t.

Second, find the arc-length element. As t advances by a small amount, the point moves a small distance ds along the curve, and that distance is ds = ||r’(t)|| dt. The factor ||r’(t)|| is the length of the velocity vector r’(t), which is sqrt(x’(t)^2 + y’(t)^2) in 2D and sqrt(x’(t)^2 + y’(t)^2 + z’(t)^2) in 3D. Substituting this turns the scalar integral ∫_C f ds into ∫_a^b f(r(t)) · ||r’(t)|| dt (Line integral, Wikipedia).

Third, do the same for a vector field. Since dr = r’(t) dt, the vector integral ∫_C F · dr becomes ∫_a^b F(r(t)) · r’(t) dt, which works out to ∫_a^b [P·x’(t) + Q·y’(t)] dt in 2D, plus an R·z’(t) term in 3D.

Here is the scalar version in numbers. Take f = x over the segment from (0,0) to (1,1), parametrized as x(t) = t, y(t) = t for t from 0 to 1. Then r’(t) = (1, 1), so ||r’(t)|| = sqrt(2), and f(r(t)) = t. The integral is ∫_0^1 t · sqrt(2) dt = sqrt(2)/2, about 0.7071. The tool returns the same value.

How to parametrize common curves

Before you can run either mode, you need x(t), y(t), and z(t) for your curve, plus bounds for t. This table maps the curves you meet most often to the formulas you type into the tool (OpenStax Calculus Volume 3, Parametric Equations).

Curvex(t)y(t)z(t)Bounds for t
Line segment from A to BA_x + t·(B_x - A_x)A_y + t·(B_y - A_y)A_z + t·(B_z - A_z)0, 1
Circle of radius a, centered at origina·cos(t)a·sin(t)(leave blank)0, 2*pi
Ellipse with half-widths a and ba·cos(t)b·sin(t)(leave blank)0, 2*pi
Helix of radius 1cos(t)sin(t)t0, 2*pi

Pick the bounds so that t traces the curve exactly once. A full circle or ellipse runs from 0 to 2*pi; a quarter of it runs from 0 to pi/2. For a segment, t from 0 to 1 moves straight from point A to point B. Leave z(t) blank for a flat 2D curve, and the tool ignores the third dimension.

What a numerical line integral can and cannot do

This tool returns a decimal, not a symbolic formula, and that is a deliberate choice. It evaluates the integral with composite Simpson’s rule, a numerical method that fits parabolas to the integrand in small chunks and adds up their areas (Numerical integration, Wikipedia). The payoff is reach: many integrands, such as one built from exp(-x^2), have no antiderivative you can write in elementary functions, so a numeric value is the only practical answer.

The method does have limits. It assumes a smooth parametrization on [a, b]: a continuously differentiable path that is traced once, with no sharp corners and no point where the field blows up. A corner or a division by zero on the path can throw the estimate off (Numerical integration, Wikipedia). If your curve has a corner, split it into smooth pieces, run each piece on its own, and add the results.

When the answer matters to many decimal places, raise the number of subdivisions. More subdivisions shrink the error, so the decimal you read settles closer to the exact value. For smooth fields and curves, the default of 1000 subdivisions is already accurate well past what most homework needs.

What the data says

Most people who land here can write the integral sign but stall a step earlier, on turning the curve into x(t) and y(t), or on a nagging worry: would reversing the direction change the answer? Those two snags, parametrizing and orientation, are where the work really lives, and they are well documented in the math-education research.

Part of the trouble is carried over from first-year calculus. A conceptual study of how students reason about line integrals found that the familiar picture of area under a curve does not transfer to the vector case, which is why learners often reason inconsistently from one piece of the integral to the next (Jones, Journal of Mathematical Behavior). The arc-length weight ||r’(t)|| has no counterpart in the flat-interval integral, so the old intuition quietly misfires.

Before the numbers, it helps to remember what a line integral is for. As MIT’s Denis Auroux frames it:

“The field does work as it moves a mass along a curve. We will learn to express this work as a line integral and to compute its value.”

Prof. Denis Auroux, Department of Mathematics, MIT, in 18.02SC Multivariable Calculus.

Computing the value is only half the task. Research on second-year students found they were skilled at running the calculation but struggled to say what the result meant physically, a compute-versus-interpret gap (Bollen et al., KU Leuven). That is the case for pairing a numeric answer with a plain-language read of the setup, which is why this tool shows the integrand in t next to the value. It also explains why the method is numerical: many line integrals have no elementary antiderivative, so they are evaluated with quadrature rules such as the trapezoidal rule, Simpson’s rule, and Gauss-Legendre (NIST Digital Library of Mathematical Functions).

What this tool does that others don’t

Frequently asked questions

Is there a free line integral calculator?

Yes. This tool evaluates both scalar (∫ f ds) and vector (∫ F · dr) line integrals over a curve you describe with a parametrization, in 2D or 3D, with no account and no paywall. It returns the numeric value right away, along with the integrand in t so you can check the setup.

How do you calculate a line integral?

You convert the line integral into an ordinary integral in one parameter. First write the curve as a parametrization r(t). For a scalar integral, multiply the field by the speed: ∫ f(r(t)) · ||r’(t)|| dt. For a vector integral, dot the field with the velocity: ∫ F(r(t)) · r’(t) dt. Then integrate over t from the lower bound to the upper bound. This tool does that substitution for you and evaluates the result numerically.

What is the difference between a scalar and a vector line integral?

A scalar line integral, ∫_C f ds, integrates a single field f against arc length, so it’s used for quantities like mass, average value, or a total along a wire. A vector line integral, ∫_C F · dr, integrates the component of a vector field along the direction of travel, which gives the work done by a force field. This tool computes both; you just switch the mode.

What does ds mean in a line integral?

ds is the element of arc length along the curve. When you parametrize the curve as r(t), it becomes ds = ||r’(t)|| dt, which is sqrt(x’(t)^2 + y’(t)^2) dt in 2D, with an extra z’(t)^2 term inside the root in 3D. That factor is why a scalar line integral over a curve differs from an ordinary integral: it weights f by how fast the point moves along the path.

How do you parametrize the curve?

Write each coordinate as a function of one parameter t. A unit circle is x(t) = cos(t), y(t) = sin(t) for t from 0 to 2pi. A straight segment from (0,0) to (3,4) is x(t) = 3t, y(t) = 4t for t from 0 to 1. A helix is x(t) = cos(t), y(t) = sin(t), z(t) = t. Choose the bounds so that t traces the curve exactly once.

How does the calculator compute the answer?

It does not do symbolic algebra. It substitutes your parametrization into the line-integral formula, estimates each derivative x’(t), y’(t), and z’(t) with a central finite difference, then evaluates the resulting integral in t using composite Simpson’s rule over the number of subdivisions you set, 1000 by default. Both steps follow standard numerical analysis.

Why is the answer an approximation and not an exact value?

The tool evaluates the integral numerically rather than finding a closed-form antiderivative, so it returns a very close decimal approximation instead of an exact symbolic expression. For smooth fields and curves the default 1000 subdivisions are accurate to many decimal places. If you need more precision, raise the number of subdivisions.

Can it do line integrals in three dimensions?

Yes. Fill in z(t), and for a vector field the third component R, and the curve is treated as 3D. The arc-length factor becomes sqrt(x’(t)^2 + y’(t)^2 + z’(t)^2), and the vector integral gains an R·z’(t) term, matching the standard 3D formulas. Leave z(t) blank for a flat 2D curve.

Does the direction you traverse the curve matter?

For a scalar line integral ∫_C f ds the answer does not depend on direction, because arc length is always positive. For a vector line integral ∫_C F · dr the answer flips sign when you reverse the direction, since reversing the parametrization reverses r’(t). To reverse a curve, swap the bounds or replace t with a value that runs the other way.

Sources