Question: Write in python please! #7 is the integral from 0 to 1 of sin(x^3) dx 1. Write a Python procedure to implements Simpson's Rule to

Write in python please! #7 is the integral from 0 to 1 of sin(x^3) dx  Write in python please! #7 is the integral from 0 to

1. Write a Python procedure to implements Simpson's Rule to compute an approximation to the value of f(a) dar (You may assume the function is continuous so you don't have to worry about undefined function values). You may want to use the formula at the middle of page 231 to implement the rule. Test your function on the integral sin (as) dar from exercise #2 above. The definition statement of your program should be def Simp (f, a, b, N): where fis the function, a and b are the endpoints, and N is the number of subintervals. Your output statement should be: The approximate value of the integral with NNNNN subintervals is XXXXX where NNNNN is the number of subintervals N and XXXXX is the approximate value of the integral. 2. Write a program that implements the three-point Gaussian Quadrature formula (the nodes and weights from #6 above) to compute an approximation to the value of (a) dr. You will need to transform the interval la, b to the interval [-1,1] us- ing the ideas on page 240; however, let the computer compute the values of the nodes and weights, not your calculator (You may assume the function is continuous so you don't have to worry about undefined function values). The definition statement of your program should be def Gauss3(f, a, b) where f is the function and a and b are the endpoints. Your output statement should be The approximate value of the integral is XXXXX Test your function on the integral from #7 above

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!