Skip to main content

Line Integral Calculator

Numerically evaluate a scalar or vector line integral along a parametric curve, with the curve's arc length and a conservative-field (curl) check for vector fields.

Input

The curve C, parametrized by t — mathjs syntax: ^ for powers, sqrt(), sin(), cos(), etc.

A number or constant expression, e.g. 2*pi.

The scalar field to integrate with respect to arc length.

Output

Step-by-Step Details
Was this helpful?

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/line-integral-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "scalar",
    "dimension": "2d",
    "xt": "cos(t)",
    "yt": "sin(t)",
    "zt": "0",
    "t0": "0",
    "t1": "2*pi",
    "f": "x^2 + y^2",
    "p": "-y",
    "q": "x",
    "r": "0"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `line-integral-calculator` tool (Line Integral Calculator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/line-integral-calculator/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="Line Integral Calculator — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per API/MCP callFrom 5 credits
Need more credits?View pricing

Also available with

Guides

The Line Integral Calculator numerically evaluates a line integral along a parametric curve C: r(t) = (x(t), y(t)[, z(t)]), t ∈ [t0, t1] — either a scalar field integral ∫_C f ds (with respect to arc length) or a vector field integral ∫_C F · dr (with respect to displacement along the curve). Alongside the numeric result it reports the curve's arc length over the same interval and, for vector fields, a conservative-field check based on the curl of F.

It's built for vector calculus students checking a homework answer, and for anyone who needs a fast numeric line integral without setting up the substitution by hand.

How to use it

  1. Choose the Integral type: scalar field (∫ f ds) or vector field (∫ F · dr).
  2. Choose the Curve dimension: 2D or 3D.
  3. Enter the curve's parametrization: x(t), y(t), and (in 3D) z(t) — standard math notation works: ^ for powers, * for multiplication, plus sqrt(), sin(), cos(), log(), and the other functions supported by mathjs's expression parser.
  4. Enter the t lower bound (t0) and t upper bound (t1) — these accept constant expressions too, such as 2*pi, not just plain numbers.
  5. For a scalar field, enter f(x, y[, z]). For a vector field, enter its components P(x, y[, z]), Q(x, y[, z]), and (in 3D) R(x, y, z).
  6. Read the integral result (∫_C f ds or ∫_C F · dr), Arc Length, and — for vector fields — Conservative Field?. Step-by-Step Details shows dx/dt, dy/dt (and dz/dt in 3D), the integral setup, and the curl computation.

Results update automatically as you type. For example, the vector field F = (-y, x) around the unit circle (cos(t), sin(t)), t ∈ [0, 2π], returns a line integral of 6.28319 and is flagged not conservative.

How is the integral computed?

dx/dt, dy/dt, and dz/dt are found symbolically by differentiating x(t), y(t), and z(t). The curve, its derivative, and the field are then evaluated at 1001 evenly spaced points across [t0, t1] and combined with composite Simpson's rule — for a scalar field, integrating f(r(t)) · |r′(t)| dt; for a vector field, integrating [P dx/dt + Q dy/dt (+ R dz/dt)] dt. The same grid and rule compute the arc length, ∫ |r′(t)| dt.

What is the conservative-field check?

For a vector field F = (P, Q[, R]), the calculator computes the curl of F symbolically (∂Q/∂x − ∂P/∂y in 2D; the full curl vector in 3D) and checks whether it simplifies identically to zero. If it does, F appears conservative — the line integral between two points doesn't depend on the path taken between them, only on the endpoints. This partial-derivative test is a necessary but not sufficient condition on a domain with a hole or singularity (e.g. the origin removed from the plane), so treat a "conservative" verdict as strong evidence, not an absolute guarantee, on such domains.

What functions can I enter?

Anything mathjs's expression evaluator understands: polynomials, trigonometric functions (sin, cos, tan), roots and logarithms (sqrt(), log()), and combinations of these. Use t as the curve's parameter and x, y, z as the field's variables. Angles are in radians by default — write pi for π.

To find the curl of a 3D vector field at a single point directly, see the Curl Calculator; for a double integral over a rectangular region instead of along a curve, see the Double Integral Calculator.

Privacy

This calculator runs entirely in your browser. Your curve, field, and bounds are never uploaded, logged, or stored — the computation happens locally on your device.

line integralpath integralcontour integralvector field integralarc length calculatorconservative vector fieldcurl of a vector fieldparametric curve calculatorgreen's theoremvector calculus

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.