CoCalc Public Files06 - Arc Length and Surface Area Assignments / Arc Length and Surface Area Notes.sagewsOpen with one click!
Author: Aaron Tresham
Views : 31
License: Other -- explicitly state in your code
Compute Environment: Ubuntu 20.04 (Default)
This material was developed by Aaron Tresham at the University of Hawaii at Hilo and is Creative Commons License
licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.


  • Intro to Sage
  • Symbolic Integration

Arc Length and Surface Area

We're going to cover two applications of integrals in these notes: (1) the length of a curve and (2) the area of a surface of revolution.

Arc Length

Our goal is to find the length of the graph of a function y=f(x)y=f(x) from x=ax=a to x=bx=b. This is called "arc length."

We will assume that our function is "smooth" on [a,b][a,b], which means that the derivative ff' is continuous at every xx in [a,b][a,b].

The simplest curve is a straight line. We can find the length of a line segment using geometry. For anything more complex, we will use line segments to approximate the curve.

Here is the procedure:

  1. Divide the interval [a,b][a,b] into nn subintervals of equal width with endpoints a=x0<x1<x2<<xn=ba=x_0 < x_1 < x_2 < \ldots < x_n=b.

  2. Find the length of the line segments connecting the points (xi,f(xi))(x_i,f(x_i)) and (xi+1,f(xi+1))(x_{i+1},f(x_{i+1})) for i=0, 1, , n1i=0,\ 1,\ \ldots,\ n-1.

  3. Add up all these lengths to get an approximation for the arc length.

  4. Take the limit as nn approaches infinity to get the actual arc length.

Here is a sample picture with n=4n=4.

Does this process sound familiar. Is anyone surprised that the final answer turns out to be an integral?

We find the length of the line segments (step 2) using the distance formula. Let LiL_i be the distance from (xi,f(xi))(x_i,f(x_i)) to (xi+1,f(xi+1))(x_{i+1},f(x_{i+1})). Then Li=(xi+1xi)2+(f(xi+1)f(xi))2=Δx2+(f(xi+1)f(xi))2,L_i=\sqrt{(x_{i+1}-x_i)^2+(f(x_{i+1})-f(x_i))^2}=\sqrt{\Delta x^2+(f(x_{i+1})-f(x_i))^2},

where Δx=xi+1xi=ban\Delta x=x_{i+1}-x_i=\frac{b-a}{n} is a constant.

This is where it gets a little tricky. By the Mean Value Theorem, there exists cic_i with xi<ci<xi+1x_i < c_i < x_{i+1} such that f(ci)=f(xi+1)f(xi)Δxf'(c_i)=\frac{f(x_{i+1})-f(x_i)}{\Delta x}. Multiplying both sides by Δx\Delta x gives: f(xi+1)f(xi)=f(ci)Δx.f(x_{i+1})-f(x_i)=f'(c_i)\cdot\Delta x.

So then we have Li=Δx2+(f(ci)Δx)2=Δx2(1+f(ci)2)=1+f(ci)2Δx.L_i=\sqrt{\Delta x ^2+(f'(c_i)\cdot\Delta x)^2}=\sqrt{\Delta x^2\cdot(1+f'(c_i)^2)}=\sqrt{1+f'(c_i)^2}\cdot \Delta x.

The arc length is thus limni=0n1Li=limni=0n11+f(ci)2Δx=ab1+f(x)2dx.\lim_{n\to\infty}\sum_{i=0}^{n-1}L_i=\lim_{n\to\infty}\sum_{i=0}^{n-1}\sqrt{1+f'(c_i)^2}\cdot \Delta x=\int_a^b\sqrt{1+f'(x)^2}\, dx.

[Note: We have assumed ff' is continuous to guarantee that this integral exists.]

Arc Length Formula

If ff' is continous on the interval [a,b][a,b], then the arc length of the curve y=f(x)y=f(x) from x=ax=a to x=bx=b is L=ab1+f(x)2dx.L=\int_a^b\sqrt{1+f'(x)^2}\, dx.

Example 1

Find the length of f(x)=ln(sec(x))f(x)=\ln(\sec(x)) from x=0x=0 to x=π4x=\frac{\pi}{4}.

Solution: f(x)=1sec(x)sec(x)tan(x)=tan(x)f'(x)=\frac{1}{\sec(x)}\cdot \sec(x)\tan(x)=\tan(x), so 1+f(x)2=1+tan2(x)=sec2(x)=sec(x)=sec(x)\sqrt{1+f'(x)^2}=\sqrt{1+\tan^2(x)}=\sqrt{\sec^2(x)}=|\sec(x)|=\sec(x) for 0xπ40\le x\le \frac{\pi}{4}.

