Shared07 - Arc Length and Surface Area Assignments / Arc Length and Surface Area Notes.sagewsOpen in CoCalc
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.
%md
### Prerequisites:

* 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) from x=a to x=b . This is called "arc length."

We will assume that our function is "smooth" on [a,b] , which means that the derivative f' is continuous at every x in [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] into n subintervals of equal width with endpoints a=x_0 < x_1 < x_2 < \ldots < x_n=b .

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

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

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

Here is a sample picture with n=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 L_i be the distance from (x_i,f(x_i)) to (x_{i+1},f(x_{i+1})) . Then

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 \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 c_i with x_i < c_i < x_{i+1} such that f'(c_i)=\frac{f(x_{i+1})-f(x_i)}{\Delta x} . Multiplying both sides by \Delta x gives:

f(x_{i+1})-f(x_i)=f'(c_i)\cdot\Delta x.

So then we have

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

\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 f' is continuous to guarantee that this integral exists.]

Arc Length Formula

If f' is continous on the interval [a,b] , then the arc length of the curve y=f(x) from x=a to x=b is

L=\int_a^b\sqrt{1+f'(x)^2}\, dx.

Example 1

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

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

Therefore,

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)
arcsinh(1)

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

N(arcsinh(1));N(ln(sqrt(2)+1))
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)=\frac{1}{8}x^2-\ln(x) from x=1 to x=2 .

Solution: Since \displaystyle f'(x)=\frac{x}{4}-\frac{1}{x} , we have \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)=3x^2-5x+4 from x=0 to x=2 .

Solution: Since f'(x)=6x-5 , we have \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 L\approx 6.6624 .

Example 4

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

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

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

integral(sqrt(1+sin(x)^2),x,0,pi)
Error in lines 1-1 Traceback (most recent call last): File "/projects/9189c752-e334-4311-afa9-605b6159620a/.sagemathcloud/sage_server.py", 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/functional.py", 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/integral.py", 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/integral.py", line 176, in _eval_ return integrator(*args) File "/projects/sage/sage-6.7/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py", 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/maxima_lib.py", 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.

\displaystyle \int_a^b f(x)\, dx\approx numerical_integral(f,a,b)

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

numerical_integral(sqrt(1+sin(x)^2),0,pi)
(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\times10^{-14}\approx 0) .

Thus, our arc length is approximately 3.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)\ge 0 from x=a to x=b . We are going to rotate this curve around the x-axis to form a surface.

We divide the interval [a,b] into n subintervals of equal width with endpoints a=x_0 < x_1 < x_2 < \ldots < x_n=b .

For each subinterval [x_i,x_{i+1}] , we approximate the curve with a line segment from the point (x_i,f(x_i)) to the point (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\pi y L , where L is the length of the line segment and y 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 n 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)\ge0 and f'(x) is continuous on the interval [a,b] , the area of the surface generated by rotating the graph of f around the x-axis is

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 r .

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

Since \displaystyle f'(x)=\frac{-x}{\sqrt{r^2-x^2}} , we have

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.

%auto
%hide
f(x)=sqrt(1-x^2)
revolution_plot3d(f,(x,-1,1),parallel_axis='x',show_curve=True)
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)
4*pi*r^2

Rotation around the y-axis

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

If g(y)\ge0 and g' is continuous on the interval [c,d] (interval of y-values), the area of the surface generated by rotating the graph of x=g(y) about the y-axis is

S=\int_c^d 2\pi g(y)\sqrt{1+g'(y)^2}\, dy.

Alternatively, if you have y=f(x) from x=a to x=b , then you can use

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)=x^2 from x=0 to x=2 .

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

Now g'(y)=\frac{1}{2\sqrt{y}} , so

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) , it would be easier to do everything in terms of x :

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:

%var y
integral(2*pi*sqrt(y)*sqrt(1+(1/2/sqrt(y))^2),y,0,4) #using g(y)
N(_)
1/6*pi*(17*sqrt(17) - 1) 36.1769031974114
integral(2*pi*x*sqrt(1+4*x^2),x,0,2) #using f(x)
N(_)
1/6*pi*(17*sqrt(17) - 1) 36.1769031974114
%auto
%hide
f(x)=x^2
revolution_plot3d(f,(x,0,2),parallel_axis='z',show_curve=True) #revolution_plot3d assumes the function f is in the xz-plane, so we rotate around the z axis.
3D rendering not yet implemented

Example 7 (Gabriel's Horn)

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

The area of this surface is

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

\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=\int_1^{\infty} \pi\left( \frac{1}{x}\right)^2\, dx=\pi.

integral(pi/x^2,x,1,+Infinity)
pi

Here's a piece of the horn:

%auto
%hide
f(x)=1/x
revolution_plot3d(f,(x,1,5),parallel_axis='x',show_curve=True)
3D rendering not yet implemented