- #1

ver_mathstats

- 260

- 21

- Homework Statement
- Part (A) Find the truncation error of the approximation f'(x) by (f(x+h)-f(x-h))/2h.

Part (B) When evaluated on a computer, for what value of h the error of this approximation is the smallest?

Part (C) For the function f(x)=sinxe^cosx plot the error |(f'(x)-(f(x+h)-f(x-h))/2h)| versus h fot the appropriate values of h.

- Relevant Equations
- f'(x) by (f(x+h)-f(x-h))/2h

Part (A) I have already determined the truncation error of order O(h

Part (B) I'm struggling with how to approach this part. I do not really understand where to begin to figure out what value of h is the approximation the smallest. Is this looking for a particular range? Or are we isolating for h? And I do understand that h is the step count, just not entirely positive on how to find the ideal value of h.

Part (C) For plotting the function I am using matlab, I just want to know if I am understanding correctly, I have to substitute my function into the error? And that is what I am plotting?

Thank you.

^{2}).Part (B) I'm struggling with how to approach this part. I do not really understand where to begin to figure out what value of h is the approximation the smallest. Is this looking for a particular range? Or are we isolating for h? And I do understand that h is the step count, just not entirely positive on how to find the ideal value of h.

Part (C) For plotting the function I am using matlab, I just want to know if I am understanding correctly, I have to substitute my function into the error? And that is what I am plotting?

Thank you.

Last edited: