Consider a. Evaluate by executing Simpson_Gen (see Problem 40) with x = 1, 1.4, 1.7, 1.9, 2.3,…

 
   

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadlines.  

Consider

a. Evaluate by executing Simpson_Gen (see Problem 40) with x = 1, 1.4, 1.7, 1.9, 2.3, 2.5, 2.6, 2.8, 3.3, 3.8, 4.

b. Evaluate by executing Simpson (see Section 6.3) with x = 1:0.3:4 (equally spaced with increments of 0.3). c. Calculate the relative errors associated with the results of (a) and (b).

Problem 40

Write a user-defined function with syntax I = Simpson_ Gen(f,x) that uses the composite Simpson’s 1/3 rule to estimate the value of the integral of f from a to b, which are the first and last entries of the vector x, and the entries of x are not necessarily equally spaced. Then apply Simpson_Gen to estimate the value of

where

a. x = 0, 0.1, 0.25, 0.3, 0.4, 0.55, 0.6, 0.7, 0.85, 0.9, 1

b. x = 0:0.1 : 1 (equally spaced with increments of 0.1)