Understanding Differentiation Concepts
Understanding Differentiation Concepts
Differentiation
Introduction
The derivative of a function represents the rate of change of a variable with respect to
another variable. For example, the velocity of a body is defined as the rate of change of the
location of the body with respect to time. The location is the dependent variable while time
is the independent variable. Now if we measure the rate of change of velocity with respect to
time, we get the acceleration of the body. In this case, the velocity is the dependent variable
while time is the independent variable.
Whenever differentiation is introduced to a student, two concepts of the secant line
and tangent line (Figure 1) are revisited.
§
f(x)
secant line
Q
tangent
line
P
x
Figure 1 Function curve with tangent and secant lines.
Let and be two points on the curve as shown in Figure 1. The secant line is the straight
line drawn through and .
02.01.1
02.01.2 Chapter 02.01
f (x)
a a+h x
As moves closer and closer to , the limiting portion is called the tangent line. The slope
of the tangent line then is the limiting value of as .
Example 1
Find the slope of the secant line of the curve between points (3,36) and (5,100).
Primer on Differentiation 02.01.3
250
200
150
f(x)
100
(5,100)
50 (3,36)
0
-2 -1 0 1 2 3 4 5 6 7 8
Example 2
Find the slope of the tangent line of the curve at point (3,36).
Solution
The slope of the tangent line at (3,36) is
02.01.4 Chapter 02.01
70
60
50
40
f(x)
30
20
10
0
-2 -1 0 1 2 3 4 5
24
Derivative of a Function
Recall from calculus, the derivative of a function at is defined as
Primer on Differentiation 02.01.5
Example 3
Find if .
Solution
f (x)
( x, f ( x)) P
f ( x) f (a)
(a, f (a)) x a
Q
a x x
Example 4
Find if by using the form
Example 5
Find the equation of the line tangent to the function
at .
Solution
The line tangent is a straight line of the form
To find the equation of the tangent line, let us first find the slope of the straight line.
f ( x) 3 x 2 0.165
To find the value of the -intercept of the straight line, we first find the value of the
function at .
Primer on Differentiation 02.01.7
0.04
0.03
0.02
0.01
f(x)
0
-0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5
-0.01
-0.02
-0.03
Hence,
Theorems of Differentiation
Several theorems of differentiation are given to show how one can find the derivative of
different functions.
Theorem 1
The derivative of a constant is zero. If , where is a constant, .
Example 6
Find the derivative of .
Solution
Theorem 2
The derivative of , where is .
Example 7
Find the derivative of .
Solution
Theorem 3
The derivative of , where is a constant is .
Example 8
Find the derivative of .
Solution
Primer on Differentiation 02.01.9
Theorem 4
The derivative of is .
Example 9
Find the derivative of .
Solution
f ( x) 3 x 3 8
d
f ( x) (3x 3 8)
dx
d d
(3x 3 ) (8)
dx dx
d
3 ( x 3 ) 0
dx
3(3 x 2 )
9x 2
Theorem 5
The derivative of
is
. (Product Rule)
Example 10
Find the derivative of
Solution
Using the product rule as given by Theorem 5 where,
Theorem 6
The derivative of
is
(Quotient Rule)
Example 11
then
Primer on Differentiation 02.01.11
From
we have
Table of Derivatives
f (x) f (x)
x n , n 0 nx n 1
kx n , n 0 knx n 1
02.01.12 Chapter 02.01
sin(x) cos(x)
cos(x) sin(x)
tan(x) sec 2 ( x)
1
cos 1 ( x)
1 x2
1
tan 1 ( x)
1 x2
csc(x) csc( x)cot ( x)
ax ln(a )a x
1
ln(x)
x
1
log a (x)
xln(a)
ex ex
Implicit Differentiation
Sometimes, the function to be differentiated is not given explicitly as an expression of the
independent variable. In such cases, how do we find the derivatives? We will discuss this
via examples.
Primer on Differentiation 02.01.13
Example 12
Find if
Solution
Example 13
Given , find the second derivative, and the third derivative, .
Solution
Given
we have
02.01.14 Chapter 02.01
Example 14
Find the minimum and maximum value of in the interval .
maximum
Domain = [c,d]
minimum
c d x
Figure 7 Graph illustrating the concepts of maximum and minimum.
Primer on Differentiation 02.01.15
●
● Local Maximum
Local Maximum (f´′(x) does not exist)
●
●
Local ●
Minimum
● Local Minimum
● Absolute Minimum
c d x
Figure 8 The plot shows critical points of in .
Solution
at .
exists everywhere in .
So the critical points are .
Hence, the minimum value of occurs at , and the maximum value occurs at .
02.01.16 Chapter 02.01
12
10 maximum
8
4
f(x)
0
0 1 2 3 4 5 6
-2
-4 minimum
-6
-8
Figure 9 Maximum and minimum values of over interval [0,5].
x
Figure 10 shows an example of a function that has no minimum or maximum value in the
domain .
f (x)
f ( x) 1 / x
Figure 11 shows the maximum of the function occurring at a singular point. The function
has a sharp corner at .
Primer on Differentiation 02.01.17
f (x)
x a x
Example 15
Find the maximum and minimum of in the interval .
Solution
on .
So the critical points are and .
Example 16
Remember Example 14 where we found at for in the
interval . Is a local maxima or minima of the function?
Solution
02.01.18 Chapter 02.01
at
Applications of Derivatives
Below are some examples to show real-life applications of differentiation.
Example 17
A rain gutter cross-section is shown below.
A E D
3 3
B 3 C
Figure 12 Gutter dimensions for Example 21.
What angle of would make the cross-sectional area of ABCD maximum? Note that
common sense or intuition may lead us to believe that would maximize the cross-
sectional area of ABCD. Question your intuition.
Solution
Primer on Differentiation 02.01.19
When is
?
Chapter 02.03
Differentiation of Discrete Functions
To find the derivatives of functions that are given at discrete points, several methods are
available. Although these methods are mainly used when the data is spaced unequally, they
can be used for data that is spaced equally as well.
f (x)
x x x x
Figure 1 Graphical representation of forward difference approximation of first derivative.
So given n 1 data points x0 , y 0 , x1 , y1 , x 2 , y 2 , , x n , y n , the value of f (x) for
xi x xi 1 , i 0,..., n 1 , is given by
f xi 1 f xi
f xi
xi 1 xi
Example 1
The upward velocity of a rocket is given as a function of time in Table 1.
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67
Using forward divided difference, find the acceleration of the rocket at t 16 s .
Solution
To find the acceleration at t 16 s , we need to choose the two values of velocity closest to
t 16 s , that also bracket t 16 s to evaluate it. The two points are t 15 s and t 20 s
Primer on Differentiation 02.01.21
vti 1 ti
ati
t
t i 15
t i 1 20
t ti 1 ti
20 15
5
20 15
a 16
5
517.35 362.78
5
= 30.914 m/s 2
Lagrange Polynomial
In this method, given x0 , y 0 , , x n , y n , one can fit a n th order Lagrangian polynomial
given by
n
f n ( x) Li ( x) f ( xi )
i 0
where n in f n (x) stands for the n th order polynomial that approximates the function
y f (x) and
n x xj
Li ( x)
j 0 x i x j
j i
2 2 2
f 2x f x0 f x1 f x 2
x0 x1 x0 x2 x1 x0 x1 x 2 x2 x0 x 2 x1
Example 3
The upward velocity of a rocket is given as a function of time in Table 3.
Determine the value of the acceleration at t 16 s using second order Lagrangian polynomial
interpolation for velocity.
Solution
t t1 t t 2 t t 0 t t 2 t t 0 t t1
v(t ) v(t 0 ) v(t1 ) v(t 2 )
t 0 t1 t 0 t 2 t 1 t 0 t1 t 2 t 2 t 0 t 2 t1
2t t1 t 2 2t t 0 t 2 2t t 0 t1
at t 0 t1 t
t 0 t1 t 0 t 2 t1 t 0 t1 t 2 t 2 t 0 t 2 t1 2
216 15 20
a16 227.04 216 10 20 362.78
10 1510 20 15 1015 20
Primer on Differentiation 02.01.23
What is integration?
The dictionary definition of integration is combining parts so that they work together or form
a whole. Mathematically, integration stands for finding the area under a curve from one
point to another. It is represented by
b
f ( x)dx
a
f (c )x , x
i 1
i i i 1 c i x i
is called a Riemann sum of the function f for the partition on the interval [a, b] . For a
given partition , the length of the longest subinterval is called the norm of the partition. It is
denoted by (the norm of ).
This limit exists if and only if for any positive number , there exists a positive number
such that for every partition of [a, b] with , it follows that
n
I f (c )x
i 1
i i
n
lim f (ci )xi I
0
i 1
where
b
I f ( x)dx
a
Theorem: If the function f is continuous on the closed interval [a, b] , then there exists a
number c in [a, b] such that:
b
1
b a
f (c ) f ( x)dx
a
u ( x) v( x)dx u ( x)dx v( x)dx C tan xdx ln cos x C ln sec x C
x n 1 1
x dx n 1 C
n
dx 1
ax b a ln ax b C sec
2 1
axdx tan(ax) C
a
ax
a dx
x
C
ln a sec( x) tan( x)dx sec( x) C
e ax
e dx a C
ax
Example 5
Evaluate the following integral
1
x2
2 xe
0
dx
Solution
Let u x 2 , du 2 xdx
At x 0, u (0) 2 0
At x 1, u (1) 2 1
02.01.26 Chapter 02.01
1 1
x2 2
2 xe
0
dx ( e x )( 2 xdx)
0
1
( eu )(du )
0
eu
1
0
e 1 ( e 0 )
=0.6321
Example 6
Evaluate
/4
1 sin x
cos
0
2
x
dx
Solution
/4 /4
1 sin x 1 sin x
0
cos 2
x
dx cos
0
2
x
dx
cos 2 x
/4
sec
2
x sec x tan x dx
0
/4 /4
tan x 0 sec x 0
4 4
1 0 2 1
2
b
b n 1 a n 1
, n 1
n
x dx (1)
a n 1
So if we want to approximate the integral
b
I f ( x)dx (2)
a
b2 a2
a 0 (b a ) a1
2
But what is 0 and a1 ? Now if one chooses, (a, f (a )) and (b, f (b)) as the two points to
a
approximate f (x) by a straight line from a to b ,
02.01.28 Chapter 02.01
f (a ) f 1 (a ) a 0 a1 a
f (b) f 1 (b) a 0 a1b
f ( x)dx Area of
a
trapezoid
1
(Sum of length of parallel sides)(Perpendicular distance between parallel sides)
2
1
f (b) f (a) (b a)
2
f (a) f (b)
(b a)
2
Example 4
Use multiple-segment trapezoidal rule to find
2
1
I dx
0 x
Solution
We cannot use the trapezoidal rule for this integral, as the value of the integrand at x 0 is
infinite. However, it is known that a discontinuity in a curve will not change the area under
it. We can assume any value for the function at x 0 . The algorithm to define the function
so that we can use the multiple-segment trapezoidal rule is given below.
Function f (x)
If x 0 Then f 0
If x 0 Then f x ^ ( 0.5)
End Function
Primer on Differentiation 02.01.31
Basically, we are just assigning the function a value of zero at x 0 . Everywhere else, the
function is continuous. This means the true value of our integral will be just that—true.
Let’s see what happens using the multiple-segment trapezoidal rule.
Using two segments, we get
2 0
h 1
2
f (0) 0
1
f (1) 1
1
1
f (2) 0.70711
2
b a n 1
I f ( a ) 2 f (a ih) f (b)
2n i 1
2 0 2 1
f ( 0) 2 f (0 1) f (2)
2(2) i 1
2
f (0) 2 f (1) f (2)
4
2
0 2(1) 0.70711
4
1.3536
So what is the true value of this integral?
2
1
0 x
dx 2.8284
n Approximate Et t
Value
2 1.354 1.474 52.14%
4 1.792 1.036 36.64%
8 2.097 0.731 25.85%
16 2.312 0.516 18.26%
32 2.463 0.365 12.91%
64 2.570 0.258 9.128%
128 2.646 0.182 6.454%
02.01.32 Chapter 02.01
h3 n
f " ( i )
12 i 1
(b a ) 3 n
12n 3
f " ( )
i 1
i
(b a ) 3 f " ( ) i
i 1
12n 2 n
n
(b a ) 3
f " ( i )
Et i 1
12n 2 n
In Table 4, the approximate value of the integral
30
140000
8
2000 ln
140000 2100t 9.8t dt
is given as a function of the number of segments. You can visualize that as the number of
segments are doubled, the true error gets approximately quartered.
n Approximate Et t % a %
Value
2 11266 -205 1.853 5.343
4 11113 -52 0.4701 0.3594
8 11074 -13 0.1175 0.03560
16 11065 -4 0.03616 0.00401
a a
can be viewed as the area under the second order polynomial, while the equation from
Method 4
b
b a 2(b a ) a b b a
a
f ( x)dx
6
f (a)
3
f
2
6
f (b)
Example 1
The distance covered by a rocket in meters from t 8 s to t 30 s is given by
30
140000
x 2000 ln 9.8t dt
8 140000 2100t
Use Simpson’s 1/3 rule to find the approximate value of x .
Find the true error, Et .
Find the absolute relative true error, t .
Solution
b a a b
a) x f (a) 4 f f (b)
6 2
a 8
b 30
a b
19
2
140000
f (t ) 2000 ln 9.8t
140000 2100t
140000
f (8) 2000 ln 9.8(8) 177.27m / s
140000 2100(8)
140000
f (30) 2000 ln 9.8(30) 901.67m / s
140000 2100(30)
140000
f (19) 2000 ln 9.8(19) 484.75m / s
140000 2100(19)
b a a b
x f (a ) 4 f f (b)
6 2
30 8
f (8) 4 f (19) f (30)
6
22
177.27 4 484.75 901.67
6
=11065.72 m
b) The exact value of the above integral is
30
140000
x 2000 ln 9.8t dt
8 140000 2100t
=11061.34 m
Primer on Differentiation 02.01.35
f ( x)dx f ( x)dx
a x0
where
x 0 a
x n b
b x2 x4 xn 2 xn
b n 1 n 2
b a
f ( x )dx f ( x 0 ) 4 f ( xi ) 2 f ( xi ) f ( x n )
a
3n i 1 i 2
i odd i even
f ( x)dx c
a
1 f (a ) c 2 f (b)
Let the right hand side be exact for integrals of a straight line, that is, for an integrated form
of
02.01.36 Chapter 02.01
a
a
0 a1 x dx
So
b b
x2
a 0 a1 x dx a
0 x a1
a 2 a
b2 a2
a 0 b a a1
2
But from Equation (1), we want
b
a
a
0 a1 x dx c1 f (a) c 2 f (b)
a
a
0 a1 x dx c1 a 0 a1 a c 2 a 0 a1b
f ( x)dx c
a
1 f (a ) c 2 f (b)
b a b a
f (a) f (b)
2 2
Derivation of two-point Gauss quadrature rule
The two-point Gauss quadrature rule is an extension of the trapezoidal rule approximation
where the arguments of the function are not predetermined as a and b , but as unknowns x1
and x2 . So in the two-point Gauss quadrature rule, the integral is approximated as
Primer on Differentiation 02.01.37
b
I f ( x)dx
a
c1 f ( x1 ) c 2 f ( x 2 )
b
f ( x )dx c f x c f x
a
1 1 2 2
b
b a b a 1 ba b a b a 1 ba
f ( x)dx
a
2
f
2
3
2 2
f
2 3
2
Since two points are chosen, it is called the two-point Gauss quadrature rule. Higher point
versions can also be developed.
f ( x)dx c
a
1 f ( x1 ) c 2 f ( x 2 ) c3 f ( x3 )
is called the three-point Gauss quadrature rule. The coefficients c1 , c 2 and c3 , and the
function arguments x1 , x 2 and x3 are calculated by assuming the formula gives exact
expressions for integrating a fifth order polynomial
b
a a x a x a x a x a x dx .
2 3 4 5
0 1 2 3 4 5
a
f ( x)dx c
a
1 f ( x1 ) c 2 f ( x 2 ) . . . . . . . c n f ( x n ) (18)
g ( x)dx c g ( x )
1 i 1
i i (19)
Example 1
Give some examples of improper integrals
Solution
The integral
2
x
I dx
0 4 x2
is improper because the integrand becomes infinite at x 2 .
The integral
2
x
I dx
0 1 x
is improper because the integrand becomes infinite at x 1 .
The integral
I e t tdt
0
Determine the distance, s, covered by the rocket from t 11 to t 16 using the velocity
data provided and use any applicable numerical technique.
Solution
Method 1: Average Velocity Method
The velocity of the rocket is not provided at t 11 and t 16, so we will have to use an
interval that includes 11, 16 to find the average velocity of the rocket within that range. In
this case, the interval 10, 20 will suffice.
v(10) 227.04
v(15) 362.78
v(20) 517.35
v (10) v (15) v ( 20)
Average Velocity
3
227.04 362.78 517.35
3
369.06 m/s
Using
s v t ,
we get
s (369.06)(16 11) 1845.3 m
and applying the trapezoidal rule over each of the above integrals gives
20
15 10 20 15
10
v (t )dt
2
[v (10) v (15)]
2
[v (15) v ( 20)]
and applying the trapezoidal rule over each of the above integrals gives
16
15 11 16 15
11
v (t )dt
2
[v (11) v (15)]
2
[v (15) v (16)]
15 11 16 15
( v (11) 362.78) (362.78 v (16))
2 2
How do we find v(11) and v(16) ? We use linear interpolation. To find v(11) ,
v(t ) 227.04 27.148t 10 , 10 t 15
v (11) 227.04 27.14811 10
254.19 m/s
and to find v(16)
v (t ) 362.78 30.913t 15, 15 t 20
v (16) 362.78 30.91316 15
393.69 m/s
Then
16
15 11 16 15
11
v(t )dt
2
(v(11) 362.78)
2
(362.78 v(16))
15 11 16 15
(254.19 362.78) (362.78 393.69)
2 2
1612.2 m
Primer on Differentiation 02.01.41
1595.9 m
02.01.42 Chapter 02.01
Example 2
What is the absolute relative true error for each of the four methods used in Example 1 if the
data in Table 1 was actually obtained from the velocity profile of
140000
v(t ) 2000 ln 9.8t ,
140000 2100t
v
where is given in m/s and in s. t
Solution
The distance covered between t 11 and t 16 is
16
140000
s 2000 ln 9.8t dt
11 140000 2100t
1604.9 m
Method 1
The approximate value obtained using average velocity method was 1845.3 m . Hence, the
absolute relative true error, t , is
1604.9 1845.3
t 100%
1604.9
14.976%
Method 2:
The approximate value obtained using the trapezoidal rule was 1612.2 m . Hence, the
absolute relative true error, t , is
1604.9 1612.2
t 100%
1604.9
0.451%
Method 3:
The approximate value obtained using the direct polynomial was 1604.3 m. Hence, the
absolute relative true error, t , is
1604.9 1604.3
t 100%
1604.9
0.037%
Method 4:
The approximate value obtained using the spline interpolation was 1595.9 m, hence, the
absolute relative true error, t , is
1604.9 1595.9
t 100%
1604.9
0.564%
Approximate t
Method
Value
Average Velocity 1845.3 14.976%
Trapezoidal Rule 1612.2 0.451%
Polynomial Interpolation 1604.3 0.037%
Spline Interpolation 1595.9 0.564%
f x1 f x 2 f x 2 f x3
x 2 x1 x3 x 2 ......
2 2
f x n 1 f x n
....... x n x n 1
2
This approach uses the trapezoidal rule in the intervals x1 , x2 , x 2 , x3 , ….., x n 1 , x n and
then adds the obtained values.
f x dx
a
is given by
n
f i
Et
b a 3
i 1 (2)
2
12n n
where for each i , i is a point somewhere in the domain a i 1h, a ih , and
n
the term
f can be viewed as an approximate average value of f x in a, b .
i 1
i
n
02.01.44 Chapter 02.01
Romberg Integration
Romberg integration is the same as Richardson’s extrapolation formula as given by
Equation (8) . However, Romberg used a recursive algorithm for the extrapolation as
follows.
The estimate of the true error in the trapezoidal rule is given by
n
f i
E t
b a 3
i 1
12n 2 n
Since the segment width, h , is given by
b a
h
n
Equation (2) can be written as
n
f
E t
h 2
b a i 1
i
(9)
12 n
The estimate of true error is given by
E t Ch 2 (10)
It can be shown that the exact true error could be written as
Primer on Differentiation 02.01.45
Et A1 h 2 A2 h 4 A3 h 6 ... (11)
and for small h ,
Et A1h 2 O h 4 (12)
2
Since we used Et Ch in the formula (Equation (12)), the result obtained from
Equation (10) has an error of O h 4 and can be written as
I 2 n R I 2 n I 2 n I n
3
I I
I 2 n 22n 1 n (13)
4 1
where the variable TV is replaced by I 2 n R as the value obtained using Richardson’s
extrapolation formula. Note also that the sign is replaced by the sign =.
Hence the estimate of the true value now is
TV I 2 n R Ch 4
Determine another integral value with further halving the step size (doubling the number of
segments),
I 4 n R I 4 n I 4 n I 2 n (14)
3
then
4
h
TV I 4 n R C
2
From Equation (13) and (14),
I 4 n R I 2 n R
TV I 4 n R
15
I 4 n R I 2 n R
I 4 n R (15)
43 1 1
The above equation now has the error of O h 6 . The above procedure can be further
improved by using the new values of the estimate of the true value that has the error of O h 6
to give an estimate of O h8 .
Based on this procedure, a general expression for Romberg integration can be written as
I I
I k , j I k 1, j 1 k 1, j k1 1 k 1, j , k 2 (16)
4 1
The index k represents the order of extrapolation. For example, k 1 represents the values
obtained from the regular trapezoidal rule, k 2 represents the values obtained using the
true error estimate as O h 2 , etc. The index j represents the more and less accurate estimate
02.01.46 Chapter 02.01
of the integral. The value of an integral with a j 1 index is more accurate than the value of
the integral with a j index.
For k 2 , j 1 ,
I 1, 2 I 1,1
I 2,1 I 1, 2
4 2 1 1
I 1, 2 I 1,1
I 1, 2
3
For k 3 , j 1 ,
I 2, 2 I 2,1
I 3,1 I 2, 2
4 3 1 1
I 2, 2 I 2,1
I 2, 2
15