- #1
bobsmiters
- 12
- 0
I am taking a Math/Cmpt class and I am useless with this program that we need to use Matlab.
Q: The derivative of a function f(x) can be approximated at the point x=x(sub)0 by a forward divided difference
f'(x(sub)0) ≈ [f(x(sub)0 + h) - f(x(sub)0)] / h
or by a central divided difference
f'(x(sub)0) ≈ [f(x(sub)0 + h) - f(x(sub)0)] / 2h
For the function f(x)= sin x, plot the error as a function of h when these divided differences are used to approximate f'(1) = cos1 for h = 10^-1, 10^-2, 10^-3, ..., 10^-16. Use loglog scale and display your results in one window using subplot.
As far and the loglog and subplot is concerned I understand what to do... it is the rest of the question that is causing a lot of difficulties. if there are any pointers on where to begin it would be much appreciated.
Q: The derivative of a function f(x) can be approximated at the point x=x(sub)0 by a forward divided difference
f'(x(sub)0) ≈ [f(x(sub)0 + h) - f(x(sub)0)] / h
or by a central divided difference
f'(x(sub)0) ≈ [f(x(sub)0 + h) - f(x(sub)0)] / 2h
For the function f(x)= sin x, plot the error as a function of h when these divided differences are used to approximate f'(1) = cos1 for h = 10^-1, 10^-2, 10^-3, ..., 10^-16. Use loglog scale and display your results in one window using subplot.
As far and the loglog and subplot is concerned I understand what to do... it is the rest of the question that is causing a lot of difficulties. if there are any pointers on where to begin it would be much appreciated.