Numerical Integratio N: Prepared By: Engr. Cielito V. Maligalig
Numerical Integratio N: Prepared By: Engr. Cielito V. Maligalig
Integratio
n
Where:
f(x) – integrand
a = lower boundary
b = upper boundary
Using LaGrange Interpolation
What is trapezoidal rule?
= (f(a) + f(b))(b-a)/2
= 1/2h(f0 + f1)
where:
I = definite integral between a and b
h = increment
fo,f1 = value of the function
Simpson’
s 1/3 Rule
• It is another
Newton Cotes
formula, where
subdivided the
interval between
a and b into two
equal parts.
Simpson’s 1/3 Rule
• Newton Cotes 2nd order function.
where:
h = (b-a)/3
•
f(x) = x sinx
a = 0.5
b = 1.2
I = 1/2h(f0 + f1)
=0.475356
h = (b-a)/2 = (1.2 – 0.5)/2 = 0.35
Using
f2 = 1.2 sin 1.2 = 1.118447
Simpson’s
The substitute to the formula
1/3 rule
I = 1/3h(f0 + 4f1 + f2)
= 0.45646
Using Simpson’s 3/8 rule
• I = 3/8*(0.23333)*
(2.64458) = x f(x)
0.5 0.239713
0.733333 0.490857
0.966667 0.795564
1.2 1.118447
Sum 2.64458
Modified Trapezoidal
Rule x f(x)
◦
0.5 0.239713
0.733333 0.490857
0.966667 0.795564
1.2 1.118447
◦ A=
f f f f Sum 2.64458
o 1 2 n
◦ A = ½ h {f0 + fn + 2(f1 + f2 + f3 + … + f(n-1)}
◦ Where h = (b – a)/n
Modified 1/3
Simpson’s Rule
◦
◦ A = = + + + …+
f f f f
◦ A = 1/3 h {f0 o+ fn 1+2 (f2
2 +f4+f6
n + … + f(n-2)) + 4(f1 + f3 + f5 + … + f(n-1)}
◦ Where: h = (b – a)/2n
Modified 3/8 Simpson’s
Rule
◦
f f f f
o 1 2 n
◦ A = = + + + …+
◦ A = 3/8 h { f0 + fn + 3(f1 + f2 + f4 + f5 + f 7 + f8 + … + f(n-2) + f(n-1)) + 2 (f3 + f6 + f9 + … + f(n-3)}
◦ Where: h = (b – a) 3n
Assignment(lec & lab)
use excel app for lab ex.3
◦
◦ Determine the approximate integration of the
following using simple & modified
trapezoidal,1/3 Simpson’s and 3/8 Simpson’s
Rule.
a. , use n = 4
b. n =3