Calculus (Differentiation)

Description

Published by Marcel Pelletier, June 2023, in the MoHPC - General Software Library

Introduction

This document shows how to use a numerical approximation to the derivative of a function to calculate the arc length of a curve, the area of a surface of revolution and the volume of a solid of revolution.

Usage of the program and examples

1. Numerical Derivative (Label D)

Program D uses the registers .0 and .1. The user-defined function can be added at the end of the program memory at label A.
The SOLVE and yx functions can be used with the program. The symmetric difference quotient is used to calculate the slope of the secant line with:
       f(x+h) - f(x-h)
f(x) = ———————————————
             2h

Example 1:
The curve y=ex•sin(x) has a minimum in the interval [4, 6]. What is the value of the minimum?

In PRGM mode:
Delete any existing program at label A.

f LBL A
ex
g LSTx
SIN
×
g RTN

In RUN mode:

g RAD
4 ENTER → 4.0000
6 f SOLVE D → 5.4978 (Value x where f(x)=0)
f A → -172.6409 (Minimum)

2. Arc Length (Label 1)

This program uses the Arc Length Formula and the label D to calculate the length L.
    a
L = ∫ √(1+(f'(x))²) dx
    b

The user-defined function is located in label A.

Example 2:
Find the arc length along the curve y=x²-¹/₈ln(x) from point A (1, 1) to point B (3, f(3)).

In PRGM mode:
Delete any existing program at label A.

f LBL A
g
g LSTx
g LN
8
÷

g RTN

In RUN mode:

1 ENTER → 1.000
3 f yx 1 → 8.1373 (Arc length along the curve from 1 to 3)

3. Area of a Surface of Revolution (Label 2)

This program uses the function yx to calculate the area S of the surface resulting from the rotation of the curve y=f(x),a≤x≤b, around the x-axis as
    a
S = ∫ 2π•f(x)•√(1+(f'(x))²) dx
    b

The user-defined function is expected at label A.

Example 3:
The curve y=√(4−x²),-1≤x≤1, is an arc of the circle x²+y²=4. Find the area of the surface obtained by rotating this arc around the x-axis. The surface is a portion of a sphere of radius 2.

In PRGM mode:
Delete any existing program at label A.

f LBL A
g
4
x↔y

√x
g RTN

In RUN mode:

1 CHS ENTER → 1.0000
1 f yx 2 → 25.1327 (Area of the surface.)

Example 4:
The arc of the parabola y=x² from (1, 1) to (2, 4) is rotated around the y-axis. Find the area of the resulting surface. Since the axis of rotation is the y-axis, we use f(y)=√y from 1 to 4.

In PRGM mode:
Delete any existing program at label A.

f LBL A
√x
g RTN

In RUN mode:

1 ENTER → 1.0000
4 f yx 2 → 30.8465 (Area of the surface!)

4. Volume of a Solid of Revolution (Label 3)

This program use with yx function, calculate the volume V of the solid obtained by rotating the curve y=f(x), a≤x≤b, around the x-axis as
    a
V = ∫ π(f(x))² dx
    b

The user-defined function is at label A.

If the region is enclosed by the curve y₁ and y₂ where y₁>y₂, a≤x≤b then the user function is f(x)=y₁ labeled A and g(x)=y₂ is labeled B. In this case, the volume V of the region is
    a
V = ∫ π[(f(x))²−(g(x))²] dx
    b


Example 5:
Find the volume of the solid obtained by rotating the region bounded by y=x³, y=8, and x=0 around the y-axis. Since the axis of rotation is y-axis, we use f(y)=³√x from 0 to 8.

In PRGM mode:
Delete any existing program at label A.

f LBL A
3
¹/x
yx
g RTN

In RUN mode:

g CF 1 (This is the first case!)
0 ENTER
f yx 3 → 60.3185 (Volume of the solid)

Example 6:
The region enclosed by curves y=x and y=x² is rotated around the x-axis. Find the volume of the resulting solid.
The curves intersect at the points (0, 0) and (1, 1). The region between them is the solid of rotation. A cross-section in the plane has the shape of a washer.
We have Label A: f(x)=x and Label B: g(x)=x².

In PRGM mode:
Delete any existing program at label A.

f LBL A
g RTN
f LBL B

g
g RTN

In RUN mode:

g SF 1 (This is the second case!)
0 ENTER
f yx 3 → 0.4189 (Volume of the solid)

Program Resources

Labels

Name Description
 A User-defined function A
 B User-defined function B
 D Numerical Derivative
 1 Arc Length
 2 Area of a Surface of Revolution
 3 Volume of a Solid of Revolution
 4

Storage Registers

Name Description
.0 Save x value for later use in subroutine D
.1 0.0001
.2 Save x value for later use in subroutine 3

Flags

Number Description
1

Program

Line Display Key Sequence Line Display Key Sequence Line Display Key Sequence
000 021 40 + 042 43, 6, 1 g F? 1
001 42,21,14 f LBL D 022 11 √x̅ 043 32 4 GSB 4
002 44 .0 STO . 0 023 43 32 g RTN 044 43 26 g π
003 26 EEX 024 42,21, 2 f LBL 2 045 20 ×
004 16 CHS 025 32 14 GSB D 046 43 32 g RTN
005 4 4 026 43 11 g 047 42,21, 4 f LBL 4
006 44 .1 STO . 1 027 1 1 048 45 .2 RCL . 2
007 40 + 028 40 + 049 32 12 GSB B
008 32 11 GSB A 029 11 √x̅ 050 43 11 g
009 45 .0 RCL . 0 030 45 .0 RCL . 0 051 30
010 45,30, .1 RCL . 1 031 32 11 GSB A 052 43 32 g RTN
011 32 11 GSB A 032 20 × 053 42,21,11 f LBL A
012 30 033 2 2 054 43 11 g
013 2 2 034 20 × 055 43 36 g LSTΧ
014 45,20, .1 RCL × . 1 035 43 26 g π 056 43 12 g LN
015 10 ÷ 036 20 × 057 8 8
016 43 32 g RTN 037 43 32 g RTN 058 10 ÷
017 42,21, 1 f LBL 1 038 42,21, 3 f LBL 3 059 30
018 32 14 GSB D 039 44 .2 STO . 2 060 43 32 g RTN
019 43 11 g 040 32 11 GSB A
020 1 1 041 43 11 g