#### xaktly | Calculus

Length of a curve

### Using calculus to find the length of a curve

In this section we'll learn how to use derivatives and definite integrals to calculate the length of a curve. We'll do this both for functions of the form y = f(x), and for parametric functions, where each point (x, y) is defined by a parameter (like time, t), such as (x, y) = (x(t), y(t)).

Later you can extend the concept of length of a curve to solids of revolution, using it to calculate the surface area of a complicated solid. Surfaces and surface area is a crucial concept in many fields, such as chemistry: All chemistry occurs at a surface. The concept of arc length is where we begin to learn about path integrals, which are important in fields like quantum mechanics and quantum electrodynamics.

### Arc length

We begin by defining a function f(x), like in the graph below. To find the length of the curve between x = xo and x = xn, we'll break the curve up into n small line segments, for which it's easy to find the length just using the Pythagorean theorem, the basis of how we calculate distance on the plane.

The figure shows the basic geometry. Each point (x, f(x)) is labeled P1, P2, ... Pi-1, Pi, ... Pn, where we break our curve into n pieces.

The area around two adjacent points, Pn-1 and Pn is enlarged below to show how the Pythagorean theorem helps us calculate distance. The horizontal distance is xi - xi-1 and the vertical distance is the difference between the function values at those two points, Δy = f(xi) - f(xi-1. It's the same for any two adjacent points.

So the distance between successive points is the square root of the sum of the squares of the rise and run from one point to the other.

The notation on the left, |Pi - Pi-1| means the length of that segment, not its absolute value. It's a very common notation for length, so get used to it. Sometimes double bars are used so as not to confuse length with absolute value, like ||Pi - Pi-1||.

Now we could rewrite that in a more compact way:

$$|P_{i - 1} - P_i| = \sqrt{(\Delta x)^2 + (\Delta y)^2}$$

which suggests that we could turn Δx into dx and make a derivative, then an integral to add up all of our line segments. Its starts with the mean value theorem, which guarantees that there exists a point, $x_i^*$ between $x_i$ and $x_{i - 1}$ such that $f(x_i) - f(x_{i - 1})$ = $f(x_i^*)\cdot (x_i - x_{i - 1})$, or

$$\Delta y = f'(x_i^*)\cdot \Delta x$$

which we get by substituting $\Delta x$ for $x_i - x_{i - 1}$ and $\Delta y$ for $x_i - x_{i - 1}$. The length of one of our segments is

$$|P_{i - 1} - P_i| = \sqrt{(\Delta x)^2 + (\Delta y)^2}$$

and substituting for $\Delta y$ we get

$$= \sqrt{(\Delta x)^2 + [f'(x_i^* )\Delta x]^2}$$

We can factor out the $\Delta x$ common to each term under the radical

$$= \sqrt{1 + [f'(x_i^*)]^2}\cdot\sqrt{(\Delta x)^2}$$

and further simplify by taking the second square root:

$$= \sqrt{(\Delta x)^2 + [f'(x_i^* )]}\Delta x$$

Now this equation for the length of a segment is looking pretty close to something we could integrate – add up all of those line segments, decreasing the length to zero and their number to infinity, to get the exact length of the curve. Here's what that looks like:

Now we shrink $\Delta x$ and write this as an integral:

\begin{align} L &=\lim_{n\to\infty}\sum_{i = 1}^n |P_{i - 1} - P_i| \\[5pt] &= \lim_{n\to\infty} \sum_{i = 1}^n \sqrt{1 + [f'(x_i^*)]^2} \end{align}

#### Arc length

The length of a continuous function, between x = xo and x = xn, is

### Example 1: Testing our formula on a line

Calculate the length of   $f(x) = 2x + 1$   between $x = 1$ and $x = 4$

Solution: We really don't need an integral to find the length of a line, but let's use it to confirm that the method works.

If f(x) = 2x + 1, then f(1) = 3 and f(4) = 9, so our two endpoints are (1, 3) and (4, 9). We can just use the distance formula (really the Pythagorean theorem) to find the distance:

\begin{align} \text{distance} &= \sqrt{(x_i - x_{i - 1})^2 + (y_i - y_{i - 1})^2} \\[5pt] &= \sqrt{(4 - 1)^2 + (9 - 3)^2} \\[5pt] &= \sqrt{9 + 36} = \sqrt{45} = 3 \sqrt{5} \\[5pt] &= 6.708 \; \text{units} \end{align}

The derivative of f(x) is f'(x) = 2 – not surprising that a linear function has a constant slope. Plugging that into the arc-length integral, we get:

\begin{align} L &= \int_1^4 \sqrt{1 + [2]^2} dx \\[5pt] &= x \sqrt{5} \, \bigg|_1^4 \\[5pt] &= 3 \sqrt{5} = 6.708 \; \text{units} \end{align}

So they're the same. It would be embarrassing if they weren't. Now on to something more interesting, the length of something actually curved ...

### Example 2

Calculate the length of the circle   $x^2 + y^2 = r^2.$

Solution: Here again, we already know the answer: The circumference of a circle is C = 2πr. It's nice to solve a problem like this, though, to make sure we're doing it correctly – and this one is a little more complicated. We begin with the formula for a circle of radius r, centered at the origin. (If it wasn't centered at the origin, we could always move it there without changing the circumference, right?).

$$x^2 + y^2 = r^2$$

We need to solve for y to get the functional form, and we can just consider the top of the circle (the + solution) for now:

$$y = \sqrt{r^2 - x^2}$$

Now we'll need the derivative,

$$\frac{dy}{dx} = \frac{1}{2}(r^2 - x^2)^{\frac{1}{2}}(2x)$$

which reduces to:

$$\frac{dy}{dx} = \frac{x}{\sqrt{r^2 - x^2}}$$

Now squaring the derivative gets rid of the radical in the denominator:

$$\left(\frac{dy}{dx}\right)^2 = \frac{x^2}{r^2 - x^2}$$

We'll need to add 1, and we'll do that by using the common denominator, r2 - x2:

\begin{align} \left(\frac{dy}{dx}\right)^2 + 1 &= \frac{x^2 + r^2 - x^2}{r^2 - x^2} \\ &= \frac{r^2}{r^2 - x^2} \end{align}

So the integral is

$$L = 4 \int_0^r \sqrt{\frac{r^2}{r^2 - x^2}} dx$$

Here I've taken the integral of the top half of the circle (the + square root) only between x = 0 and x = 4, and just multiplied it by 4 to take advantage of the ample symmetry of a circle.

We can take a root and pull an r out from the numerator of the integrand:

$$L = 4r \int_0^r \sqrt{\frac{1}{r^2 - x^2}} dx$$

Now the crux of this integral is realizing that we do it by trigonometric substitution, and the pattern here gives us the substitution

\begin{align} \color{#E90F89}{\text{let }} \: x &= r sin(t) \: \color{#E90F89}{\text{, then}} \\[5pt] x^2 = r^2 sin^2 (t) \: &\color{#E90F89}{\text{ and }} \: dx = r cos(t) \, dt \end{align}

So we have dx, and now we need to substitute for what's in the radical.

\begin{align} r^2 - x^2 &= r^2 - r^2 sin^2(t) \\[5pt] &= r^2 [1 - sin^2 (t)] \\[5pt] &= r^2 cos^2(t) \end{align}

The integral is then:

Taking the root, it simplifies to

$$C = 4r \int_0^r \sqrt{\frac{1}{r^2 cos^2(t)}} r\cdot cos(t) dt$$

$$C = 4r \int_0^r \frac{r cos(t)}{r cos(t)} dt$$

That's just the integral of dt, which is 4rt, and we can then go back to the definition of t from our trig. substitution, x = r sin(t):

to rewrite the integral result as

\begin{align} C &= 4rt \, \bigg|_0^r \: \: \: where \: \: t = sin^{-1}\left( \frac{x}{r} \right) \\[5pt] C &= 4r sin^{-1}\frac{x}{r} \,\bigg|_0^r \end{align}

And finally we evaluate the limits to get

\begin{align} &= 4r [sin^{-1}(1) - sin^{-1}(0)] \\[5pt] &= 4r \left( \frac{\pi}{2} - 0 \right) = 2\pi r \end{align}

So the circumference is $2\pi r$, ... just what we expected. Cool.

Some of these integrals, by the way, will be quite complicated, so you might end up doing the integration numerically on a calculator or computer, and that's OK.

### Curves in parametric form

For a curve in parametric form, $(x, y) = (x(t), y(t)),$ where $t$ is a parameter, like time, it's not too much of a stretch to derive the arc length. In a similar manner, we can divide the curve into chunks of the parameter, $t_o, \; t_1 \; 2_2,$ and so on,

and the line lengths are the squares of the derivatives of x and y with respect to the parameter, so that the arc length between t = a and t = b is

$$L = \int_a^b \sqrt{\left( \frac{dx}{dt} \right)^2 + \left( \frac{dy}{dt} \right)^2}$$

### Practice problems

 1 Calculate the length of the parabola $y = x^2$ between x = -1 and x = 1. 2 Calculate the exact length of the curve defined by   $f(x) = \frac{x^2}{2} - \frac{ln(x)}{4}$   for   $2 \le x \le 4$ 3 Calculate the length of the curve $y = x^{\frac{3}{2}}$ between (0, 0) and (1, 1) 4 Calculate the length of the parametric curve $x = t^2 \: , \: y = t^3$ between (1, 1) and (4, 8). 5 The polar curve $x = r \cdot cos(\theta), \: y = r \cdot sin(\theta)$ is the parameterization (in terms of the polar angle θ) of a circle of radius r. Use calculus to show that the circumference of such a circle is $C = 2\pi r.$

### Video examples

I'm working on some examples ... stand by (but do check out the problems above)

xaktly.com by Dr. Jeff Cruzan is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. © 2012, Jeff Cruzan. All text and images on this website not specifically attributed to another source were created by me and I reserve all rights as to their use. Any opinions expressed on this website are entirely mine, and do not necessarily reflect the views of any of my employers. Please feel free to send any questions or comments to jeff.cruzan@verizon.net.