Question: USING MATLAB please answer q10 10. Simpson's formula for approximating an integral has the form (x where h = (b -a), and Xx = a
10. Simpson's formula for approximating an integral has the form (x 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" */(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 , determine the smallest a 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
