Home » Blog » Prove an inequality relating sums and integrals

Prove an inequality relating sums and integrals

Prove that

    \[ \sum_{k=1}^{n-1} f(k) \leq \int_1^n f(x) \, dx \leq \sum_{k=2}^n f(k) \]

where f is a nonnegative, increasing function defined for all x \geq 1.

Use this to deduce the inequalities

    \[ e n^n e^{-n} < n! < e n^{n+1} e^{-n} \]

by taking f(x) = \log x.


Proof. Since f(x) is increasing we know f([x]) \leq f(x) \leq f([x+1]) (where [x] denotes the greatest integer less than or equal to x) for all x \geq 1. Define step functions s and g by

    \[ s(x) = f([x]), \qquad t(x) = f([x+1]). \]

Then s and t are constant on the open subintervals of the partition

    \[ P = \{ 0,1,2, \ldots, n \}. \]

So,

    \begin{align*}  \int_1^n s(x) \, dx = \sum_{k=1}^{n-1} s_k (x_k - x_{k-1}) = \sum_{k=1}^{n-1} f(k) \\[9pt]  \int_1^n t(x) \, dx = \sum_{k=1}^{n-1} t_k (x_k - x_{k-1}) = \sum_{k=1}^{n-1} f(k+1) = \sum_{k=2}^n f(k). \end{align*}

Since f is integrable we must have

    \[ \int_1^n s(x) \, dx \leq \int_1^n f(x) \, dx \leq \int_1^n t(x) \, dx \]

for every pair of step functions s \leq f \leq t. Hence,

    \[ \sum_{k=1}^{n-1} f(k) \leq \int_1^n f(x) \, dx \leq \sum_{k=2}^n f(k). \qquad \blacksquare \]

Next, if we take f(x) = \log x (which is nonnegative and increasing on x \geq 1) we have

    \begin{align*}  &&\sum_{k=1}^{n-1} \log k \leq \int_1^n \log x \, dx \leq \sum_{k=2}^n \log k \\[9pt]  \implies && \log(n-1)! \leq n \log n - n + 1 \leq \log n! \\[9pt]  \implies && (n-1)! \leq e n^n e^{-n} \leq n!. \end{align*}

From this we then get two inequalities

    \[ n! \leq en^{n+1} e^{-n} \quad \text{and} \quad e n^n e^{-n} \leq n!. \]

Therefore,

    \[ en^n e^{-n} \leq n! \leq e n^{n+1} e^{-n}. \]

Point out an error, ask a question, offer an alternative solution (to use Latex type [latexpage] at the top of your comment):