Calculus, Linear Algebra & Discrete Math Integrals & Applications of Integration Arc-length integral; composite Simpson quadrature

Arc Length of a Curve Calculator (Integral Form)

Give this calculator a curve — explicitly as y = f(x), parametrically as x(t) and y(t), or in polar form as r(θ) — together with its limits, and it evaluates the arc-length integral numerically. You get the length, the integrand it built, the straight-line chord between the endpoints, the ratio of the two (the sinuosity), and an estimate of the quadrature error. Most arc-length integrands have no elementary antiderivative, so numerical evaluation is not a shortcut here; it is the normal method.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
How the curve is givenChoose the form your curve is written in; the integrand changes with it.Explicit — y = f(x)
f(x)Used in explicit mode. Variable x. Available: + - * / ^, sin, cos, tan, exp, ln, sqrt, abs, sinh, cosh, pi, e.x^2
x(t)Used in parametric mode. Variable t.cos(t)
y(t)Used in parametric mode. Variable t.sin(t)
r(θ)Used in polar mode. Write the polar angle as t, so r = 1 + cos(t) is a cardioid.1 + cos(t)
Lower limitStart of x, t or θ depending on the mode.0
Upper limitEnd of the parameter range. Use 6.283185 for a full turn in polar mode.1
Quadrature panelsNumber of Simpson panels. Raise it if the error estimate is not small enough.1000

It returns

  • Arc length — The length of the curve traced over the parameter range you entered.
  • Straight-line distance between the endpoints
  • Sinuosity (length ÷ chord) — 1 for a straight line; larger for a curve that wanders. Undefined when the curve returns to its start.
  • Mean value of the integrand
  • Estimated quadrature error — Richardson estimate from halving the panel count; it does not cover error from a singular integrand.

The formula

L=ab1+[f(x)]2dx
L=(dxdt)2+(dydt)2dt
L=r2+(drdθ)2dθ

