Group
Members
2
Rahima Khalid
G1F18BSCS0009
Samavia Ameen
G1F18BSCS0146
Hadia
G1F18BSCS0124
Boole’s Rule
and
Weddle’s Rule
3
Rahima Khalid
G1F18BSCS0009
Boole’s
Rule
Boole's rule, named after
George Boole, is a method of
numerical integration.
4
Boole’s
Rule
Example:
Use the Boole’s Rule with n=8 to
estimate
1
5
1 + 𝑥2 ⅆ𝑥
5
SOLUTION:
6
For n= 8, we have Δ𝑥 = ℎ =
5−1
8
= 0.5 . We compute the
values of 𝑦0, 𝑦1, 𝑦2,…..𝑦n.
x 1 1.5 2 2.5 3 3.5 4 4.5 5
1 + 𝑥2 2 3.25 5 7.25 10 13.25 17 21.25 26
7
SINCE THE FORMULA IS:
•
𝛼
𝛽
𝑦𝑑𝑥 ≈
2ℎ
45
[ 7(𝑦0+ 𝑦n) + 32(𝑦1+ 𝑦3+ 𝑦5 +…+ 𝑦n−3+
𝑦n−1 )+ 12(𝑦2+ 𝑦6+𝑦10 +…+ 𝑦n−2) + 14 (𝑦4+ 𝑦8+…
+𝑦n−4)
REDUCING THE FORMULA TO N=8:

𝛼
𝛽
𝑦𝑑𝑥 ≈
2ℎ
45
[ 7(𝑦0+ 𝑦n) + 32(𝑦1+ 𝑦3+ 𝑦5 + 𝑦7 )+
12(𝑦2+ 𝑦6) + 14 (𝑦4)
8
1
5
1 + 𝑥2𝑑𝑥 ≈
2(0.5)
45
[ 7( 2+ 26) +
32( 3.25+ 7.25+ 13.25+ 21.25)+ 12( 5+ 17)
+ 14 ( 10) ≈ 12.75601175
Exact Solution is:
1
5
1 + 𝑥2𝑑𝑥 ≈ 12.75597
Difference= 12.75601175 - 12.75597 = 0.0000417
“
9
Weddles’s
Rule
10
Example:
Use the Weddle’s Rule with n=6 to estimate
0
𝜋
sin 𝑥 ⅆ𝑥
(Mechanical Quadrature)
Weddle's rule is a method of integration used for computing
definite integral.
Solution
11
For n= 6, we have Δ𝑥 = ℎ =
𝜋
6
.
We compute the values of 𝑦0,
𝑦1, 𝑦2,…..𝑦6.
0 1 2 4 5 5 6
x 0 𝜋
6
2𝜋
6
3𝜋
6
4𝜋
6
5𝜋
6
6𝜋
6
sin 𝑥 sin 0 sin
𝜋
6 sin
2𝜋
6
sin
3𝜋
6
sin
4𝜋
6
sin
5𝜋
6
sin
6𝜋
6
sin 𝑥 0 1
2
3
2
1 3
2
1
2
0
Solution
12
SINCE THE FORMULA IS:
𝛼
𝛽
𝑦𝑑𝑥 ≈
3ℎ
10
[𝑦0+5 𝑦1+ 𝑦2 + 6 𝑦3+ 𝑦4 + 5𝑦5+ 𝑦6]
Therefore,
0
𝜋
𝑠𝑖𝑛𝑥𝑑𝑥 ≈
3(
𝜋
6
)
10
[0+5
1
2
+
3
2
+6(1)+
3
2
+ 5
1
2
+0] ≈
1.999994586
Exact Solution is:
0
𝜋
𝑠𝑖𝑛𝑥𝑑𝑥 = 2
Difference= 2-1.999994586 = 0.000005414
Quadrature
Method
13
Samavia Ameen
G1F18BSCS0146
Introduction
14
Numerical Integration
 Newton cotes formula
(Nodes are evenly spread)
 Guassian Quadrature
(Nodes are chosen)
The term Quadrature refers to methods in
which the points where the function is
evaluated are chosen.
So that the formula is exact for polynomials of
as high degree as possible.
The most basic of these methods is Gaussian
Quadrature.
16
The general form of Gaussian quadrature is
−1
1
𝑓 𝑥 𝑑𝑥 ≈
𝑖=1
𝑛
𝑐𝑖 𝑓 𝑥𝑖
𝑐𝑖 and 𝑥𝑖 depends upon choice of n
The integration formula is exact for polynomials of degree 2n-1
−1
1
𝑓 𝑥 𝑑𝑥 ≈ 𝑐1 𝑓 𝑥1 +𝑐2 𝑓 𝑥2 +𝑐3 𝑓 𝑥3 +-----------𝑐𝑛 𝑓 𝑥𝑛
17
For n=1 𝑥0, 𝑥1
−1
1
𝑓 𝑥 𝑑𝑥 ≈ 𝑐1 𝑓 𝑥1 is exact for polynomials of
degree upto 2.1-1=1
𝑥0
= −1
1
1𝑑𝑥 = ǀ𝑥 ǀ−1
1
= 1-(-1)= 2
RHS =𝑐1.1 𝑐1=2
𝑥1= −1
1
𝑥𝑑𝑥 = ǀ
𝑥2
2
ǀ−1
1
=
1
2
−
1
2
=0
RHS =𝑐1. 𝑥1= 2𝑥1 0 = 2𝑥1 𝑥1 = 0
−𝟏
𝟏
𝒇 𝒙 𝒅𝒙= 2𝒇 𝒙
18
For n=2 𝑥0
, 𝑥1
, 𝑥2
, 𝑥3
−1
1
𝑓 𝑥 𝑑𝑥 ≈ 𝑐1𝑓 𝑥1 + 𝑐2𝑓 𝑥2 upto degree
2.2-1=3
𝑥0= −1
1
1𝑑𝑥=2 =𝑐1 + 𝑐2 𝑐1 + 𝑐2=2 …i
𝑥1= −1
1
𝑥𝑑𝑥=0 =𝑐1𝑥1 + 𝑐2𝑥2 𝑐1𝑥1 + 𝑐2𝑥2=0 ....ii
𝑥2= −1
1
𝑥2𝑑𝑥 =
2
3
=𝑐1𝑥1
2
+ 𝑐2𝑥2
2
𝑐1𝑥1
2
+ 𝑐2𝑥2
2
=
2
3
...iii
𝑥3
= −1
1
𝑥3
𝑑𝑥=0 =𝑐1𝑥1
3
+ 𝑐2𝑥2
3
𝑐1𝑥1
3
+ 𝑐2𝑥2
3
=0 ...iv
−𝟏
𝟏
𝒇 𝒙 𝒅𝒙= 𝒇
−1
3
+ 𝒇
1
3
19
For n=3 2.3-1=5
−𝟏
𝟏
𝒇 𝒙 𝒅𝒙=
5
9
𝒇 −
𝟑
𝟓
+
8
9
𝒇 𝟎 +
5
9
𝒇(
𝟑
𝟓
)
For n=2
−𝟏
𝟏
𝒇 𝒙 𝒅𝒙= 𝒇
−1
3
+ 𝒇
1
3
For n=1
−𝟏
𝟏
𝒇 𝒙 𝒅𝒙= 2𝒇 𝒙
Example
20
−𝟏
𝟏
𝒆−𝒙𝟐
𝒅𝒙 =?
For n=1
−1
1
𝑒−𝑥2
𝑑𝑥 = 2𝑓 0 = 2𝑒−02
=2
For n=2
−1
1
𝑒−𝑥2
𝑑𝑥 = 𝒇
−1
3
+ 𝒇
1
3
=𝑒
−1
3 + 𝑒
−1
3
=2𝑒
−1
3 ≈2(0.7165) ≈1.433
For n=3
−1
1
𝑒−𝑥2
𝑑𝑥 =
5
9
𝒇 −
𝟑
𝟓
+
8
9
𝒇 𝟎 +
5
9
𝒇(
𝟑
𝟓
)
=
5
9
𝑒
−3
5 +
8
9
. 𝟏 +
5
9
𝑒
−3
5 =
10
9
𝑒
−3
5 +
8
9
≈1.49868
Newton Cote’s
Formula
21
Hadia
G1F18BSCS0124
Newton
Cotes’s
Formula
 Also known as Newton–Cotes quadrature rules.
 A group of formulas for numerical integration
(quadrature) based on evaluating the integrand
at equally spaced points
 They are named after Isaac Newton and Roger
Cotes.
22
Newton
Cotes’s
Formula
Useful if the value of the integrand at equally
spaced points is given.
 If it is possible to change the points at
which the integrand is evaluated, then other
methods such as Gaussian quadrature and
Clenshaw–Curtis quadrature are probably
more suitable.
23
24
 It is assumed that value of the function f defined
on[a,b] is known at equally spaced point x,for i=0,.....n
where 𝑥0=a and 𝑥1=b.
 Solved using Newton Cortes Formula
 There are two types of Newton Cortes Formula.
1. The Closed Type
2. The Open Type
The
Closed
Newton
Cotes’s
Formula
n this type we uses the function value at all
values.
The closed newton cotes formula of degree n
is stated as
𝑎
𝑏
𝑓𝑥 𝑑𝑥 =
𝑖=0
𝑛
𝑤𝑖. 𝑓(𝑥𝑖)
where 𝑥𝑖=ℎ𝑖+𝑥0,with h equal to
𝑥𝑛−𝑥0
𝑛
=
(𝑏−𝑎)
𝑛
.
The 𝑤𝑖 are called weights.
25
26
 The Closed Newton Cortes Formula produced
different methods while dealing with different degrees.
The
Opened
Newton
Cotes’s
Formula
In this type we cant used the functions value
at end points.
The opened newton cotes formula of degree n
is stated as
𝑎
𝑏
𝑓𝑥 𝑑𝑥 =
𝑖=1
𝑛−1
𝑤𝑖. 𝑓(𝑥𝑖)
The weights are found in manner simliar to
closed formula.
27
28
 The Closed Newton Cortes Formula produced
different methods while dealing with different degrees.
Practical
Life
Example
29
The vertical distance is covered by a rocket
from t=8 to t=30 seconds is given by
x =
8
30
2000ln
140000
140000 − 2100t
− 9.8t ⅆt
(a)use single segment trapezoid rule to find
the DISTANCE COVERED?
(b)Find the True Error?
(c)Find the Absolute Realtive True Error?
Practical
Life
Example
30
(a) 𝜤 ≈ 𝒃 −
𝒇(𝒂)+𝒇(𝒃)
𝟐
a=8,b=30
𝑓(𝑡) = 2000ln
140000
140000 − 2100t
− 9.8t
𝑓(𝑡) = 2000ln
140000
140000 − 2100(8)
− 9.8(8)
= 177.27m/s
𝑓(𝑡)
= 2000ln
140000
140000 − 2100(30)
− 9.8(30)
Practical
Life
Example
31
(a) 𝜤=(30-8)
177.27+001.67
2
= 11868𝑚
(b)The Exact value of the above integral is
x =
8
30
2000ln
140000
140000 − 2100t
− 9.8t ⅆt = 11061m
𝐸𝑡=True Value - Approximate Value
=11061-11868
= -807m
(c)The Absolute Realtive Ture Error would be
𝛦𝑡 =
11061 − 11868
11061
× 100
=7.2959%
32

Newton Cotes Integration Method, Open Newton Cotes, Closed Newton Cotes Gaussian Quadrature rule, Weddle's rule ,Boole's Rule

  • 2.
  • 3.
  • 4.
    Boole’s Rule Boole's rule, namedafter George Boole, is a method of numerical integration. 4
  • 5.
    Boole’s Rule Example: Use the Boole’sRule with n=8 to estimate 1 5 1 + 𝑥2 ⅆ𝑥 5
  • 6.
    SOLUTION: 6 For n= 8,we have Δ𝑥 = ℎ = 5−1 8 = 0.5 . We compute the values of 𝑦0, 𝑦1, 𝑦2,…..𝑦n. x 1 1.5 2 2.5 3 3.5 4 4.5 5 1 + 𝑥2 2 3.25 5 7.25 10 13.25 17 21.25 26
  • 7.
    7 SINCE THE FORMULAIS: • 𝛼 𝛽 𝑦𝑑𝑥 ≈ 2ℎ 45 [ 7(𝑦0+ 𝑦n) + 32(𝑦1+ 𝑦3+ 𝑦5 +…+ 𝑦n−3+ 𝑦n−1 )+ 12(𝑦2+ 𝑦6+𝑦10 +…+ 𝑦n−2) + 14 (𝑦4+ 𝑦8+… +𝑦n−4) REDUCING THE FORMULA TO N=8:  𝛼 𝛽 𝑦𝑑𝑥 ≈ 2ℎ 45 [ 7(𝑦0+ 𝑦n) + 32(𝑦1+ 𝑦3+ 𝑦5 + 𝑦7 )+ 12(𝑦2+ 𝑦6) + 14 (𝑦4)
  • 8.
    8 1 5 1 + 𝑥2𝑑𝑥≈ 2(0.5) 45 [ 7( 2+ 26) + 32( 3.25+ 7.25+ 13.25+ 21.25)+ 12( 5+ 17) + 14 ( 10) ≈ 12.75601175 Exact Solution is: 1 5 1 + 𝑥2𝑑𝑥 ≈ 12.75597 Difference= 12.75601175 - 12.75597 = 0.0000417
  • 9.
  • 10.
    10 Example: Use the Weddle’sRule with n=6 to estimate 0 𝜋 sin 𝑥 ⅆ𝑥 (Mechanical Quadrature) Weddle's rule is a method of integration used for computing definite integral.
  • 11.
    Solution 11 For n= 6,we have Δ𝑥 = ℎ = 𝜋 6 . We compute the values of 𝑦0, 𝑦1, 𝑦2,…..𝑦6. 0 1 2 4 5 5 6 x 0 𝜋 6 2𝜋 6 3𝜋 6 4𝜋 6 5𝜋 6 6𝜋 6 sin 𝑥 sin 0 sin 𝜋 6 sin 2𝜋 6 sin 3𝜋 6 sin 4𝜋 6 sin 5𝜋 6 sin 6𝜋 6 sin 𝑥 0 1 2 3 2 1 3 2 1 2 0
  • 12.
    Solution 12 SINCE THE FORMULAIS: 𝛼 𝛽 𝑦𝑑𝑥 ≈ 3ℎ 10 [𝑦0+5 𝑦1+ 𝑦2 + 6 𝑦3+ 𝑦4 + 5𝑦5+ 𝑦6] Therefore, 0 𝜋 𝑠𝑖𝑛𝑥𝑑𝑥 ≈ 3( 𝜋 6 ) 10 [0+5 1 2 + 3 2 +6(1)+ 3 2 + 5 1 2 +0] ≈ 1.999994586 Exact Solution is: 0 𝜋 𝑠𝑖𝑛𝑥𝑑𝑥 = 2 Difference= 2-1.999994586 = 0.000005414
  • 13.
  • 14.
    Introduction 14 Numerical Integration  Newtoncotes formula (Nodes are evenly spread)  Guassian Quadrature (Nodes are chosen)
  • 15.
    The term Quadraturerefers to methods in which the points where the function is evaluated are chosen. So that the formula is exact for polynomials of as high degree as possible. The most basic of these methods is Gaussian Quadrature.
  • 16.
    16 The general formof Gaussian quadrature is −1 1 𝑓 𝑥 𝑑𝑥 ≈ 𝑖=1 𝑛 𝑐𝑖 𝑓 𝑥𝑖 𝑐𝑖 and 𝑥𝑖 depends upon choice of n The integration formula is exact for polynomials of degree 2n-1 −1 1 𝑓 𝑥 𝑑𝑥 ≈ 𝑐1 𝑓 𝑥1 +𝑐2 𝑓 𝑥2 +𝑐3 𝑓 𝑥3 +-----------𝑐𝑛 𝑓 𝑥𝑛
  • 17.
    17 For n=1 𝑥0,𝑥1 −1 1 𝑓 𝑥 𝑑𝑥 ≈ 𝑐1 𝑓 𝑥1 is exact for polynomials of degree upto 2.1-1=1 𝑥0 = −1 1 1𝑑𝑥 = ǀ𝑥 ǀ−1 1 = 1-(-1)= 2 RHS =𝑐1.1 𝑐1=2 𝑥1= −1 1 𝑥𝑑𝑥 = ǀ 𝑥2 2 ǀ−1 1 = 1 2 − 1 2 =0 RHS =𝑐1. 𝑥1= 2𝑥1 0 = 2𝑥1 𝑥1 = 0 −𝟏 𝟏 𝒇 𝒙 𝒅𝒙= 2𝒇 𝒙
  • 18.
    18 For n=2 𝑥0 ,𝑥1 , 𝑥2 , 𝑥3 −1 1 𝑓 𝑥 𝑑𝑥 ≈ 𝑐1𝑓 𝑥1 + 𝑐2𝑓 𝑥2 upto degree 2.2-1=3 𝑥0= −1 1 1𝑑𝑥=2 =𝑐1 + 𝑐2 𝑐1 + 𝑐2=2 …i 𝑥1= −1 1 𝑥𝑑𝑥=0 =𝑐1𝑥1 + 𝑐2𝑥2 𝑐1𝑥1 + 𝑐2𝑥2=0 ....ii 𝑥2= −1 1 𝑥2𝑑𝑥 = 2 3 =𝑐1𝑥1 2 + 𝑐2𝑥2 2 𝑐1𝑥1 2 + 𝑐2𝑥2 2 = 2 3 ...iii 𝑥3 = −1 1 𝑥3 𝑑𝑥=0 =𝑐1𝑥1 3 + 𝑐2𝑥2 3 𝑐1𝑥1 3 + 𝑐2𝑥2 3 =0 ...iv −𝟏 𝟏 𝒇 𝒙 𝒅𝒙= 𝒇 −1 3 + 𝒇 1 3
  • 19.
    19 For n=3 2.3-1=5 −𝟏 𝟏 𝒇𝒙 𝒅𝒙= 5 9 𝒇 − 𝟑 𝟓 + 8 9 𝒇 𝟎 + 5 9 𝒇( 𝟑 𝟓 ) For n=2 −𝟏 𝟏 𝒇 𝒙 𝒅𝒙= 𝒇 −1 3 + 𝒇 1 3 For n=1 −𝟏 𝟏 𝒇 𝒙 𝒅𝒙= 2𝒇 𝒙
  • 20.
    Example 20 −𝟏 𝟏 𝒆−𝒙𝟐 𝒅𝒙 =? For n=1 −1 1 𝑒−𝑥2 𝑑𝑥= 2𝑓 0 = 2𝑒−02 =2 For n=2 −1 1 𝑒−𝑥2 𝑑𝑥 = 𝒇 −1 3 + 𝒇 1 3 =𝑒 −1 3 + 𝑒 −1 3 =2𝑒 −1 3 ≈2(0.7165) ≈1.433 For n=3 −1 1 𝑒−𝑥2 𝑑𝑥 = 5 9 𝒇 − 𝟑 𝟓 + 8 9 𝒇 𝟎 + 5 9 𝒇( 𝟑 𝟓 ) = 5 9 𝑒 −3 5 + 8 9 . 𝟏 + 5 9 𝑒 −3 5 = 10 9 𝑒 −3 5 + 8 9 ≈1.49868
  • 21.
  • 22.
    Newton Cotes’s Formula  Also knownas Newton–Cotes quadrature rules.  A group of formulas for numerical integration (quadrature) based on evaluating the integrand at equally spaced points  They are named after Isaac Newton and Roger Cotes. 22
  • 23.
    Newton Cotes’s Formula Useful if thevalue of the integrand at equally spaced points is given.  If it is possible to change the points at which the integrand is evaluated, then other methods such as Gaussian quadrature and Clenshaw–Curtis quadrature are probably more suitable. 23
  • 24.
    24  It isassumed that value of the function f defined on[a,b] is known at equally spaced point x,for i=0,.....n where 𝑥0=a and 𝑥1=b.  Solved using Newton Cortes Formula  There are two types of Newton Cortes Formula. 1. The Closed Type 2. The Open Type
  • 25.
    The Closed Newton Cotes’s Formula n this typewe uses the function value at all values. The closed newton cotes formula of degree n is stated as 𝑎 𝑏 𝑓𝑥 𝑑𝑥 = 𝑖=0 𝑛 𝑤𝑖. 𝑓(𝑥𝑖) where 𝑥𝑖=ℎ𝑖+𝑥0,with h equal to 𝑥𝑛−𝑥0 𝑛 = (𝑏−𝑎) 𝑛 . The 𝑤𝑖 are called weights. 25
  • 26.
    26  The ClosedNewton Cortes Formula produced different methods while dealing with different degrees.
  • 27.
    The Opened Newton Cotes’s Formula In this typewe cant used the functions value at end points. The opened newton cotes formula of degree n is stated as 𝑎 𝑏 𝑓𝑥 𝑑𝑥 = 𝑖=1 𝑛−1 𝑤𝑖. 𝑓(𝑥𝑖) The weights are found in manner simliar to closed formula. 27
  • 28.
    28  The ClosedNewton Cortes Formula produced different methods while dealing with different degrees.
  • 29.
    Practical Life Example 29 The vertical distanceis covered by a rocket from t=8 to t=30 seconds is given by x = 8 30 2000ln 140000 140000 − 2100t − 9.8t ⅆt (a)use single segment trapezoid rule to find the DISTANCE COVERED? (b)Find the True Error? (c)Find the Absolute Realtive True Error?
  • 30.
    Practical Life Example 30 (a) 𝜤 ≈𝒃 − 𝒇(𝒂)+𝒇(𝒃) 𝟐 a=8,b=30 𝑓(𝑡) = 2000ln 140000 140000 − 2100t − 9.8t 𝑓(𝑡) = 2000ln 140000 140000 − 2100(8) − 9.8(8) = 177.27m/s 𝑓(𝑡) = 2000ln 140000 140000 − 2100(30) − 9.8(30)
  • 31.
    Practical Life Example 31 (a) 𝜤=(30-8) 177.27+001.67 2 = 11868𝑚 (b)TheExact value of the above integral is x = 8 30 2000ln 140000 140000 − 2100t − 9.8t ⅆt = 11061m 𝐸𝑡=True Value - Approximate Value =11061-11868 = -807m (c)The Absolute Realtive Ture Error would be 𝛦𝑡 = 11061 − 11868 11061 × 100 =7.2959%
  • 32.