Chapter 8 Some Special Functions
- Part A: Exercise 1 – Exercise 12
- Part B: Exercise 13 – Exercise 20
- Part C: Exercise 21 – Exercise 31
Exercise 13
(By analambanomenos) The Fourier coefficients for $f$ are (letting $n\ne 0$ and using $e^{i2\pi n}=1$)
\begin{align*}
c_0 &= \frac{1}{2\pi}\int_0^{2\pi}x\,dx \\
&= \frac{1}{2\pi}\bigg(\frac{(2\pi)^2-0}{2}\bigg) \\
&= \pi \\
c_n &= \frac{1}{2\pi}\int_0^{2\pi}xe^{-inx}\,dx \\
&= \frac{1}{2\pi}\bigg(\frac{2\pi}{-in}-0\bigg)-\frac{1}{2\pi}\cdot\frac{1}{-in}\int_0^{2\pi}e^{-inx}\,dx \\
&= -\frac{1}{in}+\frac{1}{2\pi in}\cdot\frac{1-1}{-in} \\
&= \frac{i}{n}.
\end{align*}Hence by Parseval’s theorem
\begin{align*}
\sum_{-\infty}^\infty|c_n|^2 &= \frac{1}{2\pi}\int_0^{2\pi}x^2\,dx \\
\pi^2 + 2\sum_1^\infty\frac{1}{n^2} &= \frac{4\pi^2}{3} \\
\sum_1^\infty\frac{1}{n^2} &= \frac{1}{2}\bigg(\frac{4\pi^2}{3}-\pi^2\bigg) = \frac{\pi^2}{6}
\end{align*}
Exercise 14
(By analambanomenos) The maximum local rate of change of $f$ will occur at the multiples of $2\pi$, where $\lim|f’|=2\pi$. Hence $f$ satisfies the condition of Theorem 8.14 with constant $M=2\pi$, so we can conclude that the Fourier series of $f$ converges to $f(x)$ for all $x$.
Here are the Fourier coefficients of $f$ (where $n\ne 0$, and using $e^{in\pi}=e^{-in\pi}$ for all integers $n$):
\begin{align*}
c_0 &= \frac{1}{2\pi}\int_{-\pi}^0(\pi+x)^2\,dx+\frac{1}{2\pi}\int_0^\pi(\pi-x)^2\,dx \\
&= \frac{1}{2\pi}\bigg(\frac{\pi^3}{3}+\frac{\pi^3}{3}\bigg) \\
&= \frac{\pi^2}{3} \\
c_n &= \frac{1}{2\pi}\int_{-\pi}^0(\pi^2+2\pi x+x^2)e^{-inx}\,dx+\frac{1}{2\pi}\int_0^\pi(\pi^2-2\pi x+x^2)e^{-inx}\,dx \\
&= \frac{1}{2\pi}\int_{-\pi}^\pi(\pi^2+x^2)e^{-inx}\,dx+\int_{-\pi}^0xe^{-inx}\,dx-\int_0^\pi xe^{-inx}\,dx \\
\end{align*} \begin{align*}
\frac{1}{2\pi}\int_{-\pi}^\pi(\pi^2+x^2)e^{-inx}\,dx &= \frac{1}{2\pi}\cdot\frac{i}{n}(2\pi^2e^{-in\pi}-2\pi^2e^{in\pi})-\frac{1}{2\pi}\cdot\frac{2i}{n}\int_{-\pi}^\pi xe^{-inx}\,dx \\
&= 0-\frac{i}{\pi n}\cdot\frac{i}{n}(\pi e^{-in\pi}+\pi e^{in\pi})+\frac{i}{\pi n}\cdot\frac{i}{n}\int_{-\pi}^\pi e^{-inx}\,dx \\
&= \frac{1}{n^2}(e^{-in\pi}+e^{in\pi})-\frac{i}{\pi n^2}(e^{-in\pi}-e^{in\pi}) \\
&= \frac{1}{n^2}(e^{-in\pi}+e^{in\pi}) \\
\end{align*} \begin{align*}
\int_{-\pi}^0 xe^{-inx}\,dx &= \frac{i}{n}(0e^0+\pi e^{in\pi})-\frac{i}{n}\int_{-\pi}^0 e^{-inx}\,dx \\
&= \frac{i\pi}{n}e^{in\pi}-\frac{i}{n}\cdot\frac{i}{n}(e^0-e^{in\pi}) \\
&= \frac{i\pi}{n}e^{in\pi}+\frac{1}{n^2}(1-e^{in\pi}) \\
\end{align*} \begin{align*}
\int_0^\pi xe^{-inx}\,dx &= \frac{i}{n}(\pi e^{-in\pi}-0e^0)-\frac{i}{n}\int_0^\pi e^{-inx}\,dx \\
&= \frac{i\pi}{n}e^{-in\pi}-\frac{i}{n}\cdot\frac{i}{n}(e^{-in\pi}-e^0) \\
&= \frac{i\pi}{n}e^{-in\pi}+\frac{1}{n^2}(e^{-in\pi}-1) \\
\end{align*} $$c_n=\frac{1}{n^2}(e^{-in\pi}+e^{in\pi})+\frac{i\pi}{n}e^{in\pi}+\frac{1}{n^2}(1-e^{in\pi})-\frac{i\pi}{n}e^{-in\pi}-\frac{1}{n^2}(e^{-in\pi}-1)=\frac{2}{n^2}$$ Hence
\begin{align*}
f(x) &= \frac{\pi^2}{3}+\sum_{|n|\ne 0}\frac{2}{n^2}e^{inx} \\
&= \frac{\pi^2}{3}+\sum_{n=1}^\infty\frac{2}{n^2}(e^{inx}+e^{-inx}) \\
&= \frac{\pi^2}{3}+\sum_{n=1}^\infty\frac{4}{n^2}\cos nx
\end{align*}Letting $n=0$, we get
\begin{align*}
\frac{\pi^2}{3}+4\sum_{n=1}^\infty\frac{1}{n^2} &= \pi^2 \\
\sum_{n=1}^\infty\frac{1}{n^2} &= \frac{\pi^2}{6}
\end{align*}And by Parseval’s theorem, we get
\begin{align*}
\frac{\pi^4}{9}+2\sum_{n=1}^\infty\frac{4}{n^4} &= \frac{1}{2\pi}\int_{-\pi}^0(\pi+x)^4\,dx+\frac{1}{2\pi}\int_0^\pi(\pi-x)^4\,dx \\
\frac{\pi^4}{9}+8\sum_{n=1}^\infty\frac{1}{n^4} &= \frac{1}{2\pi}\cdot\frac{1}{5}(\pi^5+\pi^5) \\
\sum_{n=1}^\infty\frac{1}{n^4} &= \frac{1}{8}\bigg(\frac{\pi^4}{5}-\frac{\pi^4}{9}\bigg) \\
\sum_{n=1}^\infty\frac{1}{n^4} &= \frac{\pi^4}{90}
\end{align*}
Exercise 15
(By analambanomenos) We want to show that $$\sum_{n=0}^ND_n(x)=\frac{1-\cos(N+1)x}{1-\cos x}.$$ I’ll show this by induction. It is true for the case $N=0$ since both sides equal 1, so assume that
$$\sum_{n=0}^{N-1}D_n(x)=\frac{1-\cos Nx}{1-\cos x}.$$ Then we have
\begin{align*}
(1-\cos x)\sum_{n=0}^ND_n(x) &= (1-\cos x)\sum_{n=0}^{N-1}D_n(x) + (1-\cos x)D_N(x) \\
&= (1-\cos Nx)+\frac{(1-\cos x)\sin(N+1/2)x}{\sin(x/2)} \\
&= (1-\cos Nx)+\frac{2\sin^2(x/2)\sin(N+1/2)x}{\sin(x/2)} \\
&= (1-\cos Nx)+2\sin(x/2)\sin(N+1/2)x \\
&= (1-\cos Nx)+\big(\cos Nx-\cos(N+1)x\big) \\
&= 1-\cos(N+1)x
\end{align*}Dividing both sides by $(1-\cos x)$ gives the desired result.
(a) Since $\cos x\le 1$ for all $x$, we have $1-\cos(N+1)x\ge 0$ and $1-\cos x\ge 0$, hence $K_N(x)\ge 0$.
(b) For $n\ne 0$, $$\int_{-\pi}^\pi e^{inx}\,dx=\frac{1}{in}(e^{in\pi}-e^{-in\pi})=0$$ since $e^{in\pi}=e^{-in\pi}$ for all all integers $n$. Hence $$\frac{1}{2\pi}\int_{-\pi}^\pi
D_N(x)\,dx=\frac{1}{2\pi}\int_{-\pi}^\pi e^0\,dx=1,$$ and so $$\frac{1}{2\pi}\int_{-\pi}^\pi K_N(x)\,dx=\frac{1}{N+1}\sum_{n=0}^N\frac{1}{2\pi}\int_{-\pi}^\pi D_n(x)\,dx=\frac{1}{N+1}(N+1)=1.$$
(c) Since $1-\cos x$ monotonically decreases from 2 to 0 on $[-\pi,0]$ and monotonically increases from 0 to 2 on $[0,\pi]$, we have $1-\cos x\ge1-\cos\delta$ on $[-\pi,-\delta]\cup[\delta,\pi]$. Also, the maximum value of $1-\cos(N+1)x$ is 2, so $$K_N(x)=\frac{1}{N+1}\cdot\frac{1-\cos(N+1)x}{1-\cos x}\le\frac{1}{N+1}\cdot\frac{2}{1-\cos\delta}$$ for $0<\delta\le|x|\le\pi$.
By (78) in the text, we have
\begin{align*}
\sigma_N(f;x) &= \frac{1}{N+1}\sum_{n=0}^Ns_n(f;x) \\
&= \frac{1}{N+1}\sum_{n=0}^N\frac{1}{2\pi}\int_{-\pi}^\pi f(x-t)D_N(t)\,dt \\
&= \frac{1}{2\pi}\int_{-\pi}^\pi f(x-t)\Bigg(\frac{1}{N+1}\sum_{n=0}^N D_N(t)\Bigg)\,dt \\
&= \frac{1}{2\pi}\int_{-\pi}^\pi f(x-t)K_N(t)\,dt
\end{align*}Let $\varepsilon>0$. Since $f(x)$ is uniformly continuous on $[-\pi,\pi]$, there is a $\delta>0$ such that $\big|f(x-t)-f(t)\big|<\varepsilon/2$ if $|t|\le\delta$. Also, $f(x)$ has a maximum value $M$ on $[-\pi,\pi]$. Using (a), (b), and (c), we have
\begin{align*}
\big|f(x)-\sigma_N(f;x)\big| &= \Bigg|\frac{1}{2\pi}\int_{-\pi}^\pi\big(f(x)-f(x-t)\big)K_N(t)\,dt\Bigg| \\
&\le \frac{1}{2\pi}\int_{-\pi}^\pi\big|f(x)-f(x-t)\big|K_N(t)\,dt \\
&\le \frac{1}{2\pi}\int_{-\pi}^{-\delta}2M\cdot\frac{1}{N+1}\cdot\frac{2}{1-\cos\delta}\,dx + \frac{1}{2\pi}\int_{-\delta}^\delta\frac{\varepsilon}{2} K_N(t)\,dt \;+ \\
&\phantom{\le}\;\;\frac{1}{2\pi}\int_\delta^\pi 2M\cdot\frac{1}{N+1}\cdot\frac{2}{1-\cos\delta}\,dx \\
&\le \frac{4M}{N+1}\cdot\frac{1}{1-\cos\delta}+\frac{\varepsilon}{2} \\
&\le \varepsilon
\end{align*}for large enough $N$. That is, $\sigma_N(f;x)\rightarrow f(x)$ uniformly on $[-\pi,\pi]$.
Exercise 16
(By analambanomenos) Let $\varepsilon>0$ and let $\delta>0$ such that $\big|f(x-t)-f(x+)\big|<\varepsilon/2$ for $-\delta<t<0$ and $\big|f(x-t)-f(x-)\big|<\varepsilon/2$ for $0<t<\delta$. Since $$K_N(x)=\frac{1}{N+1}\cdot\frac{1-\cos(N+1)x}{1-\cos x}$$ is an even function, we have from Exercise 15(b) that $$\frac{1}{2\pi}\int_{-\pi}^0K_N(t)\,dt=\frac{1}{2\pi}\int_0^\pi K_N(t)\,dt=\frac{1}{2}.$$Hence by the results of Exercise 15,
\begin{align*}
& \bigg|\sigma_N(f;x)-\frac{f(x+)+f(x-)}{2}\bigg| \\
& \quad\quad\le\frac{1}{2\pi}\int_{-\pi}^0\big|f(x-t)-f(x+)\big|K_N(t)\,dt + \frac{1}{2\pi}\int_0^\pi\big|f(x-t)-f(x-)\big|K_N(t)\,dt \\
& \quad\quad\le\frac{1}{2\pi}\frac{1}{N+1}\frac{2}{1-\cos\delta}\Bigg(\int_{-\pi}^{-\delta}\big|f(x-t)-f(x+)\big|\,dt+\int_\delta^\pi\big|f(x-t)-f(x-)\big|\,dt\Bigg)\;+ \\
& \quad\quad\phantom{\le}\;\;\frac{\varepsilon}{2}\Bigg(\frac{1}{2\pi}\int_{-\delta}^0K_N(t)\,dt+\frac{1}{2\pi}\int_0^\delta K_N(t)\,dt\Bigg)
\end{align*}The two integrals in the first term are finite, so we can make it as small as we would like as $N\rightarrow\infty$, and the second term is less than $\varepsilon/2$. Hence $\sigma_N(f;x) \rightarrow\big(f(x+)+f(x-)\big)/2$ as $N\rightarrow\infty$.
Exercise 17
(By analambanomenos)
(a) Using Exercise 6.17, with $G(x)=(i/n)e^{-inx}$,
\begin{align*}
nc_n &= \frac{n}{2\pi}\int_{-\pi}^\pi f(x)e^{-inx}\,dx \\
&= \frac{i}{2\pi}\big(f(\pi)e^{-in\pi}-f(-\pi)e^{in\pi}\big)-\frac{i}{2\pi}\int_{-\pi}^\pi e^{-inx}\,df \\
|nc_n| &\le \frac{1}{2\pi}\big(f(\pi)-f(-\pi)\big)+\frac{1}{2\pi}\int_{-\pi}^\pi 1\,df \\
&= \frac{1}{\pi}\big(f(\pi)-f(-\pi)\big)
\end{align*}(b) Since $|nc_n|\le M=\big(f(\pi)-f(-\pi)\big)/\pi$, we can apply Exercise 3.14(e) to get $$\lim_{N\rightarrow\infty}s_N(f;x)=\lim_{N\rightarrow\infty}\sigma_N(f;x)=\frac{f(x+)+f(x-)}{2}.$$The last equality is from Exercise 16.
(c) Letting $$\tilde{f}(x)=
\begin{cases}
f(\alpha) & -\pi\le x\le\alpha \\
f(x) & \alpha\le x\le\beta \\
f(\beta) & \beta\le x\le\pi
\end{cases}$$then $\tilde{f}$ is monotonically increasing on $[-\pi,\pi]$, so by part (b) we have $$\lim_{N\rightarrow\infty}s_N(\tilde{f};x)=\frac{\tilde{f}(x+)+\tilde{f}(x-)}{2}$$ for all $-\pi\le x\le\pi$. Hence by the localization theorem, since $f(x)=\tilde{f}(x)$ for $\alpha<x<\beta$, we have $$\lim_{N\rightarrow\infty}s_N(f;x)=\lim_{N\rightarrow\infty}s_N(\tilde{f};x)=\frac{\tilde{f}(x+)+\tilde{f}(x-)}{2}=\frac{f(x+)+f(x-)}{2}$$ for $\alpha<x<\beta$.
Exercise 18
(By analambanomenos) Note that $(d/dx)\tan x=n\tan^{n-1}x+n\tan^{n+1}x$.
\begin{align*}
f(x) &= x^3-(1-\cos^2x)\tan x \\
&= x^3+2^{-1}\sin2x-\tan x \\
f’(x) &= 3x^2 +\cos2x-1-\tan^2x \\
f”(x) &= 6x-2\sin2x-2\tan x-2\tan^3x \\
f”’(x) &= 6-4\cos2x-2-8\tan^2x-6\tan^4x \\
f^{(4)}(x) &= 8\sin2x-16\tan x-40\tan^3x-24\tan^5x \\
f^{(5)}(x) &= 16\cos2x-16-136\tan^2x-240\tan^4x-120\tan^6x \\
f^{(6)}(x) &= -32\sin2x-272\tan x-1232\tan^3x-1680\tan^5x-720\tan^7x
\end{align*}Note that $f(0)=f’(0)=f”(0)=f”’(0)=f^{(4)}(0)=f^{(5)}(0)=0$. Since $f^{(6)}(x)<0$ on $(0,\pi/2)$, $f^{(5)}$ decreases monotonically throughout that interval from $f^{(5)}(0)=0$ to $f^{(5)}(\pi/2)=-\infty$, hence the same is successively true for $f^{(4)}$, $f”’$, $f”$, $f’$, and $f$.
\begin{align*}
g(x) &= 2x^2-\sin^2x-x\tan x \\
g’(x) &= 4x-\sin2x-\tan x-x(1+\tan^2x) \\
g”(x) &= 4-2\cos2x-2-2\tan^2x-x(2\tan x+2\tan^3x) \\
g”’(x) &= 4\sin2x-6\tan x-6\tan^3x-x(2+8\tan^2x+6\tan^3x) \\
g^{(4)}(x) &= 8\cos2x-8-32\tan^2x-24\tan^4x-x(16\tan x+40\tan^3x+24\tan^5x) \\
g^{(5)}(x) &= -16\sin2x-80\tan x-200\tan^3x-120\tan^5x\;-\\
&\phantom{=}\;\; x(16+136\tan^2x+240\tan^3x+120\tan^6x)
\end{align*}Note that $g(0)=g’(0)=g”(0)=g”’(0)=g^{(4)}(0)=0$. Since $g^{(5)}(x)<0$ on $(0,\pi/2)$, $g^{(4)}$ decreases monotonically throughout that interval from $g^{(4)}(0)=0$ to $g^{(4)}(\pi/2)=-\infty$, hence the same is successively true for $g”’$, $g”$, $g’$, and $g$.
Exercise 19
(By analambanomenos) Following the hint, we first show this for trigonometric polynomials. Let $$P(x)=\sum_{m=-M}^Mc_me^{imx}.$$ Then $$\frac{1}{2\pi}\int_{-\pi}^\pi P(t)\,dt=\sum_{m=-M}^Mc_m\frac{1}{2\pi}
\int_{-\pi}^\pi e^{imt}\,dt=c_0$$ and (noting that $e^{im\alpha}\ne 1$ for $m\ne 0$ since $\alpha/\pi$ is irrational)
\begin{align*}
\frac{1}{N}\sum_{n=1}^NP(x+n\alpha) &= \frac{1}{N}\sum_{n=1}^N\sum_{m=-M}^Mc_me^{im(x+n\alpha)} \\
&= \sum_{m=-M}^Mc_me^{im\alpha}\frac{1}{N}\sum_{n=1}^Ne^{(im\alpha)n} \\
&= c_0+\sum_{\genfrac{}{}{0pt}{}{m=-M}{m\ne0}}^Mc_me^{im\alpha}\frac{1}{N}\frac{e^{im\alpha}-e^{im\alpha(N+1)}}{1-e^{im\alpha}} \\
&= c_0+\sum_{\genfrac{}{}{0pt}{}{m=-M}{m\ne0}}^Mc_me^{im(x+\alpha)}\frac{1}{N}\frac{1-e^{im\alpha N}}{1-e^{im\alpha}}.
\end{align*}Since for $m\ne0$, $$\bigg|\frac{1-e^{im\alpha N}}{1-e^{im\alpha}}\bigg|\le\frac{2}{|1-e^{im\alpha}|}<\infty$$ the limit of the sum on the right-hand side above as $N\rightarrow\infty$ is 0. Hence for every $x$, $$\lim_{N\rightarrow\infty}\frac{1}{N}\sum_{n=1}^NP(x+n\alpha)=c_0=\frac{1}{2\pi}\int_{-\pi}^\pi P(t)\,dt.$$For the general case, let $\varepsilon>0$. By Theorem 8.15 there is a trigonometric polynomial $P$ such that $\big|P(x)-f(x)\big|<\varepsilon/3$ for all real $x$. By the result above, there is a positive integer $N_0$ such that for all $N\ge N_0$ $$\Bigg|\frac{1}{N}\sum_{n=1}^NP(x+n\alpha)-\frac{1}{2\pi}\int_{-\pi}^\pi P(t)\,dt\Bigg|\le\frac{\varepsilon}{3}.$$ Hence
\begin{align*}
& \Bigg|\frac{1}{N}\sum_{n=1}^Nf(x+n\alpha)-\frac{1}{2\pi}\int_{-\pi}^\pi f(t)\,dt\Bigg| \\
& \qquad\le \frac{1}{N}\sum_{n=1}^N\big|f(x+n\alpha)-P(x+n\alpha)\big| + \Bigg|\frac{1}{N}\sum_{n=1}^NP(x+n\alpha)-\frac{1}{2\pi}\int_{-\pi}^\pi P(t)\,dt\Bigg|\;+ \\
& \qquad\phantom{\le}\;\frac{1}{2\pi}\int_{-\pi}^\pi\big|P(t)-f(t)\big|\,dt \\
& \qquad\le \frac{1}{N}\bigg(\frac{N\varepsilon}{3}\bigg)+\frac{\varepsilon}{3}+\frac{1}{2\pi}\bigg(\frac{2\pi\varepsilon}{3}\bigg) \\
& \qquad= \varepsilon
\end{align*}
Exercise 20
(By analambanomenos) The second derivative of $\log x$ is $-x^{-2}$, which is negative for $x>0$, so $\log x$ is a “concave” function (i.e., $-\log x$ is convex). The function $f(x)$ is a continuous, piecewise-linear function whose values at the endpoints of the linear segments, $f(m)$ for $m=1,2,\ldots,$ equal $\log m$, hence $f(x)\le\log x$ by the concavity of $\log x$. Also, $g(x)$ is a continuous, piecewise-linear function which is equal to $\log m$ at $m=1,2,\ldots,$ and the slope of $g(x)$ is equal to the derivative of $\log x$ at those points. That is, the linear segments of $g(x)$ are tangent to $\log x$ at those points, and so $\log x\le g(x)$, also by the concavity of the $\log x$.
\begin{align*}
\int_1^nf(x)\,dx &= \sum_{m=1}^{n-1}\int_m^{m+1}(m+1-x)\log m+(x-m)\log(m+1)\,dx \\
&= \sum_{m=1}^{n-1}\big(-\textstyle\frac{1}{2}(m+1-x)^2\log m+\frac{1}{2}(x-m)^2\log(m+1)\big)\big|_{x=m}^{x=m+1} \\
&= \textstyle\frac{1}{2}\log 1+\displaystyle\sum_{m=1}^{n-1}(\log m)+\textstyle\frac{1}{2}\log n \\
&= \log n!-\textstyle\frac{1}{2}\log n \\
\int_1^ng(x)\,dx &= \int_1^{\frac{3}{2}}(x-1+\log 2)\,dx+\sum_{m=2}^{n-1}\int_{m-\frac{1}{2}}^{m+\frac{1}{2}}\bigg(\frac{x}{m}-1+\log m\bigg)\,dx+\int_{n-\frac{1}{2}}^n
\bigg(\frac{x}{n}-1+\log n\bigg)\,dx \\
&= \textstyle\frac{1}{2}(x-1)^2\big|_{x=1}^{x=\frac{3}{2}}+\displaystyle\sum_{m=2}^{n-1}\textstyle\big(\frac{1}{2m}x^2-x+x\log m\big)\big|_{x=m-\frac{1}{2}}^{x=m+\frac{1}{2}}+
\big(\frac{1}{2n}x^2-x+x\log n\big)\big|_{x=n-\frac{1}{2}}^{x=n} \\
&= \textstyle\frac{1}{8}+\displaystyle\sum_{m=2}^{n-1}\big(1-1+\log m)+\big(\textstyle\frac{1}{2}-\frac{1}{8n}-\frac{1}{2}+\frac{1}{2}\log n\big) \\
&= \log n!-\textstyle\frac{1}{2}\log n +\frac{1}{8}\big(1-\frac{1}{n}\big) \\
&< \int_1^nf(x)\,dx+\textstyle\frac{1}{8}
\end{align*} Integrating by parts, we have $\int_1^n\log x\,dx=n\log n-1\log1-\int_1^n1\,dx=n\log n-n+1$. Hence
\begin{gather*}
-\int_1^ng(x)\,dx<-\int_1^n\log x\,dx<-\int_1^nf(x)\,dx \\
-\log n!+\textstyle\frac{1}{2}\log n-\frac{1}{8}<-n\log n+n-1<-\log n!+\frac{1}{2}\log n
\end{gather*} Adding $1+\log n!-\frac{1}{2}\log n$ to all sides, we get $$\textstyle\frac{7}{8}<\log n!-\big(n+\frac{1}{2}\big)\log n+n<1.$$And applying $\exp$ to all sides, we get
\begin{gather*}
e^{7/8}<\frac{\exp\big(\log n!\big)\exp(n)}{\exp\big(\log(n^{n+1/2})\big)}<e \\
e^{7/8}<\frac{n!e^n}{n^n\sqrt{n}}<e \\
e^{7/8}<\frac{n!}{(n/e)^n\sqrt{n}}<e
\end{gather*}