0% found this document useful (0 votes)
5 views46 pages

Understanding Differentiation Concepts

Uploaded by

hundredmoney28
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views46 pages

Understanding Differentiation Concepts

Uploaded by

hundredmoney28
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Chapter 5

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

Figure 2 Calculation of the secant line.

The slope of the secant line (Figure 2) is then given as

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

Figure 3 Calculation of the secant line for the function .


Solution
The slope of the secant line between (3,36) and (5,100) is

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

Figure 4 Calculation of the tangent line in the function .

The slope of the tangent line is


f (3  h)  f (3)
m lim
h 0 h
4(3  h) 2  4(3) 2
lim
h 0 h
36  24h  4h 2  36
lim
h 0 h
h(24  4h)
lim
h 0 h
lim(24  4h)
h 0

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

Second Definition of Derivatives


There is another form of the definition of the derivative of a function. The derivative of the
function at is defined as

As , the definition is nothing but the slope of the tangent line at .

f (x)

( x, f ( x)) P

f ( x)  f (a)
(a, f (a)) x a
Q

a x x

Figure 5 Graph showing the second definition of the derivative.


02.01.6 Chapter 02.01

Example 4
Find if by using the form

of the definition of a derivative.


Solution

Finding equations of a tangent line


One of the numerical methods used to solve a nonlinear equation is called the Newton-
Raphson method. This method is based on the knowledge of finding the tangent line to a
curve at a point. Let us look at an example to illustrate finding the equation of the tangent
line to a curve.

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

The tangent line passes through the point , so

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

Figure 6 Graph of function f(x) and the tangent line at x = 0.05.

Hence,

is the equation of the tangent line.

Other Notations of Derivatives


Derivates can be denoted in several ways. For the first derivative, the notations are

For the second derivative, the notations are

For the derivative, the notations are


02.01.8 Chapter 02.01

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,

Taking the derivative of ,


02.01.10 Chapter 02.01

Taking the derivative of ,

Using the formula for the product rule

Theorem 6
The derivative of

is

(Quotient Rule)

Example 11

Find the derivative of .


Solution
Use the quotient rule of Theorem 6, if

then
Primer on Differentiation 02.01.11

From

we have

Taking the derivative of ,

Taking the derivative of ,

Using the formula for the quotient rule,

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)

sec(x) sec( x)tan( x)

ax ln(a )a x
1
ln(x)
x
1
log a (x)
xln(a)
ex ex

Chain Rule of Differentiation


Sometimes functions that need to be differentiated do not fall in the form of simple functions
or the forms described previously. Such functions can be differentiated using the chain rule
if they are of the form . The chain rule states

For example, to find of , one could use the chain rule.

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

Higher order derivatives


So far, we have limited our discussion to calculating first derivative, of a function
. What if we are asked to calculate higher order derivatives of .
A simple example of this is finding acceleration of a body from a function that gives the
location of the body as a function of time. The derivative of the location with respect to time
is the velocity of the body, followed by the derivative of velocity with respect to time being
the acceleration. Hence, the second derivative of the location function gives the acceleration
function of the body.

Example 13
Given , find the second derivative, and the third derivative, .
Solution
Given

we have
02.01.14 Chapter 02.01

Finding maximum and minimum of a function


The knowledge of first derivative and second derivative of a function is used to find
the minimum and maximum of a function.
Let be a function in domain , then
is the maximum of the function if for all values of in the domain .
is the minimum of the function if for all values of in the domain .
The minimum and maximum of a function are also the critical values of a function.
An extreme value can occur in the interval at
end points .
a point in where .
a point in where does not exist.
These critical points can be the local maximas and minimas of the function (See Figure 8).

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

f(x) Absolute Maximum


● 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 10 Function that has no maximum or minimum.

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

Figure 11 Graph demonstrates the concept of a singular point with


discontinuous slope at

Example 15
Find the maximum and minimum of in the interval .
Solution

on .
So the critical points are and .

So the minimum value of is at , and the maximum value is at .


The point(s) where the second derivative of a function becomes zero is a way to know
whether the critical point found in the first derivative test is a local minimum or maximum.
Let be a function in the interval and .
is a local maximum of the function if .
is a local minimum of the function if .
If , then the second derivative does not offer any insight into the local maxima or
minima.

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

