When calculating integrals, why replacing factorials with $\Gamma$ so often works? There are lots of definite integrals that depend on a parameter $n \in \mathbb N$ and whose result contains factorials of $n$ or some simple functions of it. For instance,
$$ \int\limits_{-\infty}^\infty \frac{\mathrm{d} x}{(1+x^2)^n} = \pi \frac{(2n-2)!}{2^{2n-2} [(n-1)!]^2} \qquad (n \in \mathbb N),$$
but there are loads and loads of similar ones.
Now let's say we allow $n$ to be a real number instead of a natural number. It looks like that in most of those cases, it's enough to replace the factorials with gamma functions, giving generalizations like
$$ \int\limits_{-\infty}^\infty \frac{\mathrm{d} x}{(1+x^2)^\alpha} = \pi \frac{\Gamma(2\alpha-1)}{2^{2\alpha-2} \Gamma(\alpha)^2} \qquad (\alpha \in \mathbb R),$$
and a quick numeric integration for a couple of $\alpha$ shows that this could be correct. And if it works, then it will work for complex $\alpha$ as well.
The question(s):


*

*Why this works so often? Obviously the integral should depend on $\alpha$ continuously, so it makes sense to replace the factorial with some function that extends it continuously. However there are many of those. What's so special about $\Gamma$ that those integrals seem to generalize only to expressions with $\Gamma$ and not with any other possible factorial extension? I know that $\Gamma$ is the only factorial extension that is log-convex, but I can't see how it connects to this.

*Would anybody be able to show a counterexample where this simple replacement with $\Gamma$'s fails? Is there any theorem that would give conditions for this to work?
Thanks!
 A: One possible way to prove such extensions is by using the following theorem of Carlson: If $f(z)$ is holomorphic in the sector $|\arg z|\leq \alpha$ with $\alpha\geq \frac{\pi}{2}$, $|f(z)|=\mathcal{O}(e^{c|z|})$ with some $c < \pi$ in this sector, and if $f(n) = 0$ when $n = 1, 2, 3,\ldots$, then $f(z) \equiv  0$.
For more on this theorem, see G. H. Hardy, On two theorems of F. Carlson and S. Wigert, Acta Math. 42 (1920), pp. 327–339.
In your example, let
$$
f(z)=\int_{ - \infty }^{ + \infty } {\frac{{dx}}{{(1 + x^2 )^{z + 1} }}}  - \pi \frac{{\Gamma (2z + 1)}}{{2^{2z} \Gamma (z + 1)^2 }},\quad \Re z \ge 0.
$$
Now
$$
\left| {\int_{ - \infty }^{ + \infty } {\frac{{dx}}{{(1 + x^2 )^{z + 1} }}} } \right| \le \int_{ - \infty }^{ + \infty } {\frac{{dx}}{{(1 + x^2 )^{\Re z + 1} }}}  \le \int_{ - \infty }^{ + \infty } {\frac{{dx}}{{1 + x^2 }}}  = \pi ,
$$
and, by Stirling's formula,
$$
\pi \frac{{\Gamma (2z + 1)}}{{2^{2z} \Gamma (z + 1)^2 }} = \sqrt {\frac{\pi }{z}} \left( {1 + \mathcal{O}\!\left( {\frac{1}{z}} \right)} \right).
$$
Thus, $|f(z)|=\mathcal{O}(1)$ for $\Re z\geq 0$. As you noted, $f(n)=0$ for $n = 1, 2, 3,\ldots$. Thus, by Carlson's theorem, $f(z)$ is identically zero. Accordingly,
$$
\int_{ - \infty }^{ + \infty } {\frac{{dx}}{{(1 + x^2 )^{z + 1} }}} = \pi \frac{{\Gamma (2z + 1)}}{{2^{2z} \Gamma (z + 1)^2 }},
$$
for $\Re z \ge 0$. Now, you may use analytic continuation to extend this identity to the larger region $\Re z >-\frac{1}{2}$.
A: It boils down to why factorials arise in the context, the gamma function uses a very clever trick to make a recurrence relation work outside of it’s normal habitat. $$\Gamma(z+1)=z\Gamma(z)$$
$$\Gamma(1)=1$$
From those two alone we just get that $$\Gamma(n)=(n-1)!$$
the full gamma function uses a clever trick to make this much less “recursive”, if we take repeated derivatives of $x^n$ we get a pretty clear pattern.
$$
\begin{matrix}
    1 & 0\\
    x & 1& 0\\
    x^2& 2x& 2 & 0\\
    x^3&3x^2&6x&6&0\\
    x^4&4x^3&12x^2&24x&24&0\\
    \end{matrix}
$$
Before every 0 comes (n-1)!
But how to use this for an integral?
Simple, use integration by parts to lock it until all x’s got derivativated to continue.
$$\Gamma(z)=\int^\infty_0x^{z-1}e^{-x}dx $$
The bounds are to make the UV term of integration by parts 0 and the -x to make the integral part positive and not negative.
Back to the question, it works because most problems who get a factorial get it because of a reduction formula, recurrence relation, which $\Gamma$ extends very well.
Like that every time $\pi$ shows up there is a hidden circle, every time $\Gamma$ or ! Show up there is a hidden recurrence relation.
In your case:
Recurrence relation for the integral, $ I_n=\int\frac{dx}{(1+x^2)^n} $.
(The indefinite case).
most recurrence relations are of the form:
$$I_{n+1}=I_nP(n)R(x),I_0=k$$
where P and R are rational functions.
or similar that can be transformed or build out of functions in the form.
by scaling all terms by k we can get it simplified.
we can split it into two parts:$$I_n=I^1_{n-1}I^2_{n-1}$$
1.$I^1_n=R(x)I^1_{n-1}$ which is simply $I^1_n=R(x)^n$ and extended to $I^1_n=R(x)^a$.
2.$I^1_n=P(n)I^1_{n-1}$ this one is a little more complicated.
$$P(n)=a\frac{\overbrace{(n+b_1)(n+b_2)(n+b_3)...}^{P_1(n)}}{\underbrace{(n+c_1)(n+c_2)(n+c_3)...}_{P_2(n)}}$$
$$I^1_n=a^n \frac{I^{1_1}_n}{I^{1_2}_n}$$
simplifying the problem to solving: $k_n=k_{n-1}T(n)$ for some polynomial T.
all polynomials are factorable on $C$ so $T(n)=(n+t_1)(n+t_2)...$
splitting $k_n$ to $k^1_nk^2_n...$ one for every factor we narrow the problem to extending: $m_n=m_{n-1}(n+r)$.
when finding what integral would give such a recurrence relation we can use integration by parts:
$$\int^b_au'vdx=uv^b_a-\int^b_auv'dx$$
we want the right to be the integral for n-1 times (n+r) so we need $uv^b_a=0$ it's logical to choose the bounds to be 0 and $\infty$ to match gamma and choosing $v=e^{-x}$ to make the sign positive.
$$\int^{\infty}_0ue^{-x}dx=u(0) + \int^{\infty}_0u'e^{-x}dx$$
the u satisfying the requirements is $u=x^{r+a}$
thus, our integral for it is $$\int^{\infty}_0x^{a+r}e^{-x}dx = \Gamma(a+r)$$
To sum up, most recurrence relations involving factorial can be broken down into a form that can be broken down into a form that can be broken down into a form that can be broken down into Gamma functions.
even yours, if you do a little transforming.
2. Probably not in a non-trivial way, it seems to me like factorial will never arise out of an integral not already containing it unless it’s a recurrence relation, in which case, $\Gamma$ will most likely extend it.
