Line Integrals, Surface Integrals and Flux: A Step-by-Step Method
How to compute line integrals, surface integrals and flux by parametrising, with checks from potential functions and the divergence theorem.

Line and surface integrals are where vector calculus starts to look like physics. Work done by a force, circulation of a fluid, mass of a curved wire, electric flux through a surface: all of them reduce to the same short recipe once the curve or surface has been parametrised. This guide sets out that recipe for the four common types and shows how to check each answer with the free Line and Surface Integral Calculator, which displays every intermediate expression and a 3D plot.
Step one: parametrise
Every calculation begins by describing the curve or surface with parameters. A circle of radius a is (a cos t, a sin t) for t from 0 to 2π. A helix adds a third component, such as t. A straight segment from point P to point Q is P + t(Q − P) for t from 0 to 1. For surfaces, a sphere of radius a is (a sin u cos v, a sin u sin v, a cos u) with u from 0 to π and v from 0 to 2π, and a graph z = h(x, y) becomes (u, v, h(u, v)).
Choosing the parametrisation also chooses a direction or an orientation. Running t backwards reverses a curve, and swapping u and v reverses the normal of a surface. For work and flux that changes the sign of the answer, so decide on the direction the question wants before you start.
Scalar line integrals
To integrate a scalar function f along a curve, replace ds by the speed |r′(t)| dt. Substitute the parametrisation into f, multiply by the speed and integrate over the parameter range. With f = 1 the result is the length of the curve. For the helix (2 cos t, 2 sin t, t), the speed is √5 at every point, so one full turn has length 2π√5 ≈ 14.05.
Work and circulation
For a vector field F, the line integral ∫ F·dr uses the derivative r′(t) rather than its length. Substitute the curve into F, take the dot product with r′(t) and integrate. With F = (−y, x, z) along the helix (cos t, sin t, t), the dot product is sin² t + cos² t + t = t + 1, and the work over one turn is 2π² + 2π ≈ 26.02.
The calculator writes out r′(t), F(r(t)) and the simplified integrand, so you can compare each line with your own working. It also draws arrows of F along the curve; places where the arrows point along the direction of travel are where most of the work is done.
Conservative fields save time
If the curl of F is zero on a simply connected region, F is the gradient of a potential function φ, and the work depends only on the end points: ∫ F·dr = φ(end) − φ(start). The calculator tests the curl, and when it vanishes it constructs φ by integrating one component at a time and checks the result by differentiation. For F = (2xy, x² + 2y) from (0, 0) to (1, 2) it finds φ = x²y + y² and confirms the work is 6 along the parabolic path in the example, as it would be along any other path. On a closed curve the work of a conservative field is zero.
Surface integrals
For a scalar function on a surface, replace dS by |r_u × r_v| du dv, the area of the small parallelogram spanned by the two tangent vectors. With f = 1 this gives the surface area. For the unit sphere the cross product has length sin u, and the area comes out as 4π.
Flux
Flux measures how much of a field passes through a surface. Use the vector r_u × r_v itself, not its length: substitute the surface into F, take the dot product with r_u × r_v and integrate over the parameter domain. For F = (x, y, z) through the sphere of radius 2, the integrand simplifies to 8 sin u and the flux is 32π. The divergence of this field is 3, and three times the volume of the ball, (4/3)π·8, is also 32π, exactly as the divergence theorem promises. The calculator shows the normal vectors as arrows on the 3D wireframe, so you can confirm that they point outward before trusting the sign.
A short checklist
Parametrise and state the parameter range. Differentiate carefully. Simplify with sin² + cos² = 1 before integrating, because it often turns a hopeless integrand into a polynomial. Check orientation for work and flux. Look for shortcuts: a zero curl means a potential, a closed surface invites the divergence theorem, and a closed plane curve invites Green's theorem. When a symbolic antiderivative does not exist, the calculator still gives a reliable numeric value and labels it, so you always have something to compare your answer against.


