Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Mathlab! Consider the function f(x) = e^-x^2 sin (x). Estimate the derivative of the function at the point x = 0 using each of
Using Mathlab!
Consider the function f(x) = e^-x^2 sin (x). Estimate the derivative of the function at the point x = 0 using each of the four formulas listed below for all of the following values of h= 10^n, n = 1, 2, ..., 6. f'(x_0 + h) - f(x_0)/h (forward difference) f'(x_0) f(x_0 + h) - f(x_0 - h)/2 h (3-point centered difference) f'(x_0) -f(x_0 + 2h) + 4f(x_0 + h) - 3f(x_0)/2h f'(x_0) -f(x_0 + 2h) + 8f(x_0 + h) - 8f(_0 - h)) + f(x_0 - 2h)/12h Plot your error verses ft for all methods on the same graph. You may have cause to use loglog plot with the commands: loglog loglog(x1, y1, '-k', x2, y2, '-b', x3, y3, '-g', x4, y4, '-m', linewidth', 2); legend ('FD', '3pt CD', '3pt 1SD', '5pt CD'); Explain your findings. Is the error decreasing with ft? Why or why not? Which method has the largest error? Which method has the smallest error? WhyStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started