Submit your work in the form of a multiple .m files. Please put your first initial and last initial (in lowercase letters) before each script or function name. If you are submitting a script file, start your file off with the command clear
and please clearly label and describe each problem with comments in your file.
Write a function called MidptApprox
that approximates the integral $\int_{a}^{b}f(x)\; dx$ using the Midpoint Rule defined as follows:
Include in your function file at least two ways of determining the value of $M_{n}$ and have the function run through the calculations of both and display which method it is using and the solution (even though the answers will be identical).
Write a function called TrapApprox
that approximates the integral $\int_{a}^{b}f(x)\; dx$ using the Trapezoidal Rule defined as follows:
Include in your function file at least two ways of determining the value of $T_{n}$ and have the function run through the calculations of both and display which method it is using and the solution (even though the answers will be identical).
Write a function called SimpApprox
that approximates the integral $\int_{a}^{b}f(x)\; dx$ using Simpson's Rule defined as follows:
Include in your function file, at least two ways of determining the value of $S_{n}$ and have the function run through the calculations of both and display which method it is using and the solution (even though the answers will be identical).