Complex logarithm for Stirling's formula

Solution 1:

When $\sigma$ lies in a fixed interval and $t\to+\infty$, a convenient version of Stirling's formula (See equation 4.12.1 of Titchmarh's The theory of the Riemann zeta-function) is stated as follows:

$$ \log\Gamma(\sigma+it)=\left(\sigma+it-\frac12\right)\log(it)-it+\frac12\log2\pi+\mathcal O\left(1\over t\right) $$

Taking imaginary components on both side gives

$$ \arg\Gamma(\sigma+it)=t\log t-t+\left(\sigma-\frac12\right)\frac\pi2+\mathcal O\left(1\over t\right) $$