When we apply the integral test to a series, we consider a function \(g\) where \(a_k = g(k)\) and draw conclusions about the convergence of
\[\sum_{k=1}^{\infty} a_k\]
based on the convergence of
\[ \int_1^{\infty} g(x)\, dx.\]
Put another way, the finite integral
\[ \int_1^n g(x)\, dx\]
gives us information about the partial sum
\[ \sum_{k=1}^{n1} g(k).\]
Of course, the finite integral and the partial sum are not equal, but they are close enough so that each one converges if and only if the other one does. Additionally, the reason they are close together is that the partial sum of the sequence is also a Riemann sum of the integral, with \(\Delta x = 1\) and the lefthand endpoint of each subinterval used in forming the sum.
Figure 5: Portrait of Leonhard Euler. Public domain.

In the 18th century, both Leonhard Euler (1707–1783) and Colin MacLaurin (1698–1746) worked on the problem of determining the relationship between finite sums and the corresponding integrals. The EulerMacLaurin Formula says that if \(g\) is \(m\) times continuously differentiable on the interval \([i,j]\), then
\[ \sum^{j1}_{k=i} g(k) = \int_i^j g(t) \, dt  \frac{1}{2} \left[ g(j)  g(i) \right] + \sum_{k=2}^{m} \frac{b_k}{k!} \left[ g^{(k1)}(j)  g^{(k1)}(i) \right] + R, \,\,\,\,\,\,\,\,\,\,\mbox{(IX)}\]
where \(R\) is a remainder term that depends on the function \(g\), the interval \([i,j]\) and the degree \(m\) of the approximation [Kac 2002, p. 96]. We can think of the derivatives \(g^{(k)}(t)\) as providing information concerning how well the partial sum approximates the integral.
Figure 6: Portrait of Colin MacLaurin. Public domain.

In the case of \(i=0\) and \(j=n\), solving equation (IX) for the integral, we have
\[\int_0^n g(t) \, dt = \sum^{n1}_{k=0} g(k) + \frac{1}{2} g(n)  \frac{1}{2} g(0)  \sum_{k=2}^{m} \frac{b_k}{k!} \left[ g^{(k1)}(n)  g^{(k1)}(0) \right]  R. \,\,\,\,\,\,\,\,\,\,\mbox{(X)}\]
Although he never called it by that name, Servois derived the EulerMacLaurin Formula in his “Memoir on Quadratures” and then used it to resolve questions about the error of approximation in numerical integration formulas. The EulerMacLaurin Formula first appears in a preliminary form in his equation (6), and then in a form equivalent to formula (X) in his equation (10).
We note that Servois gave the formula as an infinite series involving the derivatives of the function \(g\), rather than with an error term. It was Siméon Denis Poisson (1781–1840) who first derived the error term associated with this formula.