Question: (a) Write a MATLAB program to compute the derivative of f(x)=cos x at x=pi/6 using the forward, backward, and central difference formula. Use the step

(a) Write a MATLAB program to compute the derivative of f(x)=cos x at x=pi/6 using the forward, backward, and central difference formula. Use the step size h=10^-n for n=1, ...., 5. Make a table for each method which includes the values of derivatives, errors, and ratios of consecutive errors.

(b) Next, compute the derivative using smaller step size h=10^-n for n=6,...,14. Recall that numerical instabilities occur for h

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!