Question: USE MATLAB! USE MATLAB! QUESTION 3a: The methods that we used for approximating single integrals can be used for approximating the area between 2 curves.
USE MATLAB!

USE MATLAB!
QUESTION 3a: The methods that we used for approximating single integrals can be used for approximating the area between 2 curves. As discussed in the lecture, the Midpoint Rule used for evaluating the area between 2 curves is given as: jis(x)= g(x)]dx= [(6.-(7.)lar (3) where x is the midpoint of [x-1, xi] and Ar b-a n y A f(x) 4x b-a n b Write a function called area2 that will retum the area between 2 curves using the Midpoint Rule principle in (3). Start with the function definition shown below. function (output] = area2(f,g, a,b,n) 8 COUTPUT) = AREA2 (F,G,A,B,N) evaluates and returns the final value of the % the area between 2 curves (f(x) and g(x)) end The function will receive: the 2 mathematical functions (f, g), the lower bound of the integral (a), the upper bound of the integral (b), the number of sub-intervals (n). Test your function using function handles with: f(x)= cos(x) g(x)=sin(x) a=0, b=0.5, n = 100
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
