Skip to content

Instantly share code, notes, and snippets.

@md2perpe
Created April 19, 2026 08:05
Show Gist options
  • Select an option

  • Save md2perpe/3c9d1b8a990806ceb161f0999f0aedfc to your computer and use it in GitHub Desktop.

Select an option

Save md2perpe/3c9d1b8a990806ceb161f0999f0aedfc to your computer and use it in GitHub Desktop.
Beta function and Gamma functions
The Gamma function is defined by
$\Gamma(x) := \int_0^\infty t^{x-1} e^{-t} \, dt.$
Using induction and integration by parts it is easy to show that $\Gamma(n)=(n-1)!$ for $n=1,2,3,\ldots$
Now,
$$
\Gamma(x) \Gamma(y)
= \left(\int_0^\infty s^{x-1} e^{-s} \, ds \right)
\left(\int_0^\infty t^{y-1} e^{-t} \, dt \right)
= \int_0^\infty \int_0^\infty s^{x-1} t^{y-1} e^{-(s+t)} \, ds \, dt.
$$
Changing coordinates from $(s,t)$ to $(u,v)=(s+t,s)$ this turns into
$$
\int_0^\infty \int_0^u v^{x-1} (u-v)^{y-1} e^{-u} \, dv \, du
= \int_0^\infty e^{-u} \int_0^u v^{x-1} (u-v)^{y-1} \, dv \, du.
$$
The inner integral can be simplified by setting $v=uq$:
$$
\int_0^u v^{x-1} (u-v)^{y-1} \, dv
= \int_0^1 (uq)^{x-1} (u-uq)^{y-1} \, u\,dq
= u^{x+y-1} \int_0^1 q^{x-1} (1-q)^{y-1} \, dq
= u^{x+y-1} B(x,y),
$$
where $B(x,y):= \int_0^1 q^{x-1} (1-q)^{y-1} \, dq$ is the Beta function.
Thus,
$$
\Gamma(x) \Gamma(y)
= \int_0^\infty e^{-u} u^{x+y-1} B(x,y) \, du
= B(x,y) \int_0^\infty u^{x+y-1} e^{-u} \, du
= B(x,y) \Gamma(x+y)
$$
so
$$
\int_0^1 q^{x-1} (1-q)^{y-1} \, dq
= B(x,y)
= \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}.
$$
For $m,n=1,2,3,\ldots$ we get
$$
\int_0^1 q^{m} (1-q)^{n} \, dq
= \frac{\Gamma(m+1)\Gamma(n+1)}{\Gamma((m+1)+(n+1))}
= \frac{m!\,n!}{(m+n+1)!}.
$$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment