Question: Has to be written in Python. Cannot use numpy, can only import math. a) Write a function defined as: def Simpson (fan, a, b, npoints

 Has to be written in Python. Cannot use numpy, can only

Has to be written in Python. Cannot use numpy, can only import math.

a) Write a function defined as: def Simpson (fan, a, b, npoints = 21): Purpose: use Simpson's 1/3 rule to estimate the integral of fen(x), between the limits of a and b. fcn: the function we want to integrate a and the lower and upper limits of integration npoints: The number of integration points used in the range to (inclusive). npoints must be an ODD number. If ppoinzs is not ODD, then add 1 to make it odd! return value: the estimate of the integral Write and call a main () function that uses your Simpson function to estimate and print the integral of: x-3cos(x): with a=1, b=3, npoints = 10 cos (2x).x": with a=2, b=3, npoints = 23

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!