# What is the line integral along C?

Finds the line integral ∫ F · dr of a vector field, or ∫ f ds of a function, along a curve r(t) from t = a to t = b.

- Page: https://www.acalculator.org/math/line-integral-calculator
- JSON spec: https://www.acalculator.org/math/line-integral-calculator.json
- Version: e64fb3eda16c

## Default answer

Example with the default inputs (Integral ∫ F · dr, P (i component of F) y z, Q (j component of F) x y, R (k component, optional) x z, x(t) t^2, y(t) t, z(t) (empty for a plane curve) t^4, From t = a 0, To t = b 1): The line integral along C from t = 0 to t = 1 is 0.9357142857.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| kind | Integral | A vector field F (work, ∫ F · dr) or a function f (∫ f ds). |
| p | P (i component of F) | The x component of F, in x, y and z. |
| q | Q (j component of F) | The y component of F. |
| r | R (k component, optional) | The z component of F; empty is 0. |
| f | f(x, y, z) | The function to integrate along C. |
| x | x(t) | The x component of the curve. |
| y | y(t) | The y component of the curve. |
| z | z(t) (empty for a plane curve) | The z component of the curve. |
| a | From t = a | Where the curve starts: a number or a constant such as pi. |
| b | To t = b | Where the curve ends. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| value | Line integral | The value of the integral along C. |
| exact | Exact value | The integral, exactly, when the algebra finds it. |
| integrand | Integrand in t | F(r(t)) · r′(t), or f(r(t)) ‖r′(t)‖, the function integrated from a to b. |

## Method

∫ F · dr = ∫ₐᵇ F(r(t)) · r′(t) dt and ∫ f ds = ∫ₐᵇ f(r(t)) ‖r′(t)‖ dt, each derivative and integral from a computer algebra system, checked.

## Assumptions

- C runs from r(a) to r(b) as t grows; reversing C changes the sign of ∫ F · dr, not of ∫ f ds.
- Angles in radians. When the algebra finds no antiderivative, adaptive Simpson’s rule gives the value.

## Worked examples

1. kind = vector, p = y z, q = x y, r = x z, x = t^2, y = t, z = t^4, a = 0, b = 1 gives value = 0.935714, exact = 131/140. Source: OpenStax, Calculus Volume 3, section 6.2 Line Integrals (https://openstax.org/books/calculus-volume-3/pages/6-2-line-integrals), Example 6.23 (F = ⟨yz, xy, xz⟩, r(t) = ⟨t², t, t⁴⟩, 0 ≤ t ≤ 1).
2. kind = vector, p = -y, q = x, x = cos(t), y = sin(t), a = 0, b = pi gives value = 3.141593. Source: OpenStax, Calculus Volume 3, section 6.2 Line Integrals (https://openstax.org/books/calculus-volume-3/pages/6-2-line-integrals), Example 6.18 (F = ⟨−y, x⟩ on the upper half of the unit circle).
3. kind = scalar, f = x^2 + y^2 + z, x = cos(t), y = sin(t), z = t, a = 0, b = 2pi gives value = 36.801223. Source: OpenStax, Calculus Volume 3, section 6.2 Line Integrals (https://openstax.org/books/calculus-volume-3/pages/6-2-line-integrals), Example 6.15 (helix): 2√2π + 2√2π².

## FAQ

### What is a line integral?

An integral along a curve C instead of along an interval. The scalar line integral ∫ f ds adds up f times arc length, for example the mass of a wire with density f. The vector line integral ∫ F · dr adds up the part of F along the curve, for example the work a force F does on an object that moves along C.

### How do I compute ∫ F · dr?

Write C as r(t) for a ≤ t ≤ b. Put r(t) into F, take the dot product with r′(t), and integrate from a to b: ∫ F · dr = ∫ₐᵇ F(r(t)) · r′(t) dt. For F = ⟨−y, x⟩ on r(t) = ⟨cos t, sin t⟩, 0 ≤ t ≤ π, the integrand is sin²t + cos²t = 1, so the integral is π.

### How do I compute ∫ f ds?

Use ds = ‖r′(t)‖ dt: ∫ f ds = ∫ₐᵇ f(r(t)) ‖r′(t)‖ dt. With f = 1 this is the arc length of C.

### Does the direction of the curve matter?

For ∫ F · dr, yes: running C the other way changes the sign of the answer. For ∫ f ds, no: arc length is always positive, so the answer stays the same.

### What does a line integral of 0 around a closed curve mean?

If F is conservative (the gradient of a function), ∫ F · dr around every closed curve is 0, and the integral between two points does not depend on the path. A field with curl F ≠ 0 is not conservative.

### What is the notation ∫ P dx + Q dy + R dz?

It is ∫ F · dr for F = ⟨P, Q, R⟩. Type P, Q and R as the three components; dx = x′(t) dt, dy = y′(t) dt and dz = z′(t) dt.

### How is the answer checked?

Each derivative of the curve comes from a computer algebra system and is checked against a numeric difference quotient. The definite integral from the algebra is checked against a numeric integral. When the algebra finds no antiderivative (often with a square root in ‖r′(t)‖), the page uses adaptive Simpson’s rule to 10 figures and shows no exact value.

## Sources

- OpenStax, Calculus Volume 3, section 6.2 Line Integrals (retrieved 2026-10-03): https://openstax.org/books/calculus-volume-3/pages/6-2-line-integrals