So the is the local minimum of the function.

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
?

The angle at which the area is maximum is .

For the interval of , the area at the end points 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.

Forward Difference Approximation of the First Derivative


We know
f x  x   f x 
f x   lim
x  0 x
For a finite x ,
f x  x   f x 
f x  
x
02.01.20 Chapter 02.01

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.

Table 1 Velocity as a function of time.


t (s) v(t ) (m/s)

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

vti 1    ti 
ati  
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

Direct Fit Polynomials


In this method, given n  1 data points x0 , y 0 , x1 , y1 , x 2 , y 2 , , x n , y n , one can fit a n th
order polynomial given by
Pn x  a 0  a1 x    a n  1 x n  1  a n x n
To find the first derivative,
dP ( x)
Pnx   n a1  2a 2 x    n  1a n  1 x n  2  na n x n  1
dx
Similarly, other derivatives can also be found.

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

Li (x) is a weighting function that includes a product of n  1 terms with terms of j i


omitted.
Then to find the first derivative, one can differentiate f n x  once, and so on for other
derivatives.
02.01.22 Chapter 02.01

For example, the second order Lagrange polynomial passing through


x0 , y 0 , x1 , y1 , and x 2 , y 2  is

x  x1 x  x2    x  x0 x  x 2  x  x0 x  x1 


f 2 x   f x  f x1   f x 
x0  x1 x0  x2  0 x1  x0 x1  x 2  x2  x0 x2  x1  2
Differentiating the above equation gives

 2 x  x1  x 2  2 x  x0  x 2  2 x  x0  x1 


f 2 x   f x0   f x1   f x 
x0  x1 x0  x2  x1  x0 x1  x2  x2  x0 x2  x1  2
Differentiating again would give the second derivative as

2 2 2
f 2x   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.

Table 3 Velocity as a function of time.


t (s) v(t ) (m/s)
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67

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 
at    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
216   15  20 
a16   227.04  216 10  20 362.78
10  1510  20 15  1015  20
Primer on Differentiation 02.01.23

216  10  15


 517.35
20  1020  15
 0.06227.04  0.08362.78  0.14517.35
29.784 m/s 2

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

where the symbol  is an integral sign,


Riemann Sum
Let f be defined on the closed interval [a, b] , and let  be an arbitrary partition of
[a, b] such as: a  x 0  x1  x 2  .....  x n  1  x n b , where xi is the length of the i th
subinterval (Figure 2).
If ci is any point in the i th subinterval, then the sum

 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 

for any choice of ci in the i th subinterval of  .


If the limit of a Riemann sum of f exists, then the function f is said to be integrable
over [a, b] and the Riemann sum of f on [a, b] approaches the number I .
02.01.24 Chapter 02.01

n
lim  f (ci )xi  I
 0
i 1
where
b
I  f ( x)dx
a

The Mean Value Theorem for Integrals


if a function f is continuous between a and b , then there is at least one point in [a, b]
where the function equals the average value of the function f over [a, b] .

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

Table for some integrals


Primer on Differentiation 02.01.25

dx  x  C sin xdx  cos x  C

a f ( x) dx a f ( x) dx  C cos xdx sin x  C

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

sec(ax)dx  a ln sec(ax)  tan(ax)  C

u dv u v  v du  C cot xdx  ln csc x  C ln sin x  C

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

csc( x) cot( x)dx  csc( x)  C

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

sec x dx  sec x tan x dx


2

0 0

tan x 0  sec x 0
 4  4

1  0   2  1
 2

What is the trapezoidal rule?


The trapezoidal rule is based on the Newton-Cotes formula that if one approximates the
integrand by an n th order polynomial, then the integral of the function is approximated by
the integral of that n th order polynomial. Integrating polynomials is simple and is based on
the calculus formula.
Primer on Differentiation 02.01.27

Figure 1 Integration of a function

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

to find the value of the above integral, one assumes


f ( x)  f n ( x) (3)
where
f n ( x) a 0  a1 x  ...  a n  1 x n  1  a n x n . (4)
where f n (x) is a n th order polynomial. The trapezoidal rule assumes n 1 , that is,
approximating the integral by a linear polynomial (straight line),
b b

