Question: This is MatLab code prbolem, plz show the Matlab code in detail. From lecture we saw integral ^b _a f (x) dx = b -

 This is MatLab code prbolem, plz show the Matlab code in

This is MatLab code prbolem, plz show the Matlab code in detail.

From lecture we saw integral ^b _a f (x) dx = b - a/2 integral ^1 _-1 f (a + b/2 + t b - a/2) dt holds from a simple linear change of variables x = a + b/2 + t b-a/2 . We are going to estimate log(1.9) with Gaussian quadrature and linear interpolation. We know integral ^1 _-1 f (x) dx = sigma ^n _j = 1 omega _j f (x_j) . For n = 8 we have w = [0.3626837833783620, 0.3626837833783620, 0.3137066458778873, 0.3137066458778873, 0.2223810344533745, 0.2223810344533745 0.1012285362903763, 0.1012285362903763] and x = [- 0.1834346424956498, 0.1834346424956498, - 0.5255324099163290 0.5255324099163290, - 0.7966664774136267, 0.7966664774136267, -0.9602898564975363, 0.9602898564975363] (a) Implement (1) for n = 8 and verify that your result works by computing log(1.9) using your code and the gausstable. m function. (b) Now assume that the integrand f (x) is only known on the grid x_j = a + j Delta x where Delta x = b - a/2^k . In order to evaluate our integrand at the points required by Gaussian quadrature we need to use interpolation. Find k such that the relative error for log(1.9) is near the relative error you found in problem 2a and remark on how the interpolation step changed the results

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!