# Proving Stirling formula for complex variable

I am currently reading some Quantum mechanics book which has used Stirling's approximation for complex variables. Could anyone proof me how can Stirling formula be generalized to the complex variable? It has mentioned that in the vicinity of saddle point it can be shown. Any answer is highly appreciated.

In equation $(6)$ of this answer, it is shown that, for non-negative $n\in\mathbb{Z}$, \begin{align} \log(n!) &=\int_0^{n+1/2}\log(x)\,\mathrm{d}x+\tfrac12\log(2\pi)+\sum_{k=n+1}^\infty \int_0^{1/2}\log\left(1-\frac{t^2}{k^2}\right)\,\mathrm{d}t\\ &=\int_0^{n+1/2}\log(x)\,\mathrm{d}x+\tfrac12\log(2\pi)+\sum_{k=1}^\infty \int_0^{1/2}\log\left(1-\frac{t^2}{(n+k)^2}\right)\,\mathrm{d}t\tag{1} \end{align} All we need to show that $(1)$ extends to $\log(\Gamma(n+1))$ on the reals is to show that the right hand side is convex. Take the second derivative with respect to $n$: \begin{align} &\frac1{n+\frac12}+\sum_{k=n+1}^\infty\int_0^{1/2}\frac{-6k^2t^2+2t^4}{\left(k^3-kt^2\right)^2}\,\mathrm{d}t\\ &\ge\frac1{n+\frac12}+\sum_{k=n+1}^\infty\int_0^{1/2}\frac{-6t^2}{\left(k^2-\frac14\right)^2}\,\mathrm{d}t\\ &=\frac1{n+\frac12}-\sum_{k=n+1}^\infty\frac1{4\left(k^2-\frac14\right)^2}\\ &=\frac1{n+\frac12}-\sum_{k=n+1}^\infty\left[\frac1{2k+1}-\frac1{2k-1}+\frac1{(2k+1)^2}+\frac1{(2k-1)^2}\right]\\ &=\frac3{2n+1}-\frac1{(2n+1)^2}-\sum_{k=n+1}^\infty\frac2{(2k+1)^2}\\ &\ge\frac3{2n+1}-\frac1{(2n+1)^2}-\sum_{k=n+1}^\infty\frac2{(2k+1)(2k-1)}\\ &=\frac3{2n+1}-\frac1{(2n+1)^2}-\sum_{k=n+1}^\infty\left[\frac1{2k-1}-\frac1{2k+1}\right]\\ &=\frac2{2n+1}-\frac1{(2n+1)^2}\\[3pt] &=\frac{4n+1}{(2n+1)^2}\tag{2} \end{align} Inequality $(2)$ shows that $(1)$ defines $\log(\Gamma(n+1))$ for $n\in\mathbb{R}$. Since $(1)$ defines an analytic function, $(1)$ defines $\log(\Gamma(n+1))$ for $n\in\mathbb{C}$.
The rest of the estimates in the cited answer are valid for $\operatorname{Re}(n)\gt0$, so we get for $\operatorname{Re}(z)\gt0$, $$\Gamma(z+1)=\sqrt{2\pi z}\,\frac{z^z}{e^z}\left(1+O\!\left(\frac1{|z|}\right)\right)\tag{3}$$