f ( x)dx f1 ( x)dx


a a

Derivation of the Trapezoidal Rule


Method 1: Derived from Calculus
b b

f ( x)dx f1 ( x)dx


a a
b
 (a 0  a1 x)dx
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

Solving the above two equations for a1 and a 0 ,


f (b)  f (a)
a1 
b a
f (a)b  f (b)a
a0 
b a
Hence from Equation (5),
b
f (a)b  f (b)a f (b)  f (a ) b 2  a 2

a
f ( x)dx 
b a
(b  a ) 
b a 2
 f (a)  f (b) 
(b  a)  
 2
Method 2: Also Derived from Calculus
f 1 ( x) can also be approximated by using Newton’s divided difference polynomial as
f (b)  f (a)
f1 ( x)  f (a)  ( x  a)
b a

Method 3: Derived from Geometry


The trapezoidal rule can also be derived from geometry. Look at Figure 2. The area under
the curve f 1 ( x) is the area of a trapezoid. The integral
b

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

Figure 2 Geometric representation of trapezoidal rule.


Primer on Differentiation 02.01.29

Method 4: Derived from Method of Coefficients


The trapezoidal rule can also be derived by the method of coefficients. The formula
b
b a b a

a
f ( x)dx 
2
f (a) 
2
f (b) (13)
2
 c i f ( x i )
i 1
b a b a
c1  c2 
where 2 , 2
x1 a x 2 b
Method 5: Another approach on the Method of Coefficients
The trapezoidal rule can also be derived by the method of coefficients by another approach
b
b a b a

a
f ( x)dx 
2
f (a) 
2
f (b)

Multiple-Segment Trapezoidal Rule


Divide (b  a ) into n equal segments as shown in Figure 4. Then the width of each segment
is
b a
h (26)
n
The integral I can be broken into h integrals as
b
I  f ( x)dx
a
a h a 2 h a ( n  1) h b
 f ( x)dx 
a
f ( x)dx  ... 
a h
f ( x)dx 
a ( n  2 ) h
f ( x)dx
a ( n  1) h
(27)

Figure 4 Multiple ( n 4 ) segment trapezoidal rule


02.01.30 Chapter 02.01

Applying trapezoidal rule Equation (27) on each segment gives


b
 f ( a )  f ( a  h) 
 f ( x)dx (a  h)  a  
a  2
 f ( a  h)  f ( a  2h) 
 (a  2h)  (a  h) 
 2
 f (a  (n  2)h)  f (a  (n  1)h) 
 ……………  a  (n  1)h   a  (n  2)h  
 2
 f (a  (n  1)h)  f (b) 
 b  a  (n  1)h  
 2
 f ( a )  f ( a  h)   f ( a  h)  f ( a  2h) 
h    h   ...................
 2   2
 f (a  (n  2)h)  f (a  (n  1)h)   f (a  (n  1)h)  f (b) 
 h   h 
 2   2
 f (a)  2 f (a  h)  2 f (a  2h)  ...  2 f (a  (n  1)h)  f (b) 
h  
 2 
h  n 1
 
  f (a )  2 f (a  ih)  f (b)
2  i 1  
b a  n 1  
  f ( a )  2  f (a  ih)  f (b) (28)
2n   i 1  

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

Thus making the absolute relative true error


2.8284  1.3536
t  100
2.8284
52.145%
2
1
Table 3 Values obtained using multiple-segment trapezoidal rule for 
0 x
dx .

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

256 2.699 0.129 4.564%


512 2.737 0.091 3.227%
1024 2.764 0.064 2.282%
2048 2.783 0.045 1.613%
4096 2.796 0.032 1.141%

Error in Multiple-segment Trapezoidal Rule


The true error for a single segment Trapezoidal rule is given by
(b  a ) 3
E t  f " ( ), a    b
12
Where  is some point in a, b .

We have the total error in the multiple-segment trapezoidal rule is


n
E t  E i
i 1

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

The term  f " (


i 1
i )
is an approximate average value of the second derivative
n
f " ( x), a  x  b .
Hence
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.

Table 4 Values obtained using multiple-segment trapezoidal rule for


