Question: Could you answer these in Python? Integrals The integral of a real-valued, positive, continuous function fbetween a and b is the area between the x-axis,
Could you answer these in Python?


Integrals The integral of a real-valued, positive, continuous function fbetween a and b is the area between the x-axis, the graph of the function, and the vertical lines through a and b. There are some ways to calculate an integral numerically f(x) Figure 1: lustration of the integral as an area Simpson's formula estimates the integral to be f(a)+4f2 2+f(b) An extended (modified Simpson's) formula uses h - (b- a) and f(x)dx - (f(a + (2)-2)h) + 4f(a + (2j-1)h) + f(a + 2jh)) Implement functions simp (fun, a, b) and msimp (fun, a, b, n) that implements these formulae. Here, fun is a function you are trying to find integral of. For example, you would call simp (exp, 0, 2). Then compare the approximate values with n - 10 for the following exact integrals. (You might have to define functions yourselves.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
