SlideShare a Scribd company logo
1
Numerical integration
2
Methods for Numerical Integration
3
Newton-Cotes Formulas
Approximate integrand function f(x) by a polynomial that can then be easily integrated
4
Newton-Cotes Quadrature
5
The Trapezoidal Rule
( ) ( )dxxfdxxf
b
a
b
a ∫∫ ≅= 1I
( ) ( ) ( ) ( )( )a-x
a-b
afbf
afxf
−
+=1
( ) ( ) ( )( ) ( ) ( ) ( )
2
bfaf
abdxa-x
a-b
afbf
afI
b
a
+
−=




 −
+= ∫
All the Newton-Cotes formulas can be expressed in this general average height form
heightaveragewidthI ×≅
Example 1 Single Application of the Trapezoidal Rule
f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5
Integrate f(x) from a=0 to b=0.8
%....E
.
..
.
)()(
)(
tt
:oferroranrepresentswhich
:RulelTrapezoida
58946773117280640531
17280
2
232020
80
2
==−=
=
+
=
+
−=
ε
bfaf
abI
∫
=
=
==
80
0
640531
.
.)(:valueintegralTrue
b
a
dxxfI
Solution: f(a)=f(0) = 0.2 and f(b)=f(0.8) = 0.232
7
• The accuracy can be improved by dividing the
interval from a to b into a number of segments
and applying the method to each segment.
• The areas of individual segments are added to
yield the integral for the entire interval.
Using the trapezoidal rule, we get:
∫∫∫
−
+++=
===
−
=
n
n
x
x
x
x
x
x
n
dxxfdxxfdxxfI
xbxa
n
ab
h
1
2
1
1
0
)()()(
seg.of#n 0
L






++
−
=
+
++
+
+
+
=
∑
−
=
−
1
1
0
12110
2
2
222
n
i
in
nn
xfxfxf
n
ab
I
xfxf
h
xfxf
h
xfxf
hI
)()()(
)()()()()()(
L
The Multiple-Application Trapezoidal Rule
8
Example 2
10
11
Example 3
12
Example 4
The vertical distance covered by a rocket from to seconds is
given by:
∫ 





−



−
=
30
8
89
2100140000
140000
2000 dtt.
t
lnx
a) Use two-segment Trapezoidal rule to find the distance covered.
b) Find the true error, for part (a).
c) Find the absolute relative true error, for part (a).a∈
tE
Solution
a) The solution using 2-segment Trapezoidal rule is






+






++
−
= ∑
−
=
)b(f)iha(f)a(f
n
ab
I
n
i
1
1
2
2
2=n 8=a 30=b
2
830 −
=
n
ab
h
−
= 11=
Solution (cont)






+






++
−
= ∑
−
=
)(f)iha(f)(f
)(
I
i
3028
22
830 12
1
[ ])(f)(f)(f 301928
4
22
++=
[ ]6790175484227177
4
22
.).(. ++=
m11266=
Then:
Solution (cont)
∫ 





−



−
=
30
8
89
2100140000
140000
2000 dtt.
t
lnx m11061=
b) The exact value of the above integral is
so the true error is
ValueeApproximatValueTrueEt −=
1126611061−=
Solution (cont)
The absolute relative true error, , would bet∈
100
ValueTrue
ErrorTrue
×=∈t
100
11061
1126611061
×
−
=
%8534.1=
Solution (cont)
Table 1 gives the values
obtained using multiple
segment Trapezoidal rule for
n Value Et
1 11868 -807 7.296 ---
2 11266 -205 1.853 5.343
3 11153 -91.4 0.8265 1.019
4 11113 -51.5 0.4655 0.3594
5 11094 -33.0 0.2981 0.1669
6 11084 -22.9 0.2070 0.09082
7 11078 -16.8 0.1521 0.05482
8 11074 -12.9 0.1165 0.03560
∫ 





−



