Question: Write a program to solve the following integral: ( 5 . 0 Points ) I = 1 3 sin ( x 2 ) cos (

Write a program to solve the following integral: (5.0 Points)
I =13 sin(x2) cos(2x)dx
1. Using the 3/8 Simpson rule. The program should:
(a) Start with number of intervals (N) equal to 1.
(b) Automatically triple the number of subintervals.
(c) At each iteration step the program must show the iteration step, subinterval number, integral value and the difference between a result and the preceding one.
(d) Stop when convergence is reached (when the difference between a result and the preceding one is smaller than a threshold given by the user). Choose a threshold value of 108.
2. Using the Gauss-Legendre method
3. Compare the performance in terms of timing and precision of both methods

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!