0% found this document useful (0 votes)
84 views

Lecture Notes 5-Numerical Intergration

Uploaded by

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

Lecture Notes 5-Numerical Intergration

Uploaded by

23146315
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

APPLIED

MATHEMATICS
in MECHANICAL
ENGINEERING

Lecture notes
Ha Le Nhu Ngoc Thanh, Ph.D.
Chapter 5:
NUMERICAL INTERGATION

1. Introduction of Newton-Cotes Integration Formulas


2. Trapezoidal’s Rule
3. Simpson’s Rule

Applied Mathematics in
Ph.D. Ha Le Nhu Ngoc Thanh 2 Mechanical Engineering
Introduction of Newton-Cotes Integration Formulas
Trapezoidal’s Rule
Simpson’s Rule
Gauss quadrature

INTRODUCTION
Newton-Cotes formulas
The Newton-Cotes formulas are the most common numerical integration schemes.
b b
I f (x )dx fn (x )dx
a a
where fn (x ) a0 a1x an 1x n 1
an x n

Applied Mathematics in
Ph.D. Ha Le Nhu Ngoc Thanh 3 Mechanical Engineering
Introduction of Newton-Cotes Integration Formulas
Trapezoidal’s Rule
Simpson’s Rule
Gauss quadrature

THE TRAPEZOIDAL RULE


Trapezoidal rule
The trapezoidal rule is the first order of the Newton-Cotes formulas.
If there is ONE interval
b b
I f (x )dx f1(x )dx
a a
f (b) f (a )
where f1(x ) f (a ) (x a )
b a
b
f (b) f (a )
I f (a ) (x a ) dx
b a
a
b
b f (b) f (a )
f (a ) x (x a )d (x a)
a b a
a
1 f (b) f (a ) b 1
2
I f (a )(b a) (x a) f (a )(b a) f (b) f (a ) (b a)
2 b a a 2
f (a ) f (b)
I (b a) Trapezoidal rule: I width average height
2
Applied Mathematics in
Ph.D. Ha Le Nhu Ngoc Thanh 4 Mechanical Engineering
Introduction of Newton-Cotes Integration Formulas
Trapezoidal’s Rule
Simpson’s Rule
Gauss quadrature

THE TRAPEZOIDAL RULE


Trapezoidal rule
If there are MULTIPLE intervals(n spaces) for n 1 points
b a
interval space: h , x 0 a, x n b
n
b b x1 x2 xn
I f (x )dx fn (x )dx f (x )dx f (x )dx f (x )dx
a a x0 x1 xn 1

f (x 0 ) f (x1 ) f (x1 ) f (x 2 ) f (x n 2) f (x n 1 ) f (x n 1 ) f (x n )
h h h h
2 2 2 2
n 1
h
I f (x 0 ) 2 f (x i ) f (x n )
2 i 1

Applied Mathematics in
Ph.D. Ha Le Nhu Ngoc Thanh 5 Mechanical Engineering
Introduction of Newton-Cotes Integration Formulas
Trapezoidal’s Rule
Simpson’s Rule
Gauss quadrature

THE TRAPEZOIDAL RULE


Error of Trapezoidal rule Menu 8 : Table f (x ) input start, end, step
Error is computed by: i xi f (x i )
M (b a )3 0 0 1
E , where M max f (x )
12n 2 x [a ,b ] 1 0.2 0.9607
2 x2 2 0.4 0.8521
Example 1: compute e dx , with n 10
Solve:
0 3 0.6 0.6976
x2 2 0 4 0.8 0.5272
Let a 0, b 2, f (x ) e ,n 10 h 0.2
10 5 1 0.3678
xi x 0 ih 6 1.2 0.2369
we can establish a table as beside 7 1.4 0.1408
9 9
h 0.2 8 1.6 0.0773
I f (x 0 ) 2 f (x i ) f (x10 ) 1 2 f (x i ) 0.0183 0.8818
2 i 1 2 i 1 9 1.8 0.0392
x2 10 2 0.0183
f (x ) 2xe
x2 x2 x2
f (x ) 2e 2x 2e 2e 1 2x 2
Applied Mathematics in
Ph.D. Ha Le Nhu Ngoc Thanh 6 Mechanical Engineering
Introduction of Newton-Cotes Integration Formulas
Trapezoidal’s Rule
Simpson’s Rule
Gauss quadrature

THE TRAPEZOIDAL RULE


Example 2
4 3
Given I x dx ,
2
How many interval needing to divide in [2, 4] to E 10 3 , and compute I
Solve:
a 2, b 4, f (x ) x3 f (x ) 6x
M max f (x ) 6 4 24
x [2,4]
M (b a )3 24(4 2)3 3
E 10 n2 16 103
12n 2 12n 2
n 0
n 126.49 n 127

Applied Mathematics in
Ph.D. Ha Le Nhu Ngoc Thanh 7 Mechanical Engineering
Introduction of Newton-Cotes Integration Formulas
Trapezoidal’s Rule
Simpson’s Rule
Gauss quadrature

Exercises
4
Exercise 1: I x sin xdx
0
Find value of I, with E 0.2 10 2 , and max f (x ) 2
x [0, ]
4
1 x2
Exercise 2: I e dx
0
Find value of I, with n 8
2
Exercise 3: I (8 4 cos x )dx
0
Find value of I , with n 4, and find E
3 x
Exercise 4: I (1 e )dx
0
Find value of I , with n 5, and find E
4 Solve:
3 5
Exercise 5: I (1 x 4x 2x )dx Guide exercise 1: choose n 7
2
Find value of I , with n 6, and find E
Applied Mathematics in
Ph.D. Ha Le Nhu Ngoc Thanh 8 Mechanical Engineering
Introduction of Newton-Cotes Integration Formulas
Trapezoidal’s Rule
Simpson’s Rule
Gauss quadrature

