Value of an integral related to Stirling's formula Consider the following improper integral :
$$
I = \int_1^\infty  \left(\{t\}-\frac{1}{2}\right)\frac{dt}{t}.
$$
Comparing with Stirling's formula, we can see that $I = \ln(\sqrt{2\pi}) - 1$. Is there a more direct way to compute this ?
Edit : I have split my two questions : the other part is here.
 A: The Riemann zeta function is defined as $\zeta(s)=\sum_{n=1}^{\infty}n^{-s}.$ Writing this as a Riemann Stieltjies integral and applying integration by parts we have that $$\zeta(s)=\int_{1}^{\infty}x^{-s}d\left[x\right]=\int_{1}^{\infty}x^{-s}dx-\int_{1}^{\infty}x^{-s}d\left\{ x\right\}$$
$$=\frac{s}{s-1}-s\int_{1}^{\infty}\left\{ x\right\} x^{-s-1}dx,$$ and this holds for all $\text{Re}(s)>0.$ Notice that taking the limit as $s\rightarrow0$  yields $\zeta(0)=-\frac{1}{2}.$ Now, since $\frac{s}{2}\int_{1}^{\infty}x^{-s-1}=\frac{1}{2},$ it follows that $$\zeta(s)+\frac{1}{2}=\frac{s}{s-1}-s\int_{1}^{\infty}\left(\left\{ x\right\} -\frac{1}{2}\right)x^{-s-1}dx,$$ and so for $\text{Re}(s)>0,$  we have that $$\int_{1}^{\infty}\left(\left\{ t\right\} -\frac{1}{2}\right)t^{-s-1}dt=\frac{1}{s-1}+\frac{-\zeta(s)-\frac{1}{2}}{s}.$$ Taking the limit as $s\rightarrow0,$ and using the fact that $\zeta(0)=-\frac{1}{2},$ we find that $$\int_{1}^{\infty}\left(\left\{ t\right\} -\frac{1}{2}\right)\frac{dt}{t}=-\zeta^{'}(0)-1.$$ Since $\zeta^{'}(0)=-\frac{1}{2}\log(2\pi)$, this yields $$\int_{1}^{\infty}\left(\left\{ t\right\} -\frac{1}{2}\right)\frac{dt}{t}=\frac{1}{2}\log(2\pi)-1,$$ as desired.
Proving that $\zeta^{'}(0)=-\frac{1}{2}\log(2\pi).$
Recall the functional equation for the zeta function, $$\zeta(z)=2^{z}\pi^{z-1}\sin\left(\frac{\pi z}{2}\right)\Gamma\left(1-z\right)\zeta\left(1-z\right).$$ Taking the logarithmic derivative, we have that $$\frac{\zeta^{'}(z)}{\zeta(z)}=\log2+\log\pi-\frac{\Gamma^{'}\left(1-z\right)}{\Gamma\left(1-z\right)}+\frac{d}{dz}\log\left(\sin\left(\frac{\pi z}{2}\right)\zeta\left(1-z\right)\right).$$ Since $\zeta(1-z)=-\frac{1}{z}+\gamma+O(z),$ and $\sin\left(\frac{\pi z}{2}\right)=\frac{\pi z}{2}+O\left(z^{3}\right),$ we have that $$\sin\left(\frac{\pi z}{2}\right)\zeta\left(1-z\right)=\frac{\pi}{2}-\frac{\pi\gamma}{2}z+O\left(z^{2}\right),$$
and so $$\frac{d}{dz}\log\left(\sin\left(\frac{\pi z}{2}\right)\zeta\left(1-z\right)\right)=\frac{-\frac{\pi\gamma}{2}+O\left(z\right)}{\frac{\pi}{2}+O\left(z\right)}=-\gamma+O(z).$$ Thus $$\frac{\zeta^{'}(0)}{\zeta(0)}=\log2\pi-\Gamma^{'}\left(1\right)-\gamma.$$ As $\Gamma^{'}(1)=-\gamma,$ and $\zeta(0)=-\frac{1}{2},$ we conclude that $$\zeta^{'}(0)=-\frac{1}{2}\log2\pi.$$ 
Remark: This reminded me of my answer regarding the evaluation of $\Gamma\left(\frac{1}{2}\right).$
