Use the function diffgen to find the first and second derivatives of the function x2cosx at x=1 using h=0.1 and h=0.01.Evaluate the first derivative of cosx6 for x=1,2, and 3 using the function diffgen and taking h=0.001. Write a MATLAB function to differentiate a given function using formulae (4.6) and (4.7). Use it to solve Problems 4.1 and 4.2. Find the gradient of y =cosx6 at x =3.1,3.01,3.001, and 3 using the function diffgen with h=0.001. Compare your results with the exact result.
#Sales Offer!| Get upto 25% Off: