$24
Consider the function
f(x) = sin(4.8 π x).
Compute the derivative by hand to get the truth. Implement the following numerical methods for approximating first derivatives: (i) one-sided forward difference, (ii) one-sided backward difference, and (iii) central difference. Use the numerical methods to estimate the derivative at some value of x.
Study the convergence of the finite difference approximations. Choose several values of h and compute the error for each, then plot the relation-ship. Identify the asymptotic regime to estimate the convergence rate of each method. Do the rates depend on x?
1