Here are the three following ways to estimate the value of a definite integral with $n$ sub-intervals:

1) Midpoint Rule

$M_{n} = \int^b_a f(x)dx \approx \Delta x[f(x_{1})+f(x_{2})+...+f(x_{n-1})+f(x_{n})]$

Where $x_{i}$ is the midpoint of each interval.

2) Trapezoid Rule

$T_{n} = \int^b_a f(x)dx \approx \frac{\Delta x}{2} [f(x_{0})+2f(x_{1})+2f(x_{2})+...+2f(x_{n-1})+f(x_{n})]$

3) Simpsons Rule

$S_{n} = \int^b_a f(x)dx \approx \frac{\Delta x}{3} [f(x_{0})+4f(x_{1})+2f(x_{2})+...+2f(x_{n-2})+4f(x_{n-1})+f(x_{n})]$

If $f''$ is continuous from [$a, b$] and there is a value $M$ such that $|f''(x)| \leq M$ for all $x \in [a, b]$, then we can use the following formulas to calculate the error of the Midpoint and Trapezoid Rule:

1) Midpoint Rule Error Formula

$E_{M} \leq \frac{M(b-a)^{3}}{24n^{2}}$

2) Trapezoid Rule Error Formula

$E_{T} \leq \frac{M(b-a)^{3}}{12n^{2}}$

If $f^{(4)} (x)$ is continuous from $[a, b]$ and there is a value $K$ such that $|f^{(4)} (x)| \leq K$ for all $x \in [a, b]$, then we can use the following formulas to calculate the error of Simpsons Rule:

3) Simpson's Rule Error Formula

$E_{S} \leq \frac{K(b-a)^{5}}{180n^{4}}$

Here is a formula that may be of use when calculating the points of interest in Trapezoid and Simpsons Rule:

$x_{i} = a + i\Delta x$

Where $x_{i}$ is the point of interest at $i$.