Chapter 3 - Numerical Integration and Differentiation
Chapter 3 - Numerical Integration and Differentiation
CHAPTER 3
NUMERICAL INTEGRATION
AND DIFFERENTIATION
Dr. Le Thanh Long
[email protected]
OUTLINE
3.1. Numerical Integration
3.2. Numerical Differentiation
3.3. Lagrange Interpolating Polynomials
f n ( x) a0 a1 x a2 x 2 ... an x n
where:
f (b) f (a )
f1 ( x) f (a ) ( x a)
ba
Then:
b f (b) f (a ) f (b) f (a)
I f (a) ( x a) (b a)
a
ba 2
10
14
1 x
0, 6 0
Solution: h 0,1
6
0.1
x y I { f (0) f (0.6) 4[ f (0.1) f (0.3) f (0.5)]
3
0 (0) = 1 2[ f (0.2) f (0.4)]} 0.470
0.1 (0.1) = 0.909 0.6 24
0.2 (0.2) = 0.833 24 0 (1 x)5 dx
f ""( x) 5
; f ""( x) 8.47
(1 x) 0.6 0
0.3 (0.3) = 0.769
0.4 (0.4) = 0.714 0.65
Ea 4
8.47 0.000003
180 6
0.5 (0.5) = 0.667
0.6 (0.6) = 0.625 => True integral ≈ 0.469997
15
(6 3cos x)dx
0
16
Problem 1.
Solution:
a) Multiple-application trapezoidal rule
−0
ℎ=2 = /8
4
Problem 1.
Solution:
b) Multiple-application Simpson’s rule
−0
ℎ=2 = /8
4
= 0; = /8; = /4; = 3 /8; = /2
18
Problem 1.
Solution:
c) Determine the percent relative error
/2 /2 /2
3 3 12.42478
Multiple-application trapezoidal rule
12.386 12.42478
T 100% 0.312%
12.42478
Multiple-application Simpson’s rule
12.4252 12.42478
T 100% 0.003%
12.42478
19
=> Using centered finite divided difference and small step size
achieves lower approximation error
23
25
Time, t, s 0 2 4 6 8 10 12 14 16
Position, x, m 0 0.7 1.8 3.4 5.1 6.3 7.3 8.0 8.4
26
Solution:
• Velocity: f ( xi 1 ) f ( xi 1 )
f '( xi )
2h
f ( x6 ) f ( x4 )
f '( x5 )
2h
f (12) f (8) 7.3 5.1
f '(10) 0.55(m / s )
2 2 2 2
• Acceleration:
f ( xi 1 ) 2 f ( xi ) f ( xi 1 )
f "( xi )
h2
f ( x6 ) 2 f ( x5 ) f ( x4 )
f "( x5 )
h2
f (12) 2 f (10) f (8) 7.3 2 6.3 5.1 2
f "(10) 2
2
0.05( m / s )
2 2 27
Results:
1 = −0.17824017
"(1) = 0.3573462
28
29
31