Professional Documents
Culture Documents
(1) Use all applicable two-point formulas to determine each missing entry in the following
table
x f (x) f 0 (x)
1.0 0.5403023059
1.3 0.2674988286
1.5 0.0707372017
The given data are taken from function f (x) = cos x. Compute the actual errors and
find error bounds using the error formula.
Solution: Via the forward-difference formula, we have
f (1.0 + 0.3) − f (1.0) f (1.3) − f (1)
f 0 (1.0) ≈ =
0.3 0.3
0.2674988286 − 0.5403023059
= = −0.9093449243,
0.3
f (1.3 + 0.2) − f (1.3) f (1.5) − f (1.3)
f 0 (1.3) ≈ =
0.2 0.2
0.0707372017 − 0.2674988286
= = −0.9838081345.
0.2
Using the backward-difference formula, we have
f (1.3 − 0.3) − f (1.3) f (1) − f (1.3)
f 0 (1.3) ≈ =
−0.3 −0.3
0.5403023059 − 0.2674988286
= = −0.9093449243,
−0.3
f (1.5 − 0.2) − f (1.5) f (1.3) − f (1.5)
f 0 (1.5) ≈ =
−0.2 −0.2
0.2674988286 − 0.0707372017
= = −0.9838081345.
−0.2
Therefore, the missing entries are f 0 (1) = −0.9093449243, f 0 (1.3) = −0.9093449243 or
−0.9838081345, and f 0 (1.5) = −0.9838081345.
1
x0 approximate f 0 (x0 ) actual error error bound
1 -0.9093449243 0.0678739395 | 0.3
2
· f 00 (1)| = 0.08104534588 (use nodes x = 1, 1.3)
−0.3
1.3 -0.9093449243 0.0542132611 | 2 · f 00 (1)| = 0.08104534588 (use nodes x = 1, 1.3)
1.3 -0.9838081345 0.0202499491 | 0.2
2
· f 00 (1.3)| = 0.02674988286 (use nodes x = 1.3, 1.5)
−0.2
1.5 -0.9838081345 0.0136868521 | 2 · f 00 (1.3)|= 0.02674988286 (use nodes x = 1.3, 1.5)
(2) Use the indicated three-point formula to determine each missing entry in the following
table
x f (x) f 0 (x)
1.1 0.453596121425577 use formula (4.4)
1.2 0.362357754476674 use formula (4.5)
1.3 0.267498828624587 Do not compute
1.4 0.169967142900241 use formula (4.6)
Solution: By above (4.4), (4.5) and (4.6) and h = 1.1 − 1 = 1.2 − 1.1 = 1.3 − 1.2 =
1.4 − 1.3 = 0.1, we have
1
f 0 (1.1) ≈ [−3f (1.1) + 4f (1.2) − f (1.3)] = −0.894280874973124,
0.2
1
f 0 (1.2) ≈ [f (1.3) − f (1.1)] = −0.930486464004950,
0.2
1
f 0 (1.4) ≈ [f (1.2) − 4f (1.3) + 3f (1.4)] = −0.988680656604763.
0.2
For the formulas (4.4) and (4.6), the error bound can be compute using following
2 2
f (c)) 6 |h| M,
h (3)
3 3
where M is the maximum of |f (3) (x)| = | sin x| for x between x0 and x0 + 2h. For the
formula (4.5), the error bound can be compute using following
2 2
− f (c)) 6 |h| M,
h (3)
6 6
2
where M is the maximum of |f (3) (x)| = | sin x| for x between x0 − h and x0 + h.
Then we obtain the following table
Find a bound for the error of the numerical result obtained in problem 1 using the
error formula, and compare this to the actual error.
Solution: Applying the Trapezoidal rule for x0 = 1, x1 = 2 and f (x) = 5x4 + 3x2 , we
obtain the approximate value
Z 2
2−1
(5x4 + 3x2 )dx ≈ [f (1) + f (2)] = 0.5 · (8 + 92) = 50.
1 2
Find a bound for the error of the numerical result using the error formula, and compare
this to the actual error.
x2 − x0
Solution: Applying the Simpson’s rule for x0 = 1, x1 = 1.5, x2 = 2, h = = 0.5
2
and f (x) = 5x4 + 3x2 , we obtain the approximate value
Z 2
h
(5x4 + 3x2 ) dx ≈ [f (1) + 4f (1.5) + f (2)]
1 3
0.5
= [(5 + 3) + 4(25.3125 + 6.75) + (80 + 12)] = 38.0416̄.
3
3
Since f (4) (x) = 120 and h = 0.5, the error bound is
5
h (4) (0.5)5 (4) (0.5)5
1
f (c) =
90 |f (c)| = × 120 = = 0.0416̄.
90 90 24
Z 2
for 1 < c < 2. For (5x4 + 3x2 ) dx = 38, the actual error is
0
(5) Use the definition to find the degree of precision of the quadrature formula
Z 2 √ ! √ !
−2 3 2 3
f (x) dx = 2 f +2 f .
−2 3 3
4
and the quadrature formula gives
√ ! √ ! √ !2 √ !2
−2 3 2 3 −2 3 2 3 8 8 16
2f +2 f =2 +2 = + = ,
3 3 3 3 3 3 3
which is not the value of direct integration. So this given quadrature formula is exact
for polynomial of degree at most 3.