The $\Gamma$ Function
We start with the following definition for the Gamma function:
$$\Gamma(n) := \int\limits_{0}^\infty x^{n-1} e^{-x} dx$$
Behavior of the $\Gamma$ function
We can use parts once on the integral to notice a recursive pattern:
$
\begin{eqnarray}
\Gamma(n+1) & = & \int\limits_{0}^\infty x^{n} e^{-x} dx \\
& = & -x^{n} e^{-x} \bigg|_{0}^\infty + (n) \int\limits_{0}^\infty x^{n-1} e^{-x} dx \\
\Gamma(n+1) & = & n \Gamma(n)
\end{eqnarray}
$
Of course, this is the recursive relationship similar to the factorial function, $n!$.
However, noting that $n! = n (n-1)!$, it’s clear that there’s an offset of $1$ between the $\Gamma$ function and factorial function.
Clearly,
$
\begin{eqnarray}
\Gamma(1) & = & \int\limits_{0}^\infty e^{-x} dx & = & 1 & = & 0! \\
\Gamma(2) & = & 1 * \Gamma(1) & = & 1 & = & 1!
\end{eqnarray}
$
So,
$$\Gamma(n) = (n-1)!$$
The $\Gamma$ Function as an Infinite Product
$
\begin{eqnarray}
\frac{1}{\Gamma(x)} & = & \frac{(n+x)(n+x-1)\cdots(x)}{n!} \\
& = & \lim\limits_{n \rightarrow \infty} \frac{(n+x)(n+x-1)\cdots(x)}{n! n^x} \\
& = & \lim\limits_{n \rightarrow \infty} n^{-x} \frac{n+x}{n} \frac{n-1+x}{n-1} \cdots \frac{x+1}{1} x \\
& = & \lim\limits_{n \rightarrow \infty} n^{-x} \left(1+\frac{x}{n}\right) \left(1+\frac{x}{n+1}\right) \cdots \left(1+x\right) x \\
& = & \lim\limits_{n \rightarrow \infty} e^{-x \ln n} x \prod\limits_{k=1}^n \left(1+\frac{x}{k}\right) e^{-\frac{x}{k}} e^{\frac{x}{k}} \\
& = & \lim\limits_{n \rightarrow \infty} e^{-x \ln n} e^{x\left(\frac{1}{1} + \frac{1}{2} + \frac{1}{3} + \cdots + \frac{1}{n}\right)} x \prod\limits_{k=1}^n \left(1+\frac{x}{k}\right) e^{-\frac{x}{k}} \\
& = & \lim\limits_{n \rightarrow \infty} e^{x\left(\sum\limits_{i=1}^n \frac{1}{i} – \ln n \right)} x \prod\limits_{k=1}^n \left(1+\frac{x}{k}\right) e^{-\frac{x}{k}} \\
& = & x e^{\gamma x} \prod\limits_{k=1}^\infty \left(1+\frac{x}{k}\right) e^{-\frac{x}{k}} \\
\end{eqnarray}
$
Identities of the $\Gamma$ Function
We already know:
$$\Gamma(x+1) = x \Gamma(x)$$
In addition, consider:
$
\begin{eqnarray}
\frac{1}{\Gamma(x)\Gamma(-x)} & = & x (-x) e^{\gamma x} e^{-\gamma x} \prod\limits_{k=1}^\infty \left(1 – \frac{x^2}{k^2}\right) e^{-\frac{x}{k}} e^{\frac{x}{k}} \\
& = & -x^2 \prod\limits_{k=1}^\infty \left(1 – \frac{x^2}{k^2}\right) \\
& = & -x^2 \frac{\sin \pi x}{\pi x} \\
\frac{1}{\Gamma(x) (-x) \Gamma(-x)} & = & \frac{\sin \pi x}{\pi} \\
\Gamma(x) \Gamma(1-x) & = & \frac{\pi}{\sin(\pi x)}
\end{eqnarray}
$
Example: $\Gamma\left(\frac{1}{2}\right)$
Let $x = \frac{1}{2}$. Then:
$
\begin{eqnarray}
\Gamma(x) \Gamma(1-x) & = & \frac{\pi}{\sin(\pi x)} \\
\Gamma\left(\frac{1}{2}\right) \Gamma\left(\frac{1}{2}\right) & = & \frac{\pi}{\sin\left(\frac{\pi}{2}\right)} \\
\Gamma^2\left(\frac{1}{2}\right) & = & \pi \\
\Gamma\left(\frac{1}{2}\right) & = & \sqrt{\pi} \\
\end{eqnarray}
$
$\Gamma(1+\epsilon)$ Expansion
$
\begin{eqnarray}
\Gamma(1+\epsilon) & = & \epsilon \Gamma(\epsilon) \\
& = & \epsilon \frac{1}{\epsilon} e^{-\gamma \epsilon} \prod\limits_{k=1}^\infty \left(1+\frac{\epsilon}{k}\right)^{-1} e^{\frac{\epsilon}{k}} \\
\ln(\Gamma(1+\epsilon)) & = & -\gamma \epsilon + \sum\limits_{k=1}^\infty \left[\frac{\epsilon}{k} – \ln\left(1+\frac{\epsilon}{k}\right) \right] \\
& = & -\gamma \epsilon + \sum\limits_{k=1}^\infty \left[\frac{\epsilon}{k} – \sum\limits_{n=1}^\infty \frac{(-1)^{n+1} \epsilon^n}{n k^n} \right] \\
& = & -\gamma \epsilon + \sum\limits_{k=1}^\infty \left[\sum\limits_{n=2}^\infty \frac{(-1)^n \epsilon^n}{n k^n} \right] \\
& = & -\gamma \epsilon + \sum\limits_{n=2}^\infty \sum\limits_{k=1}^\infty \frac{(-1)^n \epsilon^n}{n k^n} \\
& = & -\gamma \epsilon + \sum\limits_{n=2}^\infty \frac{(-1)^n \epsilon^n}{n} \zeta(n) \\
\Gamma(1+\epsilon) & = & e^{-\gamma \epsilon + \sum\limits_{n=2}^\infty \frac{(-1)^n \epsilon^n}{n} \zeta(n)} \\
\end{eqnarray}
$
Finally, use the Taylor expansion of $e^x$:
$$\Gamma(1+\epsilon) = \sum\limits_{j=0}^\infty \frac{1}{j!} \left[ -\gamma \epsilon + \sum\limits_{n=2}^\infty \frac{(-1)^n \epsilon^n}{n} \zeta(n) \right]^j$$
Example: $\int\limits_{0}^\infty \ln x e^{-x} dx$
$
\begin{eqnarray}
\int\limits_{0}^\infty x^\epsilon e^{-x} dx & = & \int\limits_{0}^\infty x^{\epsilon \ln x} e^{-x} dx \\
& = & \sum\limits_{k=0}^\infty \frac{\epsilon^k}{k!} \int\limits_0^\infty \ln^k x e^{-x} dx \\
& = & \Gamma(1+\epsilon)
\end{eqnarray}
$Then $\int\limits_{0}^\infty \ln x e^{-x} dx$ is the coefficient of the $\epsilon$ term in the expansion of $\Gamma(1+\epsilon)$.
$$\int\limits_{0}^\infty \ln x e^{-x} dx = -\gamma$$