Therefore, L=0π/4sec(x)dx=ln(sec(x)+tan(x))0π/4=ln(2+1).L=\int_0^{\pi/4}\sec(x)\, dx=\ln(|\sec(x)+\tan(x)|)\bigg|_0^{\pi/4}=\ln(\sqrt{2}+1).

f(x)=ln(sec(x)) integral(sqrt(1+derivative(f,x)^2),x,0,pi/4)

You may not recognize this function (it is not arcsin), but this is in fact the same as the answer I gave above:

0.881373587019543 0.881373587019543

Here's what you get if you do the simplification first:

integral(sec(x),x,0,pi/4) N(_)
1/2*log(1/2*sqrt(2) + 1) - 1/2*log(-1/2*sqrt(2) + 1) 0.881373587019543

Example 2

Find the length of f(x)=18x2ln(x)f(x)=\frac{1}{8}x^2-\ln(x) from x=1x=1 to x=2x=2.

Solution: Since f(x)=x41x\displaystyle f'(x)=\frac{x}{4}-\frac{1}{x}, we have L=121+(x41x)2dx.\displaystyle L=\int_1^2\sqrt{1+\left(\frac{x}{4}-\frac{1}{x}\right)^2}\, dx.

This can be done by hand, but the algebra is kind of involved. Let's just use Sage:

f(x)=x^2/8-ln(x) integral(sqrt(1+derivative(f,x)^2),x,1,2) N(_)
log(2) + 3/8 1.06814718055995

Remember that log is the natural logarithm in Sage.

Example 3

Find the length of f(x)=3x25x+4f(x)=3x^2-5x+4 from x=0x=0 to x=2x=2.

Solution: Since f(x)=6x5f'(x)=6x-5, we have L=021+(6x5)2dx\displaystyle L=\int_0^2\sqrt{1+(6x-5)^2}\, dx.

f(x)=3*x^2-5*x+4 integral(sqrt(1+derivative(f,x)^2),x,0,2) N(_)
5/12*sqrt(26) + 35/12*sqrt(2) + 1/12*arcsinh(7) + 1/12*arcsinh(5) 6.66242761277947

So L6.6624L\approx 6.6624.

Example 4

Find the length of f(x)=cos(x)f(x)=\cos(x) from x=0x=0 to x=πx=\pi.

Solution: Since f(x)=sin(x)f'(x)=-\sin(x), we have L=0π1+sin2(x)dx\displaystyle L=\int_0^{\pi} \sqrt{1+\sin^2(x)}\, dx.

If we try this integral in Sage, we run into trouble.

