# Almost Stirling's Approximation

I need to prove the following bound $$n! \le e \sqrt n \left( \frac n e \right)^n$$

I can bound $\ln 1 + \ln 2 + \dots + \ln n$ as a Riemann sum with the function $\ln(n+1)$ and the trapezoidal rule:

$$(\ln 1)/2 + \sum_{i=2}^n \ln i \ + (\ln(n+1))/2 < \int_0^n \ln (x+1) dx$$

Integrating I get the bound $$n! < \left( \frac{n+1}{e} \right)^n \sqrt{n+1}$$

As $n$ goes to infinity, my bound and the required bound get arbitrarily close (for $n=1$, the error is about $4\%$), but the one I need to prove is slightly tighter. How can I modify my bound to get the required bound?

So you have $n! \lt \left( \frac{n+1}{e} \right)^n \sqrt{n+1}$.
Replacing $n$ by $n-1$, we get $(n-1)! \lt \left( \frac{n}{e} \right)^{n-1} \sqrt{n}$.
Multiplying by $n$, we get
$\begin{array}\\ n! &\lt n\left( \frac{n}{e} \right)^{n-1} \sqrt{n}\\ &= e\left( \frac{n}{e} \right)^{n} \sqrt{n}\\ \end{array}$