4 Third order derivative.a. Use Taylor series to derive the truncation error of the approximationf′′′(x) ≈( −f(x − 2h) + 2f(x − h) − 2f(x + h) + f(x + 2h))/2h^3assuming f ∈ C^5.b. Explain why dividing by h produces no roundoff error if h = 2−k, k ∈ N.c. Assuming that built-in functions return exact answers but that addition/subtraction produce roundoff errors and that h = 2^−k, k ∈ Z, show that the roundoff error RE in computing this expression satisfies the bound |RE| ≤ (K1 + K2h)u/h^3 where K1, K2 depend on f and x. You may use using the bound |θn| <nu/ (1 − nu)d. Hence estimate, in terms of u, the optimal choice for h.
Question
4 Third order derivative.a. Use Taylor series to derive the truncation error of the approximationf′′′(x) ≈( −f(x − 2h) + 2f(x − h) − 2f(x + h) + f(x + 2h))/2h^3assuming f ∈ C^5.b. Explain why dividing by h produces no roundoff error if h = 2−k, k ∈ N.c. Assuming that built-in functions return exact answers but that addition/subtraction produce roundoff errors and that h = 2^−k, k ∈ Z, show that the roundoff error RE in computing this expression satisfies the bound |RE| ≤ (K1 + K2h)u/h^3 where K1, K2 depend on f and x. You may use using the bound |θn| <nu/ (1 − nu)d. Hence estimate, in terms of u, the optimal choice for h.
Solution
a. The Taylor series expansion of f(x ± h) and f(x ± 2h) around x are:
f(x ± h) = f(x) ± hf'(x) + h²f''(x)/2 ± h³f'''(x)/6 + h⁴f''''(x)/24 + O(h⁵)
f(x ± 2h) = f(x) ± 2hf'(x) + 4h²f''(x)/2 ± 8h³f'''(x)/6 + 16h⁴f''''(x)/24 + O(h⁵)
Substituting these into the approximation formula gives:
f'''(x) ≈ (−f(x − 2h) + 2f(x − h) − 2f(x + h) + f(x + 2h))/2h³
= (−[f(x) - 2hf'(x) + 2h²f''(x) - 8/3h³f'''(x) + 2/3h⁴f''''(x) + O(h⁵)] + 2[f(x) - hf'(x) + h²f''(x)/2 - h³f'''(x)/6 + h⁴f''''(x)/24 + O(h⁵)] - 2[f(x) + hf'(x) + h²f''(x)/2 + h³f'''(x)/6 + h⁴f''''(x)/24 + O(h⁵)] + [f(x) + 2hf'(x) + 2h²f''(x) + 8/3h³f'''(x) + 2/3h⁴f''''(x) + O(h⁵)])/2h³
Simplifying this gives:
f'''(x) ≈ f'''(x) + h²f''''(x)/3 + O(h³)
So the truncation error is h²f''''(x)/3 + O(h³).
b. Dividing by h = 2^−k, k ∈ N produces no roundoff error because it is equivalent to a binary shift operation, which is exact in floating point arithmetic.
c. The roundoff error RE in computing this expression is due to the addition/subtraction operations. Each addition/subtraction operation can introduce a relative error of at most u, the machine precision. The total relative error is then bounded by |θn| < nu/(1 − nu), where n is the number of operations. In this case, n = 7 (4 subtractions and 3 additions), so |θn| < 7u/(1 − 7u). The absolute error is then |RE| = |θn|*|(−f(x − 2h) + 2f(x − h) − 2f(x + h) + f(x + 2h))/2h³| ≤ (K1 + K2h)u/h³, where K1, K2 are constants that depend on f and x.
d. The total error is the sum of the truncation error and the roundoff error. To minimize this, we take the derivative with respect to h and set it equal to zero. This gives h_optimal = (3K1u/2K2)^(1/5). Substituting the bound for |RE| gives h_optimal = (21/2)^(1/5)u^(1/5).
Similar Questions
Consider the following finite-difference scheme for approximating the derivative of a function f(x)f'(x)≈a*f(x)+b*f(x+h)+c*f(x+2h)+d*f(x+3h)/h(2.1) Apply Taylor’s (Lagrange remainder) theorem about the point x to write down expressions for f(x + h), f(x + 2h) and f(x + 3h) in terms of h, f(x), f'(x), f''(x), etc, with remainder terms thatare O(h^4).(2.2) Substitute these expressions into (2.1) and hence determine a system of linear equations that must be satisfied by the coefficients a, b, c and d for the error of (2.1) to be O(h^3) as h → 0.(2.3) Solve the system from part (2.2) for the coefficients a, b, c and d. You may use technology to solve the system, but the answers must be exact.(2.4) Use the finite-difference formula (2.1) together with the coefficients you found in part (2.3) to estimate the derivative of f(x) = e^x at x = 0 for h = 0.5. What is the magnitude of the error in this case? How much smaller would h need to be to decrease the error by a factor of 1000?
Does Taylor's Theorem with Remainder guarantee that the second Taylor polynomial at x=3 has an error less than 0.0001 in the estimate of 10e3.4 ?
use matlab to do: Calculate the 2nd derivative and higher derivatives of f (x) = 1 + x + x^2 +x^3 + x^4 + x^5 + x^6 + x^7 + x^8 using the finite difference formulae for higher derivatives. How do the errors vary with step size?
Does Taylor's Theorem with Remainder guarantee that the second Taylor polynomial of f(x)=8ex at x=2 has an error less than 0.1 in the estimate of 8e2.3 ?
Suppose that you are estimating √7 using the second Taylor polynomial for √x at x=6 . Use Taylor's Theorem for Remainders to bound the error.Round your answer to six decimal places.Provide your answer below:
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.