30
  140000  
x   2000 ln    9.8t  dt .
8  140000  2100t  
Primer on Differentiation 02.01.33

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

Simpson’s 1/3 Rule of Integration


The trapezoidal rule was based on approximating the integrand by a first order polynomial,
and then integrating the polynomial over interval of integration. Simpson’s 1/3 rule is an
extension of Trapezoidal rule where the integrand is approximated by a second order
polynomial.

Figure 1 Integration of a function

the Simpson’s 1/3 rule is given by


b
h  a b 

a
f ( x)dx   f (a)  4 f 
3  2 
  f (b)

Since the above form has 1/3 in its formula, it is called Simpson’s 1/3 rule.
The integral from the first method
b b

f ( x)dx (a0  a1x  a2 x )dx


2

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)

can be viewed as the sum of the areas of three rectangles.


02.01.34 Chapter 02.01

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

So the true error is


E t True Value  Approximat e Value
=11061.34-11065.72
 4.38 m
c) The absolute relative true error is
True Error
t  100
True Value
 4.38
 100
11061 .34
0.0396%

Multiple-segment Simpson’s 1/3 Rule


Just like in multiple-segment trapezoidal rule, one can subdivide the interval a, b into n
segments and apply Simpson’s 1/3 rule repeatedly over every two segments. Note that n
needs to be even. Divide interval a, b into n equal segments, so that the segment width is
given by
b a
h .
n
Now
b xn

f ( x)dx  f ( x)dx
a x0

where
x 0 a
x n b
b x2 x4 xn  2 xn

f ( x)dx  f ( x)dx  f ( x)dx  ...... 


a x0 x2
f ( x)dx 
xn  4
f ( x)dx
xn  2

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 

Gauss Quadrature Rule of Integration


Background:
To derive the trapezoidal rule from the method of undetermined coefficients, we
approximated
b

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)

to give the same result as Equation (2) for f ( x) a 0  a1 x .


b

a
a
0  a1 x dx c1 a 0  a1 a   c 2 a 0  a1b 

a0 c1  c 2   a1 c1 a  c 2 b 


Hence from Equations (2) and (4),
 b2  a2 
a0 b  a  a1   a0 c1  c 2  a1 c1 a  c 2 b 
 2 
Since a0 and a1 are arbitrary constants for a general straight line
c1  c 2 b  a
b2  a2
c1 a  c 2 b 
2
Multiplying Equation (5a) by a and subtracting from Equation (5b) gives
b a
c2 
2
Substituting the above found value of c 2 in Equation (5a) gives
b a
c1 
2
Therefore
b

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 a b a 1  ba b a b a  1  ba


 f     f    
2  2  3 2  2  2  3 2 

b
b a b a 1  ba b a b a 1  ba
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.

Higher point Gauss quadrature formulas


For example
b

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

General n -point rules would approximate the integral


b

f ( x)dx c
a
1 f ( x1 )  c 2 f ( x 2 )  . . . . . . .  c n f ( x n ) (18)

Arguments and weighing factors for n-point Gauss quadrature rules


Coefficients and arguments given for n -point Gauss quadrature rule are given for integrals
of the form
1 n

g ( x)dx  c g ( x )
1 i 1
i i (19)

What is an improper integral?


An integral is improper if
the integrand becomes infinite in the interval of integration (including end
points) or/and
the interval of integration has an infinite bound.
02.01.38 Chapter 02.01

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

is improper because the interval of integration has an infinite bound.


The integral

e t
I  dt
0 1  t
is improper because the interval of integration has an infinite bound and the integrand is
infinite at t 1 .
If the integrand is undefined at a finite number of points, the value of the area under
the curve does not change. Hence such integrals could theoretically be solved either by
assuming any value of the integrand at such points. Also, methods such as Gauss quadrature
rule do not use the value of the integrand at end points, and hence integrands that are
undefined at end points can be integrated using such methods.
For the case where there is an infinite interval of integration, one may make a change
of variables that transforms the infinite range of integration to a finite one.

Integrating Discrete Functions


Multiple methods of integrating discrete functions are shown below using an example.
Example 1
The upward velocity of a rocket is given as a function of time in Table 1.

Table 1 Velocity as a function of time.