Error in lines 1-1 Traceback (most recent call last): File "/projects/9189c752-e334-4311-afa9-605b6159620a/.sagemathcloud/", line 879, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "/projects/sage/sage-6.7/local/lib/python2.7/site-packages/sage/misc/", line 663, in integral return x.integral(*args, **kwds) File "sage/symbolic/expression.pyx", line 10712, in sage.symbolic.expression.Expression.integral (build/cythonized/sage/symbolic/expression.cpp:52941) return integral(self, *args, **kwds) File "/projects/sage/sage-6.7/local/lib/python2.7/site-packages/sage/symbolic/integration/", line 761, in integrate return definite_integral(expression, v, a, b, hold=hold) File "sage/symbolic/function.pyx", line 994, in sage.symbolic.function.BuiltinFunction.__call__ (build/cythonized/sage/symbolic/function.cpp:10865) res = super(BuiltinFunction, self).__call__( File "sage/symbolic/function.pyx", line 502, in sage.symbolic.function.Function.__call__ (build/cythonized/sage/symbolic/function.cpp:6801) res = g_function_evalv(self._serial, vec, hold) File "sage/symbolic/function.pyx", line 1065, in sage.symbolic.function.BuiltinFunction._evalf_or_eval_ (build/cythonized/sage/symbolic/function.cpp:11522) return self._eval0_(*args) File "/projects/sage/sage-6.7/local/lib/python2.7/site-packages/sage/symbolic/integration/", line 176, in _eval_ return integrator(*args) File "/projects/sage/sage-6.7/local/lib/python2.7/site-packages/sage/symbolic/integration/", line 23, in maxima_integrator result = maxima.sr_integral(expression, v, a, b) File "/projects/sage/sage-6.7/local/lib/python2.7/site-packages/sage/interfaces/", line 776, in sr_integral return max_to_sr(maxima_eval(([max_integrate],[sr_to_max(SR(a)) for a in args]))) File "sage/libs/ecl.pyx", line 792, in sage.libs.ecl.EclObject.__call__ (build/cythonized/sage/libs/ecl.c:6998) return ecl_wrap(ecl_safe_apply(self.obj,(<EclObject>lispargs).obj)) File "sage/libs/ecl.pyx", line 365, in sage.libs.ecl.ecl_safe_apply (build/cythonized/sage/libs/ecl.c:4861) raise RuntimeError, "ECL says: "+ecl_base_string_pointer_safe(s) RuntimeError: ECL says: Error executing code in Maxima:

Since Sage can't do this integral symbolically, we'll find a numerical approximation instead. In Sage we can use the numerical_integral command.

abf(x)dx\displaystyle \int_a^b f(x)\, dx\approxnumerical_integral(f,a,b)

Note: Since this is numerical, only one variable is involved, so you do not specify the variable.

(3.820197789027712, 4.241271544000682e-14)

numerical_integral returns an ordered pair: the first number is the answer, and the second number is an estimate of the error in the approximation (notice the e-14: this number is 4.24×10140)4.24\times10^{-14}\approx 0).

Thus, our arc length is approximately 3.82023.8202.

Areas of Surfaces of Revolution

We have already talked about the volume of a solid of revolution, which you get by rotating a region around an axis. In particular, we saw what happens when you take the region between the graph of a function and the x-axis. If you rotate just the boundary curve, and not the region under the curve, then you do not get a solid; instead, you get a surface of revolution. Our goal is to find the surface area of such objects.

Since we have already seen the development of formulas involving integrals for volume and for arclength, I am going to skip over most of the derivation of the surface area formula.

We have a curve y=f(x)0y=f(x)\ge 0 from x=ax=a to x=bx=b. We are going to rotate this curve around the x-axis to form a surface.

We divide the interval [a,b][a,b] into nn subintervals of equal width with endpoints a=x0<x1<x2<<xn=ba=x_0 < x_1 < x_2 < \ldots < x_n=b.

For each subinterval [xi,xi+1][x_i,x_{i+1}], we approximate the curve with a line segment from the point (xi,f(xi))(x_i,f(x_i)) to the point (xi+1,f(xi+1))(x_{i+1},f(x_{i+1})).

When we rotate this line segment around the x-axis, we get an approximation for the portion of the surface on this subinterval. Rotating a line segment around an axis produces a frustum of a cone (i.e., a cone with the top cut off). The surface area of a frustum of a cone is known from geometry to be 2πyL2\pi y L, where LL is the length of the line segment and yy is the average height of the line segment above the x-axis.

To get the surface area, you add up the approximations from each subinterval, and take the limit as nn goes to \infty. You have to do some algebraic manipulation, and you have to use the Mean Value Theorem (similar to what we did for arc length). I will omit the messy steps.

Surface Area Formula

If the function f(x)0f(x)\ge0 and f(x)f'(x) is continuous on the interval [a,b][a,b], the area of the surface generated by rotating the graph of ff around the x-axis is S=ab2πf(x)1+f(x)2dx.S=\int_a^b 2\pi f(x)\sqrt{1+f'(x)^2}\, dx.

Example 5

Find the surface area of a sphere of radius rr.

Solution: We rotate the graph of f(x)=r2x2\displaystyle f(x)=\sqrt{r^2-x^2} from x=rx=-r to x=rx=r to generate a sphere.

