Problem 38: Discontinuous integrands ($\u2713$ $\u2713$)

For any number $x\phantom{\rule{0.3em}{0ex}}$, the largest integer less than or equal to $x$ is denoted by $\left[x\right]\phantom{\rule{0.3em}{0ex}}$. For example, $\left[3.7\right]=3$ and $\left[4\right]=4\phantom{\rule{0.3em}{0ex}}$.

- (i)
- Sketch the graph of $y=\left[x\right]$
for $0\le x<5$
and evaluate
$${\int}_{0}^{5}\left[x\right]\phantom{\rule{2.77695pt}{0ex}}\mathrm{d}x\phantom{\rule{2.77695pt}{0ex}}.$$
- (ii)
- Sketch the graph of $y=\left[{\mathrm{e}}^{x}\right]$
for $0\le x<lnn\phantom{\rule{0.3em}{0ex}}$,
where $n$
is an integer, and show that
$${\int}_{0}^{lnn}\left[{\mathrm{e}}^{x}\right]\phantom{\rule{0.3em}{0ex}}\mathrm{d}x=nlnn-ln\left(n!\right)\phantom{\rule{2.77695pt}{0ex}}.$$
Hence show that $n!\ge {n}^{n}{\mathrm{e}}^{1-n}\phantom{\rule{0.3em}{0ex}}$.

Comments

I had to add a bit to the original question because it was all dressed up with nowhere to go. The question is clearly about estimating $n!$ so I added in the last line, which makes the question a bit longer but not much more difficult. I could have added another part, but I thought that you would probably add it yourself: you will easily spot, once you have drawn the graphs, that a similar result for $n!\phantom{\rule{0.3em}{0ex}}$ with the inequality reversed can be obtained by considering rectangles the tops of which are above the graph of ${\mathrm{e}}^{x}$ instead of below it. You therefore end up with a nice sandwich inequality for $n!\phantom{\rule{0.3em}{0ex}}$.

Stirling (1692 – 1770) proved in 1730 that $n!\approx \sqrt{2\pi \phantom{\rule{0.3em}{0ex}}}{n}^{n+\frac{1}{2}}{\mathrm{e}}^{-n}$ for large $n$. This was a brilliant result — even reading his book, it is hard to see where he got $\sqrt{2\pi}$ from (especially as he wrote in Latin). Then he went on to obtain the approximation in terms of an inﬁnite series; the expression above is just the ﬁrst term.

Solution to problem 38

(i)

The integral is the sum of the areas of the rectangles shown in the ﬁgure:

(ii)

The value of $\left[{\mathrm{e}}^{x}\right]$ changes from $k-1$ to $k$ when ${\mathrm{e}}^{x}=k\phantom{\rule{0.3em}{0ex}}$ i.e. when $x=lnk\phantom{\rule{0.3em}{0ex}}$. Thus $\left[{\mathrm{e}}^{x}\right]=k$ when $lnk\le x<ln\left(k+1\right)\phantom{\rule{0.3em}{0ex}}$ and the area of the corresponding rectangle is $k\left(\right.ln\left(k+1\right)-lnk\left)\right.\phantom{\rule{0.3em}{0ex}}$.

The total area under the curve is therefore

which you can rearrange to obtain $nlnn-ln\left(n!\right)$ as required.

For the last part, note that $\left[{\mathrm{e}}^{x}\right]\le {\mathrm{e}}^{x}$ (this is clear from the deﬁnition) so

Taking exponentials gives the required result.

Post-mortem

Usually when you draw a graph of a discontinuous function, you should specify at the jump whether the function takes the upper or lower value. For example $\left[x\right]$ takes the value 1 at $x=1$, which is the upper value. This can be achieved by putting (say) a circle round the upper or lower point, as appropriate. I didn’t bother on the above graphs, because it doesn’t affect the value of the integral and I didn’t want to clutter up the graphs.

Considering $\left[{\mathrm{e}}^{x}+1\right]$ instead of $\left[{\mathrm{e}}^{x}\right]$ gives rectangles above the graph of $y={\mathrm{e}}^{x}$ rather than below. The calculations are roughly the same, so you should easily arrive at $n!\le {n}^{n+1}{\mathrm{e}}^{1-n}\phantom{\rule{0.3em}{0ex}}$. We have therefore proved that

This gives a pretty good (given the rather elementary method at our disposal) approximation for $n!$ for large $n\phantom{\rule{0.3em}{0ex}}$.