The bounds of the definite integral to which we are approximating is
determined by the our inputs.
Example: approximate([0, 10], [3, 5], [10, 7]) will approximate the definite
integral of the function that produces these coordinates with a lower
bound of 0, and an upper bound of 10.
Example: approximate(function($x) {return $x**2;}, 0, 4 ,5) will produce
a set of arrays by evaluating the callback at 5 evenly spaced points
between 0 and 4. Then, this array will be used in our approximation.
Midpoint Rule:
xn ⁿ⁻¹ xᵢ₊₁
∫ f(x)dx = ∑ ∫ f(x)dx
x₁ ⁱ⁼¹ xᵢ
ⁿ h
= ∑ - [f(xᵢ)+f(xᵢ₊₁)] + O(h³f″(x))
ⁱ⁼¹ 2
where h = xᵢ₊₁ - xᵢ
note: this implementation does not compute the error term.