Primer on Differentiation 02.01.39

t (s) v(t ) (m/s)


0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67

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

Figure 1 Velocity vs. time data for the rocket example


02.01.40 Chapter 02.01

Using
s v t ,
we get
s (369.06)(16  11) 1845.3 m

Method 2: Trapezoidal Rule


If we were finding the distance traveled between times in the data table, we would simply
find the area of the trapezoids with the corner points given as the velocity and time data
points. For example
20 15 20

v(t )dt  v(t )dt  v(t )dt


10 10 15

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)]

The values of v(10) , v(15) and v(20) are given in Table 1.


However, we are interested in finding
16 15 16

v(t )dt  v(t )dt  v(t )dt


11 11 15

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.148t  10 , 10 t 15
v (11) 227.04  27.14811  10
254.19 m/s
and to find v(16)
v (t ) 362.78  30.913t  15, 15 t 20
v (16) 362.78  30.91316  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

Method 3: Polynomial interpolation to find the velocity profile


Because we are finding the area under the curve from 10, 20, we must use three points,
t 10, t 15, and t 20, to fit a quadratic polynomial through the data. Using polynomial
interpolation, our resulting velocity function is (refer to notes on direct method of
interpolation)
vt  12.05  17.733t  0.3766t 2 , 10 t 20.
Now, we simply take the integral of the quadratic within our limits, giving us
16

s  12.05  17.733t  0.3766t 2 dt 
11
16
 17.733t 2 0.3766t 3 
 12.05t   
 2 3  11
17.733 2 0.3766 3
12.0516  11 
2

16  112 
3

16  113 
1604.3 m

Method 4: Spline interpolation to find the velocity profile


Fitting quadratic splines (refer to notes on spline method of interpolation) through the data
results in the following set of quadratics
v(t ) 22.704t , 0 t 10
2
0.8888t  4.928t  88.88, 10 t 15
2
 0.1356t  35.66t  141.61, 15 t 20
1.6048t 2  33.956t  554.55, 20 t 22.5
2
0.20889t  28.86t  152.13, 22.5 t 30
The value of the integral would then simply be
15 16
s  v(t )dt  v(t )dt
11 15
15 16
  
 0.8888t 2  4.928t  88.88 dt   0.1356t 2  35.66t  141.61 dt 
11 15
15 16
 0.8888t 3 4.928t 2    0.1356t 3 35.66t 2 
   88.88t      141.61t 
 3 2  11  3 2  15
0.8888 3 4.928 2
0.8888
15  1133  3 415 .928 1122  882 .8815  11

3
3

15  11 2
2
15  11  88.8815  11
 0.1356 3 35.66 2
 0.1356
16  1533  3 35 16.66 16
1522  141 .6116  15

3
3

16  15 2
2
 15 2  141.6116  15

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%

Table 2 Comparison of discrete function methods of numerical integration


Primer on Differentiation 02.01.43

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%

Trapezoidal Rule for Discrete Functions with Unequal Segments


For a general case of a function given at n data points x1 , f x1 , x 2 , f x 2  , x3 , f x3  ,
….., x n , f x n , where, x1 ,.x 2 ,...., x n are in an ascending order, the approximate value of the
xn

integral f x dx is given by


x1
xn x2 x3 xn

f x dx  f x dx  f x dx  ......  f x dx


x1 x1 x2 xn  1

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.

Romberg Rule of Integration

Error in Multiple-Segment Trapezoidal Rule


The true error obtained when using the multiple segment trapezoidal rule with n segments to
approximate an integral
b

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  1h, 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

Richardson’s Extrapolation Formula for Trapezoidal Rule


The true error, Et , in the n -segment trapezoidal rule is estimated as
1
Et  2
n
C
Et  2 (4)
n
where C is an approximate constant of proportionality.
Since
Et TV  I n (5)
where
TV = true value
I n = approximate value using n -segments
Then from Equations (4) and (5),
C
TV  I n (6)
n2
If the number of segments is doubled from n to 2n in the trapezoidal rule,
C
TV  I 2 n (7)
2n 2
Equations (6) and (7) can be solved simultaneously to get
I  In
TV  I 2 n  2 n (8)
3

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

You might also like