−
=
30
8
89
2100140000
140000
2000 dtt.
t
lnx
Table 1: Multiple Segment Trapezoidal Rule Values
%t∈ %a∈
Exact Value=11061 m
19
Example 5
Applied numerical methods lec10
21
Example 6
22
23
)()(
)(
)(
2
2
1
212
2
2
1
2
1






≅⇒≅
h
h
hEhE
h
h
hE
hE
Romberg Integration
Successive application of the trapezoidal rule to attain efficient numerical integrals of functions.
Richardson’s Extrapolation:
Uses two estimates of an integral to compute a third and more accurate approximation.
sizes)stepdifferentforconstantis(assume
)()()()(
/)(/)()()(
)
2
(
2
12
2211
fhOfh
ab
E
hEhIhEhI
habnnabhhEhII
′′=′′
−
≅
+=+
−=−=+=
I = exact value of integral E(h) = the truncation error
I(h): trapezoidal rule (n segments, step size h)
Improved estimate of the integral.
It is shown that the error of this
estimate is O(h4). Trapezoidal rule
had an error estimate of O(h2).( )
[ ])()(
/
)(
)()(
122
21
2
22
1
1
hIhI
hh
hII
hEhII
−
−
+≅
+=
( )
( ) 1/
)()(
)()()(/)()( 2
21
12
222
2
2121
−
−
≅⇒+≅+
hh
hIhI
hEhEhIhhhEhI
25
( )
[ ])()(
1/
1
)( 122
21
2 hIhI
hh
hII −
−
+≅
Example 7
Evaluate the integral of f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5
from a=0 to b=0.8. I (True Integral value) = 1.6405
Segments h Integral εtr%
1 0.8 0.1728 89.5
2 0.4 1.0688 34.9
4 0.2 1.4848 9.5
%)6.16(0.2733675.16405.1E
3675.1)1728.0(
3
1
)0688.1(
3
4
:givetocombined2&1Segments
tt ==−=
=−≅
ε
I
In each case, two estimates with
error O(h2) are combined to give a
third estimate with error O(h4)
%)1(0.01716234.16405.1E
6234.1)0688.1(
3
1
)4848.1(
3
4
:givetocombined4&2Segments
tt ==−=
=−≅
ε
I
)2/(If 12 ⇒= hh [ ] )(
3
1
)(
3
4
)()(
12
1
)( 121222 hIhIhIhIhII −=−
−
+≅
26
Simpson’s Rules
General idea:
Use high order polynomials other than trapezoids to achieve more
accurate integration result but using the similar amount of computation
Parabola Cubic polynomial
• More accurate estimate of an integral is obtained if
a high-order polynomial is used to connect the
points. These formulas are called Simpson’s rules.
Simpson’s 1/3 Rule: results when a 2nd order
Lagrange interpolating polynomial is used for f(x)
dxxf
xxxx
xxxx
xf
xxxx
xxxx
xf
xxxx
xxxx
I
dxxfdxxfI
x
x
b
a
b
a
xbxa
xf
∫
∫ ∫






−−
−−
+
−−
−−
+
−−
−−
=
≅=
==
2
0
)(
))((
))((
)(
))((
))((
)(
))((
))((
)()(
2
1202
10
1
2101
20
0
2010
21
20
2
Using
.polynomialorder-secondais)(2where
[ ] RULE1/3SSIMPSON'
2
)()(4)(
3
210
:resultsformulafollowingtheon,manipulatialgebraicandnintegratioafter
⇐
−
=++≅
ab
hxfxfxf
h
I
a=x0 x1 b=x2
Simpson’s Rules
28
[ ] RULE1/3SSIMPSON'
2
)()(4)(
3
210
:resultsformulafollowingtheon,manipulatialgebraicandnintegratioafter
⇐
−
=++≅
ab
hxfxfxf
h
I
29
30
Trapezoidal vs. Simpson’s 1/3 Rule
( ) ( ) ( ) ( ) 3674671
2
8080 .
.
..I =
++
=
++
≅
6
0.2322.45640
6
0.8f0.44f0f
%.616=→== tt 0.27306671.367467-1.640533E ε
Trapezoidal:
Example: f(x) = 0.2 + 25x – 200x2 + 675x3 – 900x4 + 400x5 (integral between a=0 and b=0.8)
( ) ( ) ( ) 0.1728
2
0.8f0f
00.8 =
+
−≅I
Et = 1.640533 – 0.1728 = 1.467733 εt = 89.5%
Simpson’s 1/3 rule:
31
Example 8
32
Multiple Application of Simpson’s 1/3 Rule
33
Example 9
34
Example 10
35
36
Example 11
37
38
[ ]
8
)()(3)(3)(
)(
)()(3)(3)(
8
3
)()(
3210
3210
3
3
)(
xfxfxfxf
abI
xfxfxfxf
h
I
dxxfdxxfI
ab
h
b
a
b
a
+++
−≅
+++≅
≅=
−
=
∫ ∫
Simpson’s 3/8 Rule
Simpson’s 1/3 and 3/8 rules can be
applied in tandem to handle
multiple applications with odd
number of intervals
Fit a 3rd order Lagrange interpolating
polynomial to four points and integrate
39
Example 12
40
41
Example 13
42
Gauss Quadrature
• Gauss quadrature implements a strategy of
positioning any two points on a curve to define a
straight line that would balance the positive and
negative errors.
• Hence the area evaluated under this straight line
provides an improved estimate of the integral.
44
Gauss Quadrature (cont.)
45
Gauss Quadrature (cont.)
Method of Undetermined Coefficients
• The trapezoidal rule yields exact results when the function
being integrated is a constant or a straight line, such as y=1
and y=x:
)()( 10 bfcafcI +≅
)(
2
)(
2
2
0
22
22
110
10
10
10
2/)(
2/)(
10
2/)(
2/)(
bf
ab
af
ab
I
ab
cc
ab
c
ab
c
abcc
dxx
ab
c
ab
c
dxcc
ab
ab
ab
ab
−
+
−
=
−
==
=
−
+
−
−
−=+
=
−
+
−
−
=+
∫
∫
−
−−
−
−−
Solve simultaneously
Trapezoidal rule
47
Derivation of the Two-Point Gauss-Legendre Formula/
• The object of Gauss quadrature is to determine the equations of
the form
• However, in contrast to trapezoidal rule that uses fixed end
points a and b, the function arguments x0 and x1 are not fixed
end points but unknowns.
• Thus, four unknowns to be evaluated require four conditions.
• First two conditions are obtained by assuming that the above
eqn. for I fits the integral of a constant and a linear function
exactly.
• The other two conditions are obtained by extending this
reasoning to a parabolic and a cubic functions.
)()( 1100 xfcxfcI +≅
Solved simultaneously






+




 −
≅
−==
−=−=
==
3
1
3
1
5773503.0
3
1
5773503.0
3
1
1
1
0
10
ffI
x
x
cc
K
K
Yields an integral
estimate that is third
order accurate
49
Two-Point Gauss-Legendre Formula
(arbitrary a and b)
( ) ( )
bxx
ax-x
2
xabab
x
d
dd
=→=
=→=


−++
=
1
1
( )∫=
b
a
dxxfI
( ) ( ) ( ) ( )
∫
=
=





 −++





 −++
=
1x
-1x
ddd
d 2
xabab
d
2
xabab
fI
( ) ( )
∫ 




 −++−
=
1
1- d
d
dx
2
xabab
f
2
ab
I
50
Example of Two-Point Gauss-Legendre Formula
( ) 8225781264592532918525140
3
1
3
1
40 ....ff.I dd =+=
















+






 −
=
( ) ( )∫∫ +==
1
1-
0.8
0 dd dx0.4x0.4f0.4dxxfI
( )∫=
1
1- ddd dxxf40.I
Example14: f(x) = 0.2 + 25x – 200x2 + 675x3 – 900x4 + 400x5 (integral between a=0 and b=0.8)
x = 0.4 + 0.4xd
dx = 0.4 dxd
( ) ( ) ( ) ( ) ( )[ ]∫ +++−+++−++=
1
1- dddddd dx0.4x0.40.4x0.40.4x0.40.4x0.40.4x0.4250.20.4
543
400900675200 2
I
( ) ( )
bxx
ax-x
2
xabab
x
d
dd
=→=
=→=


−++
=
1
1
)()( 1100 xfcxfcI +≅
51
Higher-Point Gauss-Legendre Formula
( ) ( ) ( )[ ]2d21d10d0 xfcxfcxfc ++= 40.I
( ) ( ) ( ) ( )
44444444 344444444 21
L
44444 344444 21
444 3444 21
pointn
1-n1-n
pointthree
22
pointtwo
1100 xfcxfcxfcxfc
−
−
−
++++≅I
( )∫=
1
1- ddd dxxf40.I
Example: f(x) = 0.2 + 25x – 200x2 + 675x3 – 900x4 + 400x5 (integral between a=0 and b=0.8)
Three-point Gauss-Legendre formula: c0 = 0.5555556 x0 = - 0.774596669
c1 = 0.8888889 x1 = 0.0
c2 = 0.5555556 x2 = 0.774596669
( ) ( ) ( )[ ].77459669f0.5555560f0.88888890.77459669-f0.5555560.4 ddd ++=I
1.640533
52
53
Example 15
54
( ) 543376.0318386.0768365.05.0
3
1
3
1
5.0 =+=











+




 −
= dd ffI
( ) ( ) ( )( )
( ) 0.5405910.275778*0.55555560.494845*0.88888890.878598*0.55555565.0
90.77459666*0.55555560.0*0.888888990.77459666-*0.55555565.0
=++=
++= ddd fffI
55
Gauss Quadrature
Gauss-Chebyshev Formula
56
Gauss Quadrature
Gauss-Hermite Formula
57
Integration Using Matlab
Approximation of Double Integrals Using Matlab
58
Miscellaneous problems #1
59
60
Miscellaneous problems #2
61
62
63
Special Problem 7
Homework
64
1.
2.
3.
4.
5.
6.

More Related Content

PPTX
Finite difference method
PPTX
A brief introduction to finite difference method
PPT
MATLAB : Numerical Differention and Integration
PPTX
Euler and runge kutta method
PPT
Numerical method
PPTX
Partial Derivatives
PPTX
Taylor series
PDF
Numerical Solution of Ordinary Differential Equations
Finite difference method
A brief introduction to finite difference method
MATLAB : Numerical Differention and Integration
Euler and runge kutta method
Numerical method
Partial Derivatives
Taylor series
Numerical Solution of Ordinary Differential Equations

What's hot (20)

PDF
Finite Difference Method
PDF
Fundamentals of Finite Difference Methods
 
PDF
Applied numerical methods lec14
PDF
Gaussian quadratures
PPT
Numerical integration
PPT
Lecture 1
PDF
Numerical Methods - Oridnary Differential Equations - 3
PPT
Numerical solution of ordinary differential equations GTU CVNM PPT
PPT
Secant Method
PPTX
Simpson’s one third and weddle's rule
PPTX
trapezoidal and simpson's 1/3 and 3/8 rule
PPTX
8 arc length and area of surfaces x
PPT
08 interpolation lagrange
PPTX
Bisection method
PPTX
Numerical integration
PPTX
Numerical integration;Gaussian integration one point, two point and three poi...
PPTX
Runge-Kutta methods with examples
PDF
Integral calculus
PPTX
Newton's Backward Interpolation Formula with Example
PDF
Fourier series of odd functions with period 2 l
Finite Difference Method
Fundamentals of Finite Difference Methods
 
Applied numerical methods lec14
Gaussian quadratures
Numerical integration
Lecture 1
Numerical Methods - Oridnary Differential Equations - 3
Numerical solution of ordinary differential equations GTU CVNM PPT
Secant Method
Simpson’s one third and weddle's rule
trapezoidal and simpson's 1/3 and 3/8 rule
8 arc length and area of surfaces x
08 interpolation lagrange
Bisection method
Numerical integration
Numerical integration;Gaussian integration one point, two point and three poi...
Runge-Kutta methods with examples
Integral calculus
Newton's Backward Interpolation Formula with Example
Fourier series of odd functions with period 2 l
Ad

Similar to Applied numerical methods lec10 (20)

PPT
1519 differentiation-integration-02
PDF
Quadrature
PDF
Ankit_Practical_File-1.pdf A detailed overview of Rizir as a brand
PDF
Overviewing the techniques of Numerical Integration.pdf
PPTX
PPT
LECF03-Numerical-Differentiation-and-Integration.ppt
PPTX
Newton cotes integration method
PPTX
CE324-Module-9-10-Week-5-1st-Session.pptx
PPTX
NUMERICAL METHOD'S
PDF
Numerical integration
PPT
23MA401 NM Numerical integration anddifferenciation
PPTX
The Trapezoidal rule is the first of the Newton-Cotes closed integration form...
PPT
Calc 4.6
PDF
Integration
PPT
mtl_gen_int_ppt_romberg.ppt 6 6 6
PDF
Error analysis in numerical integration
PPTX
NUMERICAL INTEGRATION : ERROR FORMULA, GAUSSIAN QUADRATURE FORMULA
PPT
25285 mws gen_int_ppt_trapcontinuous
PPT
Numerical hhhhhhhhhhhhhhhhhIntegration.ppt
PPTX
Numerical integration
1519 differentiation-integration-02
Quadrature
Ankit_Practical_File-1.pdf A detailed overview of Rizir as a brand
Overviewing the techniques of Numerical Integration.pdf
LECF03-Numerical-Differentiation-and-Integration.ppt
Newton cotes integration method
CE324-Module-9-10-Week-5-1st-Session.pptx
NUMERICAL METHOD'S
Numerical integration
23MA401 NM Numerical integration anddifferenciation
The Trapezoidal rule is the first of the Newton-Cotes closed integration form...
Calc 4.6
Integration
mtl_gen_int_ppt_romberg.ppt 6 6 6
Error analysis in numerical integration
NUMERICAL INTEGRATION : ERROR FORMULA, GAUSSIAN QUADRATURE FORMULA
25285 mws gen_int_ppt_trapcontinuous
Numerical hhhhhhhhhhhhhhhhhIntegration.ppt
Numerical integration
Ad

More from Yasser Ahmed (14)

PPT
Artificial reefs
PDF
Novel approach of bidirectional diffuser-augmented channels system for enhanc...
PDF
Applied numerical methods lec13
PDF
Applied numerical methods lec12
PDF
Applied numerical methods lec11
PDF
Applied numerical methods lec9
PDF
Applied numerical methods lec8
PDF
Applied numerical methods lec7
PDF
Applied numerical methods lec6
PDF
Applied numerical methods lec5
PDF
Applied numerical methods lec4
PDF
Applied numerical methods lec3
PDF
Applied numerical methods lec2
PDF
Applied numerical methods lec1
Artificial reefs
Novel approach of bidirectional diffuser-augmented channels system for enhanc...
Applied numerical methods lec13
Applied numerical methods lec12
Applied numerical methods lec11
Applied numerical methods lec9
Applied numerical methods lec8
Applied numerical methods lec7
Applied numerical methods lec6
Applied numerical methods lec5
Applied numerical methods lec4
Applied numerical methods lec3
Applied numerical methods lec2
Applied numerical methods lec1

Recently uploaded (20)

PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPT
Project quality management in manufacturing
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Sustainable Sites - Green Building Construction
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Geodesy 1.pptx...............................................
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Lecture Notes Electrical Wiring System Components
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Lesson 3_Tessellation.pptx finite Mathematics
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Operating System & Kernel Study Guide-1 - converted.pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
CH1 Production IntroductoryConcepts.pptx
Model Code of Practice - Construction Work - 21102022 .pdf
Project quality management in manufacturing
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Sustainable Sites - Green Building Construction
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Arduino robotics embedded978-1-4302-3184-4.pdf
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Geodesy 1.pptx...............................................
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Foundation to blockchain - A guide to Blockchain Tech
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd

Applied numerical methods lec10

  • 3. 3 Newton-Cotes Formulas Approximate integrand function f(x) by a polynomial that can then be easily integrated
  • 5. 5 The Trapezoidal Rule ( ) ( )dxxfdxxf b a b a ∫∫ ≅= 1I ( ) ( ) ( ) ( )( )a-x a-b afbf afxf − +=1 ( ) ( ) ( )( ) ( ) ( ) ( ) 2 bfaf abdxa-x a-b afbf afI b a + −=      − += ∫ All the Newton-Cotes formulas can be expressed in this general average height form heightaveragewidthI ×≅
  • 6. Example 1 Single Application of the Trapezoidal Rule f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5 Integrate f(x) from a=0 to b=0.8 %....E . .. . )()( )( tt :oferroranrepresentswhich :RulelTrapezoida 58946773117280640531 17280 2 232020 80 2 ==−= = + = + −= ε bfaf abI ∫ = = == 80 0 640531 . .)(:valueintegralTrue b a dxxfI Solution: f(a)=f(0) = 0.2 and f(b)=f(0.8) = 0.232
  • 7. 7 • The accuracy can be improved by dividing the interval from a to b into a number of segments and applying the method to each segment. • The areas of individual segments are added to yield the integral for the entire interval. Using the trapezoidal rule, we get: ∫∫∫ − +++= === − = n n x x x x x x n dxxfdxxfdxxfI xbxa n ab h 1 2 1 1 0 )()()( seg.of#n 0 L       ++ − = + ++ + + + = ∑ − = − 1 1 0 12110 2 2 222 n i in nn xfxfxf n ab I xfxf h xfxf h xfxf hI )()()( )()()()()()( L The Multiple-Application Trapezoidal Rule
  • 8. 8
  • 10. 10
  • 12. 12
  • 13. Example 4 The vertical distance covered by a rocket from to seconds is given by: ∫       −    − = 30 8 89 2100140000 140000 2000 dtt. t lnx a) Use two-segment Trapezoidal rule to find the distance covered. b) Find the true error, for part (a). c) Find the absolute relative true error, for part (a).a∈ tE
  • 14. Solution a) The solution using 2-segment Trapezoidal rule is       +       ++ − = ∑ − = )b(f)iha(f)a(f n ab I n i 1 1 2 2 2=n 8=a 30=b 2 830 − = n ab h − = 11=
  • 15. Solution (cont)       +       ++ − = ∑ − = )(f)iha(f)(f )( I i 3028 22 830 12 1 [ ])(f)(f)(f 301928 4 22 ++= [ ]6790175484227177 4 22 .).(. ++= m11266= Then:
  • 16. Solution (cont) ∫       −    − = 30 8 89 2100140000 140000 2000 dtt. t lnx m11061= b) The exact value of the above integral is so the true error is ValueeApproximatValueTrueEt −= 1126611061−=
  • 17. Solution (cont) The absolute relative true error, , would bet∈ 100 ValueTrue ErrorTrue ×=∈t 100 11061 1126611061 × − = %8534.1=
  • 18. Solution (cont) Table 1 gives the values obtained using multiple segment Trapezoidal rule for n Value Et 1 11868 -807 7.296 --- 2 11266 -205 1.853 5.343 3 11153 -91.4 0.8265 1.019 4 11113 -51.5 0.4655 0.3594 5 11094 -33.0 0.2981 0.1669 6 11084 -22.9 0.2070 0.09082 7 11078 -16.8 0.1521 0.05482 8 11074 -12.9 0.1165 0.03560 ∫       −    − = 30 8 89 2100140000 140000 2000 dtt. t lnx Table 1: Multiple Segment Trapezoidal Rule Values %t∈ %a∈ Exact Value=11061 m
  • 22. 22
  • 23. 23
  • 24. )()( )( )( 2 2 1 212 2 2 1 2 1       ≅⇒≅ h h hEhE h h hE hE Romberg Integration Successive application of the trapezoidal rule to attain efficient numerical integrals of functions. Richardson’s Extrapolation: Uses two estimates of an integral to compute a third and more accurate approximation. sizes)stepdifferentforconstantis(assume )()()()( /)(/)()()( ) 2 ( 2 12 2211 fhOfh ab E hEhIhEhI habnnabhhEhII ′′=′′ − ≅ +=+ −=−=+= I = exact value of integral E(h) = the truncation error I(h): trapezoidal rule (n segments, step size h) Improved estimate of the integral. It is shown that the error of this estimate is O(h4). Trapezoidal rule had an error estimate of O(h2).( ) [ ])()( / )( )()( 122 21 2 22 1 1 hIhI hh hII hEhII − − +≅ += ( ) ( ) 1/ )()( )()()(/)()( 2 21 12 222 2 2121 − − ≅⇒+≅+ hh hIhI hEhEhIhhhEhI
  • 25. 25 ( ) [ ])()( 1/ 1 )( 122 21 2 hIhI hh hII − − +≅ Example 7 Evaluate the integral of f(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5 from a=0 to b=0.8. I (True Integral value) = 1.6405 Segments h Integral εtr% 1 0.8 0.1728 89.5 2 0.4 1.0688 34.9 4 0.2 1.4848 9.5 %)6.16(0.2733675.16405.1E 3675.1)1728.0( 3 1 )0688.1( 3 4 :givetocombined2&1Segments tt ==−= =−≅ ε I In each case, two estimates with error O(h2) are combined to give a third estimate with error O(h4) %)1(0.01716234.16405.1E 6234.1)0688.1( 3 1 )4848.1( 3 4 :givetocombined4&2Segments tt ==−= =−≅ ε I )2/(If 12 ⇒= hh [ ] )( 3 1 )( 3 4 )()( 12 1 )( 121222 hIhIhIhIhII −=− − +≅
  • 26. 26 Simpson’s Rules General idea: Use high order polynomials other than trapezoids to achieve more accurate integration result but using the similar amount of computation Parabola Cubic polynomial
  • 27. • More accurate estimate of an integral is obtained if a high-order polynomial is used to connect the points. These formulas are called Simpson’s rules. Simpson’s 1/3 Rule: results when a 2nd order Lagrange interpolating polynomial is used for f(x) dxxf xxxx xxxx xf xxxx xxxx xf xxxx xxxx I dxxfdxxfI x x b a b a xbxa xf ∫ ∫ ∫       −− −− + −− −− + −− −− = ≅= == 2 0 )( ))(( ))(( )( ))(( ))(( )( ))(( ))(( )()( 2 1202 10 1 2101 20 0 2010 21 20 2 Using .polynomialorder-secondais)(2where [ ] RULE1/3SSIMPSON' 2 )()(4)( 3 210 :resultsformulafollowingtheon,manipulatialgebraicandnintegratioafter ⇐ − =++≅ ab hxfxfxf h I a=x0 x1 b=x2 Simpson’s Rules
  • 29. 29
  • 30. 30 Trapezoidal vs. Simpson’s 1/3 Rule ( ) ( ) ( ) ( ) 3674671 2 8080 . . ..I = ++ = ++ ≅ 6 0.2322.45640 6 0.8f0.44f0f %.616=→== tt 0.27306671.367467-1.640533E ε Trapezoidal: Example: f(x) = 0.2 + 25x – 200x2 + 675x3 – 900x4 + 400x5 (integral between a=0 and b=0.8) ( ) ( ) ( ) 0.1728 2 0.8f0f 00.8 = + −≅I Et = 1.640533 – 0.1728 = 1.467733 εt = 89.5% Simpson’s 1/3 rule:
  • 32. 32 Multiple Application of Simpson’s 1/3 Rule
  • 35. 35
  • 37. 37
  • 38. 38 [ ] 8 )()(3)(3)( )( )()(3)(3)( 8 3 )()( 3210 3210 3 3 )( xfxfxfxf abI xfxfxfxf h I dxxfdxxfI ab h b a b a +++ −≅ +++≅ ≅= − = ∫ ∫ Simpson’s 3/8 Rule Simpson’s 1/3 and 3/8 rules can be applied in tandem to handle multiple applications with odd number of intervals Fit a 3rd order Lagrange interpolating polynomial to four points and integrate
  • 40. 40
  • 42. 42
  • 43. Gauss Quadrature • Gauss quadrature implements a strategy of positioning any two points on a curve to define a straight line that would balance the positive and negative errors. • Hence the area evaluated under this straight line provides an improved estimate of the integral.
  • 46. Method of Undetermined Coefficients • The trapezoidal rule yields exact results when the function being integrated is a constant or a straight line, such as y=1 and y=x: )()( 10 bfcafcI +≅ )( 2 )( 2 2 0 22 22 110 10 10 10 2/)( 2/)( 10 2/)( 2/)( bf ab af ab I ab cc ab c ab c abcc dxx ab c ab c dxcc ab ab ab ab − + − = − == = − + − − −=+ = − + − − =+ ∫ ∫ − −− − −− Solve simultaneously Trapezoidal rule
  • 47. 47 Derivation of the Two-Point Gauss-Legendre Formula/ • The object of Gauss quadrature is to determine the equations of the form • However, in contrast to trapezoidal rule that uses fixed end points a and b, the function arguments x0 and x1 are not fixed end points but unknowns. • Thus, four unknowns to be evaluated require four conditions. • First two conditions are obtained by assuming that the above eqn. for I fits the integral of a constant and a linear function exactly. • The other two conditions are obtained by extending this reasoning to a parabolic and a cubic functions. )()( 1100 xfcxfcI +≅
  • 49. 49 Two-Point Gauss-Legendre Formula (arbitrary a and b) ( ) ( ) bxx ax-x 2 xabab x d dd =→= =→=   −++ = 1 1 ( )∫= b a dxxfI ( ) ( ) ( ) ( ) ∫ = =       −++       −++ = 1x -1x ddd d 2 xabab d 2 xabab fI ( ) ( ) ∫       −++− = 1 1- d d dx 2 xabab f 2 ab I
  • 50. 50 Example of Two-Point Gauss-Legendre Formula ( ) 8225781264592532918525140 3 1 3 1 40 ....ff.I dd =+=                 +        − = ( ) ( )∫∫ +== 1 1- 0.8 0 dd dx0.4x0.4f0.4dxxfI ( )∫= 1 1- ddd dxxf40.I Example14: f(x) = 0.2 + 25x – 200x2 + 675x3 – 900x4 + 400x5 (integral between a=0 and b=0.8) x = 0.4 + 0.4xd dx = 0.4 dxd ( ) ( ) ( ) ( ) ( )[ ]∫ +++−+++−++= 1 1- dddddd dx0.4x0.40.4x0.40.4x0.40.4x0.40.4x0.4250.20.4 543 400900675200 2 I ( ) ( ) bxx ax-x 2 xabab x d dd =→= =→=   −++ = 1 1 )()( 1100 xfcxfcI +≅
  • 51. 51 Higher-Point Gauss-Legendre Formula ( ) ( ) ( )[ ]2d21d10d0 xfcxfcxfc ++= 40.I ( ) ( ) ( ) ( ) 44444444 344444444 21 L 44444 344444 21 444 3444 21 pointn 1-n1-n pointthree 22 pointtwo 1100 xfcxfcxfcxfc − − − ++++≅I ( )∫= 1 1- ddd dxxf40.I Example: f(x) = 0.2 + 25x – 200x2 + 675x3 – 900x4 + 400x5 (integral between a=0 and b=0.8) Three-point Gauss-Legendre formula: c0 = 0.5555556 x0 = - 0.774596669 c1 = 0.8888889 x1 = 0.0 c2 = 0.5555556 x2 = 0.774596669 ( ) ( ) ( )[ ].77459669f0.5555560f0.88888890.77459669-f0.5555560.4 ddd ++=I 1.640533
  • 52. 52
  • 54. 54 ( ) 543376.0318386.0768365.05.0 3 1 3 1 5.0 =+=            +      − = dd ffI ( ) ( ) ( )( ) ( ) 0.5405910.275778*0.55555560.494845*0.88888890.878598*0.55555565.0 90.77459666*0.55555560.0*0.888888990.77459666-*0.55555565.0 =++= ++= ddd fffI
  • 57. 57 Integration Using Matlab Approximation of Double Integrals Using Matlab
  • 59. 59
  • 61. 61
  • 62. 62