Question: Modify the function int_fun written in class (posted on Blackboard) to calculate the integral between two anonymous functions using the midpoint rectangular integration rule.

Modify the function int_fun written in class (posted on Blackboard) to calculate the integral between two 

Modify the function int_fun written in class (posted on Blackboard) to calculate the integral between two anonymous functions using the midpoint rectangular integration rule. The new function should take the form Int= int2_fun (func1, func2, a, b, num_rectangles) Where the integral is the area between two anonymous functions, func1 and func2. It's ok to assume that func2 will always be the upper function, that is: INT = = [ (func(x) - func(x))dx Test your function by integrating (in your main script) between 1. func2(x)=x*, func1(x)= x(12) from 0 to 5 using 5000 rectangles. 2. func2(x)=sin(x)e*, func1(x) = cos(x)ln(x) from 1 to 3.18 using 5000 rectangles.

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 Programming Questions!