Question: use matlab and show all codes 10. Simpson's formula for approximating an integral has the form b h Sr(v)dx zq (x) + 4f(xx) + 2f

use matlab and show all codes
10. Simpson's formula for approximating an integral has the form b h Sr(v)dx zq (x) + 4f(xx) + 2f (x) + 4f (83) + - +25(xan-2) + 4f(x?n=3) + f(x2n)1. a where h = (b-a), and Xx = a + kh/2, Write a function with the header I = mySimpson (f, a,b,n) which implements this formula. Use your function to determine the approximate value of the integral S*x/(1+ sin x) dx for n= 5, 10, and 20. Use format long to output your results. (Challenge: From the knowledge of the three results above, and the fact that the exact value of the integral is t, determine the smallest n required to obtain the value of the integral with the 10-digit accuracy.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