SIMPSON RULE
Simpson’s rule
The trapezoidal rule use first order (straight line through 2 points) to generate a series
trapezoidal to compute an integration.
The Simpson’s rule use second order (parabolic curve) to generate a series trapezoidal to
compute an integration.
b x2 parabolic f2 (x )
I f (x )dx f2 (x )dx f (x )
a x0
where f2 (x ) a 0 a1x a2x 2 , interpolated by second-order
Lagrange polynomial through three points (x 0 , x1, x 2 )
x x1 x x2 x x0 x x2 x x0 x x1
f2 (x ) f x0 f x1 f x2
x0 x1 x 0
x2 x1 x 0 x1 x 2 x 2 x 0 x 2 x1 a x0 x1 b x2
x2 h
I f2 (x )dx f (x 0 ) 4 f (x1 ) f (x 2 ) Simpson x x0 x1 x2
x0 3
b a x2 x 0 f (x ) f (x 0 ) f (x1 ) f (x 2 )
where h ; (Note: one large interval=two small intervals)
2 2
Applied Mathematics in
Ph.D. Ha Le Nhu Ngoc Thanh 9 Mechanical Engineering
Introduction of Newton-Cotes Integration Formulas
Trapezoidal’s Rule
Simpson’s Rule
Gauss quadrature

SIMPSON RULE
Simpson’s rule for multiple points

b a
h , 2n is number of small interval spaces
2n
b x2 x4 x 2n
I f (x )dx f (x )dx f (x )dx f (x )dx
a x0 x2 x 2n 2

h h 2h
f (x 0 ) 4 f (x1 ) f (x 2 ) f (x 2 ) 4 f (x 3 ) f (x 4 )
3 3
h
f (x 2n 2 ) 4 f (x 2n 1) f (x 2n ) n b a 2h
3
h
f (x 0 ) f (x 2n ) 2 f (x 2 ) f (x 4 ) f (x 2n 2) 4 f (x1 ) f (x 3 ) f (x 2n 1 )
3
2n 1 2n 2
h
I f (x 0 ) 4 f (x i ) 2 f (x j ) f (x 2n )
3 i 1,3,5 j 2,4,6

Applied Mathematics in
Ph.D. Ha Le Nhu Ngoc Thanh 10 Mechanical Engineering
Introduction of Newton-Cotes Integration Formulas
Trapezoidal’s Rule
Simpson’s Rule
Gauss quadrature

SIMPSON RULE
Error of Simpson’s rule
5
M b a i xi yi
E , where M max f (4)(x ) y0 y12
0 0 1
4 x a,b
180 2n I
h
3
2 y2 y4 y6 y8 y10 1 1 12 1.00697
4 y1 y3 y5 y7 y9 y11 2 2 12 1.02817
1 x2 1.46266 3 3 12 1.06449
Example 3: I e dx , n intervals are minimum
0 4 4 12 1.11752
4
Find I ? with E 10 , M max f (4)(x ) 76e 5 5 12 1.18959
x [0,1]
Solve: 6 6 12 1.28403
7 7 12 1.40534
x2
a 0, b 1, f (x ) e , M 76e 8 8 12 1.55962
9 9 12 1.75505
M (b a )5 76e(1 0)5 4 76e 104
E 10 n 4 5.17 10 10 12 2.0026
4 4 4
180 2n 180 2n 180 2 11 11 12 2.31701
12 1 2.71828
b a 1
Choose large interval: n 6 small interval: 2n 12 h
2n 12 Applied Mathematics in
Ph.D. Ha Le Nhu Ngoc Thanh 11 Mechanical Engineering
Introduction of Newton-Cotes Integration Formulas
Trapezoidal’s Rule
Simpson’s Rule
Gauss quadrature

SIMPSON RULE

Example 4: f (x ) 0.2 25x 200x 2 675x 3 900x 4 400x 5


Estimate the integral of f (x ) from a 0, b 0.8, n 4 i xi f (x i )
0 0 0.2
Solve: 1 0.1 1.289
b a 0.8 2 0.2 1.288
a 0, b 0.8, h 0.1
2n 2 4 3 0.3 1.607
h 4 0.4 2.456
I y 0 y 8 2 y2 y 4 y 6 4 y1 y 3 y5 y7
3 5 0.5 3.325
0.1 0.2 0.232 2 1.288 2.456 3.464 6 0.6 3.464
1.63946
3 4 1.289 1.607 3.325 2.363 7 0.7 2.363
8 0.8 0.232

Applied Mathematics in
Ph.D. Ha Le Nhu Ngoc Thanh 12 Mechanical Engineering
Introduction of Newton-Cotes Integration Formulas
Trapezoidal’s Rule
Simpson’s Rule
Gauss quadrature

Exercises

3.2
Exercise 1: I ln x 2 dx
2
Find value of I , with 2n 6, and find E
2
Exercise 2: I (8 4 cos x )dx
0
Find value of I , with n 4, and find E
3 x
Exercise 3: I (1 e )dx
0
Find value of I , with 2n 10, and find E
4
Exercise 4: I (1 x 4x 3 2x 5 )dx
2
Find value of I , with n 6, and find E

Applied Mathematics in
Ph.D. Ha Le Nhu Ngoc Thanh 13 Mechanical Engineering

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy