How much does a curved wire weigh if its density changes along its length? Cut it into small pieces, multiply each piece's length by its density, and add. That sum, in the limit, is a line integral of a function along a curve. It is the arc length integral with a weight $f$ attached.
Key idea
For a smooth curve $C$ given by $\mathbf{r}(t)$, $a \le t \le b$, and a continuous function $f$:
$$\int_C f\,ds = \lim \sum f(P_i^*)\,\Delta s_i = \int_a^b f(\mathbf{r}(t))\,|\mathbf{r}'(t)|\,dt.$$
The value does not depend on the parametrization or on the direction of travel. With $f = 1$ it gives the length of $C$; with a density $\delta$ it gives the mass of a wire.
Why it works
Why the factor $|\mathbf{r}'(t)|$: a small step $\Delta t$ in the parameter moves the point by about $\mathbf{r}'(t)\,\Delta t$, a piece of curve of length $\Delta s \approx |\mathbf{r}'(t)|\,\Delta t$. So $f\,\Delta s \approx f(\mathbf{r}(t))\,|\mathbf{r}'(t)|\,\Delta t$, and adding these gives the $t$-integral.
Why direction does not matter: $\Delta s$ is a length, always positive. Tracing $C$ backward visits the same pieces with the same lengths, so the sum is unchanged.
Why direction does not matter: $\Delta s$ is a length, always positive. Tracing $C$ backward visits the same pieces with the same lengths, so the sum is unchanged.
Worked examples
Worked example: Along a segment
Evaluate $\int_C (x + y)\,ds$, where $C$ is the segment from $(0, 0)$ to $(3, 4)$.
- $\mathbf{r}(t) = \langle 3t, 4t \rangle$, ${}0 \le t \le 1$, and $|\mathbf{r}'(t)| = |\langle 3, 4 \rangle| = 5$.
- On $C$, $x + y = 7t$.
- $\int_0^1 7t \cdot 5\,dt = \frac{35}{2}$.
Answer: $\frac{35}{2}$
Worked example: Along a quarter circle
Evaluate $\int_C xy\,ds$, where $C$ is the part of $x^2 + y^2 = 4$ in the first quadrant.
- $\mathbf{r}(t) = \langle 2\cos t, 2\sin t \rangle$, ${}0 \le t \le \frac{\pi}{2}$, with $|\mathbf{r}'(t)| = 2$.
- $$\int_0^{\pi/2} (4\cos t\sin t)(2)\,dt = 8 \cdot \frac{1}{2}\left[\sin^2 t\right]_0^{\pi/2} = 4.$$
Answer: ${}4$
Worked example: Mass of a helical spring
A wire has the shape $\mathbf{r}(t) = \langle \cos t, \sin t, t \rangle$, ${}0 \le t \le 2\pi$, and density $\delta = z$. Find its mass.
- $|\mathbf{r}'(t)| = |\langle -\sin t, \cos t, 1 \rangle| = \sqrt{2}$.
- Mass $$= \int_C z\,ds = \int_0^{2\pi} t\sqrt{2}\,dt = \sqrt{2} \cdot \frac{(2\pi)^2}{2} = 2\sqrt{2}\,\pi^2.$$
Answer: ${}2\sqrt{2}\,\pi^2$
Common mistake
Dropping $|\mathbf{r}'(t)|$. Writing $ds$ as $dt$ treats every step in $t$ as one unit of length. In the first example that gives $\int_0^1 7t\,dt = \frac{7}{2}$, off by the factor ${}5$, the length of the segment. A quick check: with $f = 1$, your integral should give the length of the curve.