Question: ***********PLEASE ANSWER USING MATLAB********** A more precise rule for evaluating integrals is called the Euler Maclaurin rule after the Euler- Maclaurin formula. Integral_a^yb f(x) dx

***********PLEASE ANSWER USING MATLAB**********

***********PLEASE ANSWER USING MATLAB********** A more precise rule for evaluating integrals is

A more precise rule for evaluating integrals is called the "Euler Maclaurin rule" after the Euler- Maclaurin formula. Integral_a^yb f(x) dx = h[1/2 f(a) + 1/2 f(b) + sigma_m = 1^N = 1 f(a + mh)] + 1/12 h^2 [f'(a) - f'(b)] + O(h^4) Where h = (b - a)/N. This result gives a value for the integral has an error of order h^4-a factor of h^2 better than the error on the trapezoidal rule and as good as Simpson's rule. Write a program to calculate the value of the integral f(x) = x^4 - 2x + 1 between 0 lessthanorequalto x lessthanorequalto 2 using this formula. The order-h term in the formula is just the ordinary trapezoidal rule; the h^2 term involves the derivatives f (a) and f'(b), which you should evaluate using central differences, centered on a and b respectively. Note that the size of the interval you use for calculating the central differences does not have to equal the value of used in the trapezoidal rule part of the calculation. An interval of about 10 5 gives good values for the central differences. Use your program to evaluate the integral with N = 10 slices and compare the accuracy of the result with that obtained from the trapezoidal rule alone with the same number of slices

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!