Calculus (I)
WEN-CHING LIEN
Department of Mathematics National Cheng Kung University
2008
WEN-CHINGLIEN Calculus (I)
8.7 Numerical Integration
(1) The Midpoint Rule
Support that [x0,x1, . . . ,xn] is a partition of[a,b]into n subintervals of equal lengths. Assume that f is continuous on[a,b].
We approximate
Z b
a
f(x)dx
by
Mn= b−a n
n
X
k=1
f(ck),
where ck = xk−12+xk is the midpoint of [xk−1,xk].
WEN-CHINGLIEN Calculus (I)
8.7 Numerical Integration
(1) The Midpoint Rule
Support that [x0,x1, . . . ,xn] is a partition of[a,b]into n subintervals of equal lengths. Assume that f is continuous on[a,b].
We approximate
Z b
a
f(x)dx
by
Mn= b−a n
n
X
k=1
f(ck),
where ck = xk−12+xk is the midpoint of [xk−1,xk].
WEN-CHINGLIEN Calculus (I)
8.7 Numerical Integration
(1) The Midpoint Rule
Support that [x0,x1, . . . ,xn] is a partition of[a,b]into n subintervals of equal lengths. Assume that f is continuous on[a,b].
We approximate
Z b
a
f(x)dx
by
Mn= b−a n
n
X
k=1
f(ck),
where ck = xk−12+xk is the midpoint of [xk−1,xk].
WEN-CHINGLIEN Calculus (I)
8.7 Numerical Integration
(1) The Midpoint Rule
Support that [x0,x1, . . . ,xn] is a partition of[a,b]into n subintervals of equal lengths. Assume that f is continuous on[a,b].
We approximate
Z b
a
f(x)dx
by
Mn= b−a n
n
X
k=1
f(ck),
where ck = xk−12+xk is the midpoint of [xk−1,xk].
WEN-CHINGLIEN Calculus (I)
8.7 Numerical Integration
(1) The Midpoint Rule
Support that [x0,x1, . . . ,xn] is a partition of[a,b]into n subintervals of equal lengths. Assume that f is continuous on[a,b].
We approximate
Z b
a
f(x)dx
by
Mn= b−a n
n
X
k=1
f(ck),
where ck = xk−12+xk is the midpoint of [xk−1,xk].
WEN-CHINGLIEN Calculus (I)
Error Estimate:
Suppose that |f
′′(x)| ≤ k ∀x ∈ [a, b]. Then the error in the midpoint rule is at most
Z
ba
f ( x ) dx − M
n≤ K (b − a)
324n
2WEN-CHINGLIEN Calculus (I)
Error Estimate:
Suppose that |f
′′(x)| ≤ k ∀x ∈ [a, b]. Then the error in the midpoint rule is at most
Z
ba
f ( x ) dx − M
n≤ K (b − a)
324n
2WEN-CHINGLIEN Calculus (I)
Error Estimate:
Suppose that |f
′′(x)| ≤ k ∀x ∈ [a, b]. Then the error in the midpoint rule is at most
Z
ba
f ( x ) dx − M
n≤ K (b − a)
324n
2WEN-CHINGLIEN Calculus (I)
Error Estimate:
Suppose that |f
′′(x)| ≤ k ∀x ∈ [a, b]. Then the error in the midpoint rule is at most
Z
ba
f ( x ) dx − M
n≤ K (b − a)
324n
2WEN-CHINGLIEN Calculus (I)
Remark:
In the interval [x
k+1, x
k], the tangent at the midpoint c
kis
φ(x ) = f (c
k) + (x − c
k)f
′(c
k)
WEN-CHINGLIEN Calculus (I)
Remark:
In the interval [x
k+1, x
k], the tangent at the midpoint c
kis
φ(x ) = f (c
k) + (x − c
k)f
′(c
k)
WEN-CHINGLIEN Calculus (I)
Remark:
In the interval [x
k+1, x
k], the tangent at the midpoint c
kis
φ(x ) = f (c
k) + (x − c
k)f
′(c
k)
WEN-CHINGLIEN Calculus (I)
φ(x) =f(ck) + (x −ck)f′(ck)
⇒ f(x)−φ(x) = 1
2(x−ck)2f′′(ξ), ξ∈(x,ck)
Z xk
xk−1
(f(x)−φ(x))dx
≤K · Z xk
xk−1
1
2|x −ck|2dx
= K
24h3 (h= b−a n )
WEN-CHINGLIEN Calculus (I)
φ(x) =f(ck) + (x −ck)f′(ck)
⇒ f(x)−φ(x) = 1
2(x−ck)2f′′(ξ), ξ∈(x,ck)
Z xk
xk−1
(f(x)−φ(x))dx
≤K · Z xk
xk−1
1
2|x −ck|2dx
= K
24h3 (h= b−a n )
WEN-CHINGLIEN Calculus (I)
φ(x) =f(ck) + (x −ck)f′(ck)
⇒ f(x)−φ(x) = 1
2(x−ck)2f′′(ξ), ξ∈(x,ck)
Z xk
xk−1
(f(x)−φ(x))dx
≤K · Z xk
xk−1
1
2|x −ck|2dx
= K
24h3 (h= b−a n )
WEN-CHINGLIEN Calculus (I)
φ(x) =f(ck) + (x −ck)f′(ck)
⇒ f(x)−φ(x) = 1
2(x−ck)2f′′(ξ), ξ∈(x,ck)
Z xk
xk−1
(f(x)−φ(x))dx
≤K · Z xk
xk−1
1
2|x −ck|2dx
= K
24h3 (h= b−a n )
WEN-CHINGLIEN Calculus (I)
(2) The Trapezoidal Rule We approximate
Z
ba
f (x )dx by
T
n= b − a n
f (x
0)
2 + f ( x
1) + · · · + f ( x
n−1) + f (x
n) 2
WEN-CHINGLIEN Calculus (I)
(2) The Trapezoidal Rule We approximate
Z
ba
f (x )dx by
T
n= b − a n
f (x
0)
2 + f ( x
1) + · · · + f ( x
n−1) + f (x
n) 2
WEN-CHINGLIEN Calculus (I)
(2) The Trapezoidal Rule We approximate
Z
ba
f (x )dx
by
T
n= b − a n
f (x
0)
2 + f ( x
1) + · · · + f ( x
n−1) + f (x
n) 2
WEN-CHINGLIEN Calculus (I)
Error Estimate:
Suppose that|f′′(x)| ≤k ∀x ∈[a,b]. Then the error in the trapezoidal rule is at most
Z b
a
f(x)dx −Tn
≤K(b−a)3 12n2
WEN-CHINGLIEN Calculus (I)
Error Estimate:
Suppose that|f′′(x)| ≤k ∀x ∈[a,b]. Then the error in the trapezoidal rule is at most
Z b
a
f(x)dx −Tn
≤K(b−a)3 12n2
WEN-CHINGLIEN Calculus (I)
Error Estimate:
Suppose that|f′′(x)| ≤k ∀x ∈[a,b]. Then the error in the trapezoidal rule is at most
Z b
a
f(x)dx −Tn
≤K(b−a)3 12n2
WEN-CHINGLIEN Calculus (I)
Error Estimate:
Suppose that|f′′(x)| ≤k ∀x ∈[a,b]. Then the error in the trapezoidal rule is at most
Z b
a
f(x)dx −Tn
≤K(b−a)3 12n2
WEN-CHINGLIEN Calculus (I)
Examples:
f(x) = 1 x,
Z 4
1
1 xdx
(1)Midpoint Rule (2)Trapezoidal Rule (3)Error
WEN-CHINGLIEN Calculus (I)
Examples:
f(x) = 1 x,
Z 4
1
1 xdx
(1)Midpoint Rule (2)Trapezoidal Rule (3)Error
WEN-CHINGLIEN Calculus (I)
Examples:
f(x) = 1 x,
Z 4
1
1 xdx
(1)Midpoint Rule (2)Trapezoidal Rule (3)Error
WEN-CHINGLIEN Calculus (I)
Examples:
f(x) = 1 x,
Z 4
1
1 xdx
(1)Midpoint Rule (2)Trapezoidal Rule (3)Error
WEN-CHINGLIEN Calculus (I)
Remark:
The Midpoint Rule is the tangent formula So in this example,
M3 ≤ Z 4
1
1
xdx ≤T3
WEN-CHINGLIEN Calculus (I)
Remark:
The Midpoint Rule is the tangent formula So in this example,
M3 ≤ Z 4
1
1
xdx ≤T3
WEN-CHINGLIEN Calculus (I)
Remark:
The Midpoint Rule is the tangent formula So in this example,
M3 ≤ Z 4
1
1
xdx ≤T3
WEN-CHINGLIEN Calculus (I)
Remark:
The Midpoint Rule is the tangent formula So in this example,
M3 ≤ Z 4
1
1
xdx ≤T3
WEN-CHINGLIEN Calculus (I)
(3) The Simpon’s Rule
Step 1.
We consider g(x) =Ax2+Bx +C.
⇒ Z b
a
g(x)dx = b−a 6
g(a) +4g(a+b
2 ) +g(b)
WEN-CHINGLIEN Calculus (I)
(3) The Simpon’s Rule
Step 1.
We consider g(x) =Ax2+Bx +C.
⇒ Z b
a
g(x)dx = b−a 6
g(a) +4g(a+b
2 ) +g(b)
WEN-CHINGLIEN Calculus (I)
Step 2.
Sn =
b−a
6n f(x0) +f(xn) +2(f(x1) +· · ·+f(xn−1)) +4h
f(x0+x2 1) +· · ·+f(f(xn−1)+f(x2 n))io
WEN-CHINGLIEN Calculus (I)
Step 3.
Z b
a
f(x)dx −Sn
≤ 1
180(b−a)M4h4,
Here,
f(4)(x)
≤M4, h= b−a n
WEN-CHINGLIEN Calculus (I)
Thank you.
WEN-CHINGLIEN Calculus (I)