In plain text: L = ∫ₐᵇ √(1 + [f'(x)]²) dx

  • LArc length of the curve over the stated range
  • f'(x)Slope of the curve; here computed by a Richardson-extrapolated central difference
  • a, bLimits of the parameter — x, t or θ depending on the form
  • r(θ)Polar radius as a function of the polar angle

All three forms are the same statement: the length element ds satisfies ds² = dx² + dy², and each form just expresses dx and dy in terms of its own parameter.

Updated Category Integrals & Applications of Integration Verified against published test cases Reading time 11 min

What the arc-length integral measures

Arc length is the distance you would travel walking along a curve, as opposed to the straight-line distance between its ends. The integral comes from a single geometric idea: over an infinitesimal step, a smooth curve is indistinguishable from a straight line, so Pythagoras applies. Writing ds for that tiny piece of length, ds² = dx² + dy², and the total length is the integral of ds.

Everything else is bookkeeping about which variable you integrate with respect to. Factor dx out of the square root and you get ds = √(1 + (dy/dx)²) dx, the explicit form. Factor dt out instead and you get the parametric form, whose integrand is the speed of a point tracing the curve. In polar coordinates, substituting x = r cos θ and y = r sin θ and simplifying leaves ds = √(r² + (dr/dθ)²) dθ, where the term is the distance swept by the angle and the (dr/dθ)² term is the movement in and out.

Arc length shows up wherever a physical length follows a path rather than a line: the developed length of a curved handrail, the material needed for a parabolic arch, the cable in a catenary span, the distance covered by a robot along a planned trajectory, the perimeter of a cam profile. In every case the number you want is the integral, not the chord.

Why the integral is almost always evaluated numerically

The arc-length integrand contains a square root of a sum of squares, and that construction almost never has an elementary antiderivative. The parabola y = x² is one of the few textbook curves that does — its length involves an inverse hyperbolic sine — and the ellipse famously does not, which is how the elliptic integrals got their name. Numerical quadrature is therefore the standard method rather than a fallback.

This calculator uses composite Simpson's rule. It splits the parameter range into an even number of panels, fits a parabola through each consecutive triple of integrand values, and adds the exact areas of those parabolas. The error falls like the fourth power of the panel width, so doubling the panel count cuts the error by roughly sixteen. The error estimate reported on the page is the difference between the full-panel and half-panel results divided by fifteen, which is the standard Richardson estimate for a fourth-order rule.

The derivatives inside the integrand are themselves numerical: a central difference with Richardson extrapolation, accurate to about twelve significant figures for a smooth function. That is comfortably below the quadrature error in ordinary use, so the reported error estimate is dominated by the quadrature, not the differentiation. Where the function has a kink or a vertical tangent, both estimates lose their meaning at once, and the calculator says so.

The sinuosity reported alongside the length is the ratio of arc length to the straight-line chord between the endpoints. It is exactly 1 for a straight segment and larger for anything that wanders, and it is undefined when the curve closes up so that the chord is zero. Geomorphologists use it to classify river channels; here it is a quick sanity check, because a value below 1 is impossible and signals an input error.

Worked example: the parabola y = x² from 0 to 1

This one has a closed form, so you can check every digit.

  1. Differentiate. f'(x) = 2x.
  2. Build the integrand. √(1 + (2x)²) = √(1 + 4x²). At x = 0 it is 1; at x = 1 it is √5 = 2.2360679775.
  3. Integrate. The standard antiderivative is ∫√(1 + 4x²)dx = x√(1+4x²)/2 + asinh(2x)/4. Evaluating at x = 1: the first term is √5/2 = 1.1180339887, and asinh(2) = ln(2 + √5) = ln(4.2360679775) = 1.4436354752, so the second term is 0.3609088688. At x = 0 both terms vanish.
  4. Add. L = 1.1180339887 + 0.3609088688 = 1.4789428575.
  5. Compare with the chord. The endpoints are (0, 0) and (1, 1), so the chord is √2 = 1.4142135624. The sinuosity is 1.4789428575 / 1.4142135624 = 1.0457634 — the curve is about 4.6% longer than the straight line between its ends.
  6. Sanity-check the size. The mean value of the integrand is 1.4789428575 / 1 = 1.4789, which sits between the integrand's endpoint values of 1 and 2.236 as it must, and closer to the low end because the curve is flat over most of the interval.

A crude two-segment polyline gives a useful lower bound: from (0,0) to (0.5, 0.25) is √0.3125 = 0.559017, and from (0.5, 0.25) to (1, 1) is √0.8125 = 0.901388, totalling 1.460405. Every inscribed polyline is shorter than the arc, and this one is already within 1.3% of it — a reminder that arc length is the supremum of inscribed polygonal lengths, which is where the integral comes from historically.

Reading the result and choosing the right form

Check three things before you trust a length. First, the sinuosity must be at least 1; if it is not, the endpoints or the limits are wrong. Second, the mean integrand must lie between the smallest and largest integrand values in the station table — that is guaranteed for a continuous integrand, so a violation means the quadrature has hit a singularity. Third, the estimated error should be several orders of magnitude below the length itself.

Choose the explicit form only when the curve passes the vertical line test over the whole range. A circle does not, which is why y = √(1 − x²) from −1 to 1 is a bad way to ask for half a circumference: the slope becomes infinite at both ends and the integrand diverges. The parametric form x = cos t, y = sin t has speed exactly 1 everywhere and integrates without effort. Whenever a curve has a vertical tangent, doubles back, or crosses itself, parametrise it.

In polar mode, watch what the range does. A cardioid r = 1 + cos θ is traced once over [0, 2π], but the rose r = cos 2θ is traced once over [0, 2π] while r = cos 3θ completes its whole shape in [0, π] and retraces it over the second half. Integrating over the wrong range gives an answer that is a whole multiple of the truth, and the calculator has no way to know you meant one traverse rather than two.

Finally, note that the reported length is a length of traverse, not of point set. If your parametrisation covers part of the curve twice, that part is counted twice — correctly, because the integral measures distance travelled. This is a feature when computing the path length of a moving particle and a trap when computing the perimeter of a shape.

Reference: arc lengths with known closed forms

Use these to check the calculator or your own work. Each closed form is standard.
CurveRangeClosed formLength
y = 3x0 to 44√1012.649110641
y = x²0 to 1√5/2 + ln(2+√5)/41.478942858
y = x^(3/2)0 to 1(13^1.5 − 8)/271.439709873
y = cosh x (catenary)0 to 1sinh 11.175201194
x = cos t, y = sin t0 to ππ3.141592654
r = 1 (circle)0 to 2π6.283185307
r = 1 + cos θ (cardioid)0 to 2π88.000000000
r = e^θ (log spiral)0 to 2π√2(e^(2π) − 1)755.899967

The catenary is the one curve whose arc-length integrand collapses: √(1 + sinh²x) = cosh x exactly, so its length is sinh b − sinh a. The cardioid's length of exactly 8 is a classic result and a good test of a polar implementation.

Assumptions, pitfalls and what this does not cover

  • A vertical tangent breaks the explicit form. The integrand contains f'(x)², which diverges. Reparametrise rather than adding panels; no amount of quadrature fixes an infinite integrand.
  • A corner is not smooth. The formula assumes a continuously differentiable curve. Split the range at the corner and add the two lengths.
  • Retraced arcs are counted twice. Check that your parameter range traces the curve exactly once if you want a perimeter rather than a distance travelled.
  • Polar mode measures the polar angle in radians. A full turn is 2π ≈ 6.283185, not 360.
  • This calculator works in the plane. A space curve needs √(x'² + y'² + z'²), which is the same idea with a third term.
  • The error estimate covers quadrature only. It says nothing about a singular integrand, and nothing about whether your expression is the curve you meant.

The parametric form is strictly more general

Any explicit curve y = f(x) can be written parametrically as x = t, y = f(t), and the parametric integrand then collapses to √(1 + f'(t)²) — the explicit formula. The reverse is not true: no explicit form describes a circle. When in doubt, parametrise. If you need the slope f' itself at a point rather than the length, the numerical derivative calculator reports it with an error estimate.

Related integrals and where to go next

Arc length is one of a family of geometric integrals that all start from a length, area or volume element. Rotate the curve about an axis and the same ds gives the surface area ∫2πy ds; sweep the region under it and you get the volume computed by the disk and washer calculator. The area under the curve itself is what a Riemann sum approximates, and comparing the two on the same function makes the difference between "how much" and "how far" concrete.

In vector calculus, arc length is the parameter that makes a curve canonical. Parametrising by arc length gives a unit tangent vector everywhere, which is what curvature and the Frenet frame are built on, and it is why line integrals are written ∫F·dr with |dr| = ds. Whether such a line integral is path-independent is decided by the curl of the field: a curl-free field on a simply connected region has a potential, and then only the endpoints matter, not the length of the path at all.

Numerically, the machinery here is the same as everywhere else in quadrature. Simpson's rule, Richardson extrapolation, and an error estimate from panel refinement are the standard toolkit; the numerical derivative calculator shows the differentiation half of it, and the bisection method calculator the root-finding half. If a limit of the range needs to be found as a curve intersection first, solve that with bisection and bring the result back here.

Frequently asked questions

Why does the arc-length integral rarely have a closed form?

Because the integrand is √(1 + f'(x)²), and a square root of a polynomial of degree two or more in f' generally cannot be integrated in elementary terms. The ellipse is the standard example — its arc length defines the elliptic integral of the second kind, a function that provably is not elementary. Parabolas, catenaries and a handful of contrived powers are the exceptions, not the rule.

How do I get the length of a circle or an ellipse here?

Use parametric mode. For a circle of radius R, enter x = R cos(t) and y = R sin(t) over [0, 6.283185]. For an ellipse, use a cos(t) and b sin(t) over the same range. Do not try either in explicit mode: the semicircle √(1 − x²) has an infinite slope at both ends and the integral will not evaluate.

What is a good value for the panel count?

The default of 1,000 gives an estimated error well below one part in a million for any smooth curve. Raise it if the error estimate shown is not small compared with the length, which happens when the integrand varies sharply — a spiral with a large radius range, or a curve with a nearly vertical section. Raising panels never helps when the integrand is genuinely infinite somewhere.

What does sinuosity of 1.05 mean?

That the curve is 5% longer than the straight line joining its endpoints. Sinuosity is defined as arc length divided by chord length, so it is exactly 1 for a straight segment and cannot be less. A gentle parabola over a short span sits near 1.05; a semicircle is π/2 ≈ 1.571; a meandering river channel is commonly quoted as sinuous above about 1.5.

Why is the sinuosity blank for a closed curve?

Because the chord between the endpoints is zero and the ratio would divide by zero. A curve traced over a full period returns to where it started, so the straight-line distance between its ends carries no information. The arc length is still perfectly well defined — a unit circle over [0, 2π] has length and no meaningful sinuosity.

Does the direction of travel change the answer?

No. Swapping the limits reverses the sign of dt and of the integral, but length is reported as a magnitude, so you get the same positive number. This differs from a definite integral of a plain function, where reversing the limits genuinely flips the sign of the answer.

Can I compute the length of a curve in three dimensions?

Not on this page. The three-dimensional formula is L = ∫√(x'(t)² + y'(t)² + z'(t)²) dt — the same construction with one more squared term. A common workaround for a helix is to note that its length over one turn is √((2πR)² + p²), where p is the pitch, which is just Pythagoras on the unrolled cylinder.

How accurate are the numerical derivatives inside the integrand?

About twelve significant figures for a smooth function. The calculator uses a central difference at a step of 10⁻⁴ × max(1, |v|) and then Richardson-extrapolates the pair to fourth-order accuracy, which puts the differentiation error well below the quadrature error in normal use. Near a point where the derivative is unbounded, both errors become meaningless at the same time.

Why does my polar answer come out as a multiple of what I expected?

Almost always because the parameter range traces the curve more than once. The three-petalled rose r = cos 3θ completes its full shape over [0, π]; running it to retraces every petal and doubles the length. Sketch the curve, or increase the upper limit gradually and watch where the length stops growing in a new way.

References