Tutorial questions
Tutorial questions
EXAMPLE 9.4
Given f (x) = ex , use the MATLAB function diff to approximate f (1.5) with h = 0.1.
(a) f (x) ≈ 1
4h [f (x + 2h) − f (x − 2h)],
(b) f (x) ≈ 1
2h [4f (x + h) − 3f (x) − f (x + 2h)] .
3. Using Taylor’s series, derive the following approximation for the third deriva-
tive of f
1
f (x) ≈ [f (x + 2h) − 2f (x + h) + 2f (x − h) − f (x − 2h)] .
2h3
4. Using Taylor’s series, determine the error term for the approximate formula
1
f (x) ≈ [f (x + 2h) − f (x)] .
2h
6. Using Taylor’s series, determine the error term for the approximate formula
1
f (x) ≈ [f (x + 4h) − f (x − h)] .
5h
i i
i
i i
7. Use Taylor’s series to derive the following approximation formula for the third
derivative of f .
1
f (x) ≈ [−f (x) + 3f (x + h) − 3f (x + 2h) + f (x + 3h)] .
h3
8. Use Taylor’s series to derive the following approximation formula for the first
derivative of f .
10. What does the difference scheme approximates. Give its error order?
1
[f (x + 3h) + f (x − h) − 2f (x)].
2h
11. Derive a difference formula for f (x0 ) through f (x0 ), f (x0 −h), and f (x0 +2h)
and find the leading error term.
8f (x + h) − 8f (x − h) − f (x + 2h) + f (x − 2h)
f (x) = .
12h
14. Using the following data find f (6.0) with error = O(h), and f (6.3), with
error = O(h2 )
15. Define
−f (x + 2h) + 4f (x + h) − 3f (x)
S(h) = .
2h
i i
i i