Since f(x)=xr2x2\displaystyle f'(x)=\frac{-x}{\sqrt{r^2-x^2}}, we have S=rr2πr2x21+(xr2x2)2dx=rr2πr2x2r2r2x2dx=rr2πrdx=4πr2.S=\int_{-r}^r 2\pi \sqrt{r^2-x^2}\sqrt{1+\left(\frac{-x}{\sqrt{r^2-x^2}}\right)^2}\, dx=\int_{-r}^r 2\pi \sqrt{r^2-x^2}\sqrt{\frac{r^2}{r^2-x^2}}\, dx=\int_{-r}^r 2\pi r\, dx=4\pi r^2.

3D rendering not yet implemented
%var r f(x)=sqrt(r^2-x^2) integral(2*pi*f(x)*sqrt(1+derivative(f,x)^2),x,-r,r)

Rotation around the y-axis

If you rotate around the y-axis, then you may use xx as a function of yy:

If g(y)0g(y)\ge0 and gg' is continuous on the interval [c,d][c,d] (interval of y-values), the area of the surface generated by rotating the graph of x=g(y)x=g(y) about the y-axis is S=cd2πg(y)1+g(y)2dy.S=\int_c^d 2\pi g(y)\sqrt{1+g'(y)^2}\, dy.

Alternatively, if you have y=f(x)y=f(x) from x=ax=a to x=bx=b, then you can use S=ab2πx1+f(x)2dx.S=\int_a^b 2\pi x\sqrt{1+f'(x)^2}\, dx.

Example 6

Find the area of the surface generated by rotating around the y-axis the graph of f(x)=x2f(x)=x^2 from x=0x=0 to x=2x=2.

Solution: Since we are rotating around the y-axis, we can find gg so that x=g(y)x=g(y). We solve y=x2y=x^2 for xx to get x=yx=\sqrt{y} (note x>0x>0). The x-interval [0,2][0,2] corresponds to the y-interval [0,4][0,4].

Now g(y)=12yg'(y)=\frac{1}{2\sqrt{y}}, so S=042πy1+(12y)2dy=π6(17171).S=\int_0^4 2\pi \sqrt{y}\sqrt{1+\left(\frac{1}{2\sqrt{y}}\right)^2}\, dy=\frac{\pi}{6}\left(17\sqrt{17}-1\right).

But since we were given f(x)f(x), it would be easier to do everything in terms of xx:

S=022πx1+(2x)2dx=π6(17171).S=\int_0^2 2\pi x\sqrt{1+(2x)^2}\, dx=\frac{\pi}{6}\left(17\sqrt{17}-1\right).

Here are the calculations of the two integrals:

g(y)=sqrt(y) integral(2*pi*g(y)*sqrt(1+derivative(g(y),y)^2),y,0,4) #using g(y) N(_)
1/6*pi*(17*sqrt(17) - 1) 36.1769031974114
f(x)=x^2 integral(2*pi*x*sqrt(1+derivative(f(x),x)^2),x,0,2) #using f(x) N(_)
1/6*pi*(17*sqrt(17) - 1) 36.1769031974114
3D rendering not yet implemented

Example 7 (Gabriel's Horn)

Consider the surface obtained by rotating around the x-axis the graph of f(x)=1x\displaystyle f(x)=\frac{1}{x} for x1x\ge 1.

The area of this surface is S=12π1x1+(1x2)2dx12πxdx=S=\int_1^{\infty}2\pi\frac{1}{x}\sqrt{1+\left(-\frac{1}{x^2}\right)^2}\, dx \ge \int_1^{\infty}\frac{2\pi}{x}\, dx=\infty

[1+(1x2)21]\left[\sqrt{1+\left(-\frac{1}{x^2}\right)^2}\ge 1\right]

so our surface area integral diverges (infinite surface area).

The curious thing about Gabriel's Horn is that it holds a finite volume. Using the method of disks, the enclosed volume is V=1π(1x)2dx=π.V=\int_1^{\infty} \pi\left( \frac{1}{x}\right)^2\, dx=\pi.


Here's a piece of the horn:

3D rendering not yet implemented