Stirling's Formula, Remainder Term With reference to the Series and Product Development chapter of Ahlfors' complex analysis text (Page 201-205), after deriving Stirling's formula $\Gamma(z)=\sqrt{2\pi}z^{z-\frac{1}{2}}e^{-z}e^{J(z)}$, where $J(z)=\frac{1}{\pi}\int_{0}^{\infty}\frac{z}{\eta^2+z^2}log\frac{1}{1-e^{-2\pi\eta}}d\eta$, it is noted that the remainder $J(z)$ can be expressed as $J(z)=\frac{C_1}{z}+\frac{C_2}{z^3}+...+\frac{C_k}{z^{2k-1}}+J_k(z)$ with coefficients $C_{\nu}=(-1)^{\nu-1}\frac{1}{\pi}\int_0^{\infty}\eta^{2\nu-1}log\frac{1}{1-e^{-2\pi\eta}}d\eta$. Subsequently, it states that the coefficients $C_\nu$ are connected with the Bernoulli numbers (Asserting that this can be proved by means of residues) by $C_\nu=(-1)^{\nu-1}\frac{1}{(2\nu-1)2\nu}B_\nu$. How is the last statement proved using the calculus of residues?
Thanks in advance.
 A: This method does not use residues, but it does give an answer.
The Euler-Maclaurin Sum Formula says that
$$
\begin{align}
\sum_{k=1}^nf(k)
&=\int_0^n f(x)\,\mathrm{d}x+C+\frac12f(n)+\sum_{k=1}^m\frac{B_{2k}}{(2k)!}f^{(2k-1)}(n)+O\!\left(f^{(2m+1)}(n)\right)
\end{align}
$$
Plugging in $f(x)=\log(x)$, where $f^{(2k-1)}(n)=\frac{(2k-2)!}{n^{2k-1}}$, gives
$$
\begin{align}
\log(n!)
&=\sum_{k=1}^n\log(k)\\
&=n\log(n)-n+C+\frac12\log(n)+\sum_{k=1}^m\frac{B_{2k}}{2k(2k-1)}\frac1{n^{2k-1}}+O\!\left(\frac1{n^{2m+1}}\right)\\
\end{align}
$$
where Stirling's Approximation tells us that $C=\frac12\log(2\pi)$.
That is,
$$
\bbox[5px,border:2px solid #C0A000]{\begin{align}
J(n)
&=\sum_{k=1}^m\frac{B_{2k}}{2k(2k-1)}\frac1{n^{2k-1}}+O\!\left(\frac1{n^{2m+1}}\right)\\
&=\frac1{12n}-\frac1{360n^3}+\frac1{1260n^5}-\frac1{1680n^7}+\frac1{1188n^9}+O\left(\frac1{n^{11}}\right)
\end{align}}
$$

A Note on the Constant
Note that $C=\frac12\log(2\pi)=-\zeta'(0)$, which can be derived from the fact that the constant for the sum of $k^\alpha$ is $\zeta(-\alpha)$:
$$
\begin{align}
&\sum_{k=1}^n\frac{k^\alpha-1}{\alpha}\\
&=\frac1\alpha\left(\frac{n^{\alpha+1}}{\alpha+1}-n+\frac{n^\alpha}2+\zeta(-\alpha)+O\!\left(\alpha n^{\alpha-1}\right)\right)\\
&=\frac1\alpha\left(n\frac{1+\alpha\log(n)}{\alpha+1}-n+\frac{1+\alpha\log(n)}2+O\!\left(\alpha^2n\log(n)^2\right)+\zeta(-\alpha)+O\!\left(\alpha n^{\alpha-1}\right)\right)\\
&=\frac1\alpha\left(\vphantom{\frac12}\right.n\frac{\alpha\log(n)-\alpha}{\alpha+1}+\frac{\alpha\log(n)}2+O\!\left(\alpha^2n\log(n)^2\right)+\zeta(-\alpha)\underbrace{\ -\zeta(0)\ \ }_{\frac12}+O\!\left(\alpha n^{\alpha-1}\right)\left.\vphantom{\frac12}\right)\\
\end{align}
$$
which, upon sending $a\to0$, gives
$$
\sum_{k=1}^n\log(k)=n\log(n)-n+\frac12\log(n)\underbrace{\ -\zeta'(0)\ \ }_{\frac12\log(2\pi)}+O\!\left(n^{-1}\right)
$$
A: Using partial integration, the integral can be expressed as $$C_{\nu}=(-1)^{\nu-1}\frac{1}{\pi}\int_0^{\infty}\eta^{2\nu-2}log\frac{1}{1-e^{-2\pi\eta}}d\eta=\frac{2(-1)^{\nu-1}}{2\nu-1} \int_0^\infty \eta^{2\nu-1} (e^{2 \pi \eta}-1)^{-1} \mathrm{d} \eta .$$ As such, by using the identity $$\zeta(2\nu)\Gamma(2\nu)=\int^\infty_0\frac{x^{2\nu-1}}{e^x-1}dx,$$ which is a result in the calculus of residues ([See here] 1), the latter integral can be expressed as:$$\frac{2}{2\nu-1} \int_0^\infty \eta^{2\nu-1} (e^{2 \pi \eta}-1)^{-1} \mathrm{d} \eta=\frac{2}{2\nu-1}  \frac{(2 \nu-1)!}{(2 \pi)^{2 \nu}} \zeta(2 \nu).$$Finally, using the relation
$$\zeta(2 \nu) = \frac{(-1)^{\nu+1} B_{2 \nu} (2 \pi)^{2 \nu}}{2 (2 \nu)!},$$the result follows at once, i.e., $C_\nu=\frac{(-1)^{\nu+1}B_{2\nu}}{2\nu(2\nu-1)}$.
