numerical vs exact
Objective: %% bar graph showing the error bds is maximum whereas fourth order cds is the lowest clear all close all clc %y=sin(x)/x^3; x=pi/3; %analytical derivative=(x^3*cos(x)-sin(x)*3*x^2)/x^6; analytical_derivative=(x^3*cos(x)-sin(x)*3*x^2)/x^6; %numerical derivative dx=pi/20; %forward difference scheme forward_differencing=(sin(x+dx)/(x+dx)^3-sin(x)/x^3)/dx;…