I have doubts about my proof, I think I made some possible mistakes but I can't find them for some reason.
By considering the area under the curves $y = \ln x$ and $y = \ln(x − 1)$, show that $$N\ln N-N<\ln(N!)<(N+1)\ln(N+1)-N.$$ Hence show that $$|\ln N!-N\ln N+N|<\ln\left(1+\frac1N\right)^N+\ln(1+N).$$
My attempt:
Let $A_1$ and $A_2$ be the areas under the curves $y = \ln x$ and $y = \ln(x-1)$ over the interval $[1, N]$, where $N$ is a positive integer.
The integral of $\ln x$ from 1 to $N$ is given by: $A_1 = \int_{1}^{N} \ln x \,dx$
Similarly, the integral of $\ln(x-1)$ from 1 to $N$ is given by: $A_2 = \int_{1}^{N} \ln(x-1) \,dx$
Now, we establish the inequalities: \begin{align*} &\text{Lower Bound:} & N\ln N - N &< \ln(N!) < (N+1)\ln(N+1) - N \\ &\text{Upper Bound:} & |\ln N! - N\ln N + N| &< \ln\left(1+\frac{1}{N}\right)^N + \ln(1+N) \end{align*}
Consider the rectangle with base $[1, N]$ and height $\ln N$. The area of this rectangle is $N \ln N$. Since $\ln x < \ln(x-1)$ for $x > 1$, the area under the curve $y = \ln x$ is less than the area under $y = \ln(x-1)$ over the interval $[1, N]$. Therefore, $N \ln N < A_1 < A_2$
This implies $N\ln N < \int_{1}^{N} \ln(N) \,dx = \ln(N!)$.
Consider the rectangle with base $[1, N]$ and height $\ln(N+1)$. The area of this rectangle is $(N+1)\ln(N+1) - N$. Since $\ln(x-1) < \ln x$ for $x > 1$, the area under the curve $y = \ln(x-1)$ is less than the area under $y = \ln x$ over the interval $[1, N]$. Therefore, $A_2 < A_1 < (N+1)\ln(N+1) - N$
This implies $\ln(N!) < \int_{1}^{N} \ln(N+1) \,dx = (N+1)\ln(N+1) - N$.
Starting with the middle expression, $\ln N!$, rewrite it using Stirling's approximation: $\ln N! \approx N\ln N - N + \frac{1}{2}\ln(2\pi N)$
Substitute this into the expression and simplify: $\left| N\ln N - N + \frac{1}{2}\ln(2\pi N) - N\ln N + N \right| < \ln\left(1+\frac{1}{N}\right)^N + \ln(1+N)$
This simplifies to: $\frac{1}{2}\ln(2\pi N) < \ln\left(1+\frac{1}{N}\right)^N + \ln(1+N)$
Notice that $\ln\left(1+\frac{1}{N}\right)^N$ converges to $\ln e = 1$ as $N$ approaches infinity. Also, for large $N$, $\ln(1+N)$ is dominated by $N$. Therefore, the right side approaches $N + 1$.
Thus, we have: $\frac{1}{2}\ln(2\pi N) < N + 1$
Which is true for sufficiently large $N$. This completes the proof.