5. (20 points) (a) Write a function eval_central diff(f, a,b,n) that evaluates the derivative of f defined on [a, b] usi
Posted: Mon Jun 06, 2022 4:30 pm
5. (20 points) (a) Write a function eval_central diff(f, a,b,n) that evaluates the derivative of f defined on [a, b] using central differences at the point , = a + ih for i = 1,...,n-1 where h = = and returns: 11 x.diff All partition points where the numerical derivatives are evaluated the value of the numerical derivative evaluated at each point of x-diff central-diff (b) Use the function eval.central diff to evaluate the numerical derivative of the function f (ar) sin ² on the interval [0, 2] with n= 10000. The exact derivative is of course df = 2x cos 2². Find the absolute value of the maximum difference between the numerical derivative and exact derivative evaluated at the points x.diff.