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?

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

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

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!