#### 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 = x_o$ and $x = x_n$, 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 $P_1, p_2, \dots p_{i-1}, p_i, \dots , p_n$, where we break our curve into $n$ pieces.

The area around two adjacent points, $P_{n-1}$ and $P_n$ is enlarged below to show how the Pythagorean theorem helps us calculate distance. The horizontal distance is $x_i - x_{i-1}$ and the vertical distance is the difference between the function values at those two points, $\Delta y = f(x_i) - f(x_{i-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, $|P_i - P_{i-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 $||P_i - P_{i-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 $\Delta 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 = x_o$ and $x = x_n$, 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 \pi 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, $r^2 - x^2$:

\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. Solution $y = x^2$ between x = -1 and x = 1. First set up the integral, taking advantage of the symmetry of the function (integrate from 0 to 1 and multiply by 2): \begin{align} L &= 2 \int_0^1 \sqrt{1 + \left( \frac{d}{dx}x^2 \right)^2} dx \\[5pt] &= 2 \int_0^1 \sqrt{1 + 4x^2} dx \end{align} This integral can be done by trig. substitution: Let   $x = \frac{1}{2} tan(t),$   then   $x^2 = \frac{1}{4} tan^2(t)$   and   $dx = \frac{1}{2} sec^2(t) dt.$ Additionally, we can find new integration limits:   $t = tan^{-1}(2x),$   so   $t(0) = tan^{-1}(0) = 0,$   and   $t(1) = tan^{-1}(2) = 1.107.$ Now we have \begin{align} L &= 2 \int_0^{1.107} \sqrt{1 + tan^2(t)} \left( \frac{1}{2} sec^2(t)\right) dt \\[5pt] &= \int_0^{1.107} sec^3(t) dt \end{align} Now solve that integral by parts, \begin{align} Let \: u &= sec(t) \: \: \text{and} \: dv = sec^2(t) dt \\[5pt] \text{then} \: \: du &= sect(t)tan(t) dt, \: \: \text{and} \: \: v = tan(t) \end{align} \begin{align} \int sec^3(t) dt &= sec(t)tan(t) - \int sec(t) tan^2(t) dt \\[5pt] \int sec^3(t) dt &= sec(t)tan(t) - \int sec^3(t) dt - \int sec(t) dt \\[5pt] 2 \int sec^3(t) dt &= sec(t)tan(t) - ln|sec(t) + tan(t)| \\[5pt] \int sec^3(t) dt &= \frac{1}{2} \left[ sec(t) tan(t) - ln|sec(t) + tan(t) \right]_0^1.107 \\[5pt] &= \frac{1}{2} \left[ \frac{sin(t)}{cos^2(t)} - ln \big| \frac{1}{cos(t)} - \frac{sin(t)}{cos(t)} \big| \right]_0^1.107 \\[5pt] &= \frac{1}{2} \left[ 4.469 - ln |2.235 - 2| - \left( 0 - ln|1 - 0|) \right) \right] \\[5pt] &= \bf{1.51 \: \text{units}} \end{align} 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$ Solution $$f(x) = \frac{x^2}{2} - \frac{ln(x)}{4} \phantom{00} x \in [2, 4]$$ $$f'(x) = x - \frac{1}{4x}$$ $$[f'(x)]^2 = x^2 - \frac{1}{2} + \frac{1}{16x2} = \frac{16x^4 - 8 x^2 + 1}{16x^2}$$ \require{cancel} \begin{align} 1 + [f'(x)]^2 &= \frac{16x^2 + 16x^4 - 8x^2 + 1}{16x^2} \\[5pt] &= \frac{16x^4 + 8x^2 + 1}{16x^2} \\[5pt] &= \frac{\cancel{16}(x^2 + \frac{1}{4})^2}{\cancel{16}x^2} \end{align} So: \begin{align} L &= \int_2^4 \sqrt{\frac{\left( x^2 + \frac{1}{4} \right)}{x^2}} \, dx \\[5pt] &= \int_2^4 \frac{x + \frac{1}{4}}{x} \, dx \\[5pt] &= \int_2^4 1 + \frac{1}{4x} \, dx = x + \frac{1}{4} ln|x| \bigg|_2^4 \\[5pt] &= 4 + \frac{1}{4} ln(4) - 2 - \frac{1}{4} ln(2) \\[5pt] &= 2 + \frac{1}{4} ln \left( \frac{4}{2} \right) \\[5pt] &= 2 + \frac{1}{4} ln(2) = 2.173 \end{align} (That's a lot of tricky algebra!) 3 Calculate the length of the curve $y = x^{\frac{3}{2}}$ between (0, 0) and (1, 1) Solution $$y = x^{\frac{3}{2}} \phantom{00} (0, 0) \text{ to } (1, 1)$$ \begin{align} y' = \frac{3}{2} x^{\frac{1}{2}} &\rightarrow [y']^2 = \frac{9}{4} x \\[5pt] &\rightarrow L = \int_0^1 \sqrt{1 + \frac{9}{4} x} \, dx \end{align} Integrate by parts: $$\text{let } u = 1 + \frac{9}{4} x, \; du = \frac{9}{4} \, dx$$ \begin{align} L &= \frac{4}{9} \int_1^{13/4} u^{\frac{1}{2}} du = \frac{4}{9} \cdot \frac{2}{3} u^{\frac{3}{2}} \bigg|_1^{13/4} \\[5pt] &= \frac{8}{27} \left[ \left( \frac{13}{4} \right)^{\frac{3}{2}} - 1^{\frac{3}{2}} \right] \\[5pt] &= \frac{8}{27} \left[ \frac{13^{\frac{3}{2}}}{8} - 1 \right] \\[5pt] &= \frac{\cancel{8}}{27} \left[ \frac{13^{3/2}-8}{\cancel{8}} \right] \\[5pt] &= \frac{13^{3/2} - 8}{27} = 1.44 \, \text{units} \end{align} 4 Calculate the length of the parametric curve $x = t^2 \: , \: y = t^3$ between (1, 1) and (4, 8). Solution This one is parametric: $$x = t^2, \; \; y = t^3 \phantom{00} (1, 1) \text{ to } (4, 8)$$ \begin{align} L &= \int_1^2 \left[ \left( \frac{dx}{dt} \right)^2 + \left( \frac{dy}{dt} \right)^2 \right]^{\frac{1}{2}} \, dt \\[5pt] &= \int_1^2 \left[ (2t)^2 + (3t^2)^2 \right]^{\frac{1}{2}} \, dt \\[5pt] &= \int_1^2 (4t^2 + 9t^4)^{\frac{1}{2}} \, dt \\[5pt] &= \int_1^2 t(4 + 9t^2)^{\frac{1}{2}} \, dt \end{align} Integrate by parts: $$\text{let } u = 4 + 9t^2, \phantom{00} du = 18t \, dt$$ \begin{align} \rightarrow &\; \frac{1}{18} \int_{13}^{40} \, u^{\frac{1}{2}} du \\[5pt] &= \frac{1}{18} \cdot \frac{3}{2} u^{\frac{3}{2}} \bigg|_{13}^{40} \\[5pt] &= \frac{1}{12} \left( 40^{\frac{2}{2}} - 13^{\frac{3}{2}} \right) = 17.2 \text{ units} \end{align} 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.$ Solution $$x = r\cdot cos(\theta), \; y = r \cdot sin(\theta) \phantom{00} \theta \in [0,2\pi]$$ $$x' = -r \cdot sin(\theta), \phantom{00} y' = r \cdot cos(\theta)$$ $$(x')^2 = r^2 sin^2(\theta) \phantom{00} (y')^2 = r^2 cos^2(\theta)$$ $$(x')^2 + (y')^2 = r^2(sin^2(\theta) + cos^2(\theta)) = r^2$$ $$L = \int_0^{2 \pi} \sqrt{r^2} \, d\theta = r\theta \, \bigg|_0^{2 \pi} = 2 \pi r - 0 = 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.