I Don't Understand Error Bounds I understand they're supposed to give us a limit on how off our approximation of an integral can be, but I don't understand how the formula gives that.

What does the second derivative have to do with anything? Why are the constants 12 and 24 put in front of $n^2$? I'm really looking for an explanation as to why this formula gives us error bounds.
 A: Here is a derivation of the error bound for the midpoint rule.
The midpoint rule is
$$\int_{a}^{b}f(x)dx \approx \frac{b-a}{n}\sum_{j=1}^{n}f(\bar{x}_j),$$
where $x_j = a + j(b-a)/n$ and $\bar{x}_j = (x_{j-1}+x_j)/2.$
The absolute error is 
$$E = \left|\int_{a}^{b}f(x)dx - \frac{b-a}{n}\sum_{j=1}^{n}f(\bar{x}_j)\right| = \left|\sum_{j=1}^{n}\int_{x_{j-1}}^{x_{j}}[f(x)-f( \bar{x}_j)]dx \right|.$$
Using Taylor's theorem,
$$f(x) = f(\bar{x}_j)+f'(\bar{x}_j)(x-\bar{x}_j) + \frac1{2}f''(\xi_x)(x-\bar{x}_j)^2,  $$
where $\xi_x$ is between $x$ and $\bar{x}_j$ and $|f''(\xi_x)| \leq K$.
Substituting and integrating we get 
$$E =  \left|\sum_{j=1}^{n}\frac1{2}\int_{x_{j-1}}^{x_{j}}f''( \bar{x}_j)(x-\bar{x}_j)^2dx \right| \\ \leq \frac1{2}\sum_{j=1}^{n}\int_{x_{j-1}}^{x_{j}}|f''( \bar{x}_j)|(x-\bar{x}_j)^2dx  \leq \frac{K}{24}\sum_{j=1}^{n}(x_j-x_{j-1})^3 = \frac{K}{24}\sum_{j=1}^{n}\left(\frac{b-a}{n}\right)^3\\= \frac{K(b-a)^3}{24n^2}$$
A: These formulas are methods for approximating integrals.
Because the actual answer isn't the answer obtained by using simpson's rule, trapezoidal rule, etc.
We allocate for that difference by using a formula to calculate that difference.
We use this difference to then see how close our value is to the accepted value.
This is useful application in both physics and mathematics. 
