So I found out about the gamma function yesterday and I spent a bunch of time trying to evaluate certain values like $0.5!=\Gamma \left(1.5\right)$. I used multiple integration by parts, and in the end I always get $0=0$. How can someone compute gamma function values for all real numbers manually? I want to evaluate the integral by hand without using previous simplified equations for certain values. Thank you.
-
Do you have some work people could look at? – Epiousios Aug 08 '17 at 16:44
-
2There's no good way for general values. At the half integers $\pi$ enters: see https://en.wikipedia.org/wiki/Gamma_function – Ethan Bolker Aug 08 '17 at 16:44
-
i dont want to use simplified functions, i want to know how to compute the integral by hand, Ethan. – David Sousa Aug 08 '17 at 16:46
-
Is this question focused on $\Gamma(3/2)$ or is it supposed to be more general? – Simply Beautiful Art Aug 08 '17 at 16:48
-
its more general, i want to figure out how to evaluate the function for all real values. – David Sousa Aug 08 '17 at 16:50
-
Have you seen the solutions for things like $\Gamma(1/4)$? – Simply Beautiful Art Aug 08 '17 at 16:52
-
And if so, you should make it more clear that you want to evaluate the Gamma function for any value. – Simply Beautiful Art Aug 08 '17 at 16:52
-
Also, to reply to someone, you need to use the @ symbol. For example, above, you wanted to ping Ethan, so you should type @EthanBolker – Simply Beautiful Art Aug 08 '17 at 16:54
-
ok @SimplyBeautifulArt – David Sousa Aug 08 '17 at 16:55
-
You will need numerical methods. See https://math.stackexchange.com/questions/19236/algorithm-to-compute-gamma-function – Ethan Bolker Aug 08 '17 at 16:57
-
i read something about using the error function, but i cant see how i can apply it here. @EthanBolker – David Sousa Aug 08 '17 at 17:01
-
@DavidSousa First use $\Gamma(3/2)=\frac12\Gamma(1/2)$. Then, in the integral definition of $\Gamma(1/2)$, make the substitution $x=t^2$ and apply the error function. – Simply Beautiful Art Aug 08 '17 at 17:02
-
ok ! thank you @SimplyBeautifulArt – David Sousa Aug 08 '17 at 17:04
-
Might I mention, if you are intending this for $\Gamma(x)$ with $x\in\mathbb Q$, including more than just $\Gamma(1/2)$, then you might want to make this more clear in you question, else it'll likely get closed as a dupe. – Simply Beautiful Art Aug 09 '17 at 00:29
-
In general, $\Gamma\left(,z,\right)$ is evaluated $\texttt{numerically}$ with $\texttt{Lanczos Formula}$ as explained in Numerical Recipes, page 257. – Felix Marin Aug 11 '17 at 00:47
1 Answers
First off, the sad truth is that there are no known closed forms of the Gamma function for irrational values.
So, if you wanted to approximate the Gamma function for irrational values, presumably by hand, you might wish to implement the following limit formula, a consequence of the Bohr-Mollerup theorem.
$$\Gamma(s)=\lim_{n\to\infty}\frac {n^s(n!)}{s^{(n+1)}}$$
Where we use the rising factorial to denote $s^{(n+1)}=s(s+1)\dots(s+n)$.
As an example,
$$\Gamma(1/2)=\lim_{n\to\infty}\frac{\sqrt n(n!)}{(1/2)^{(n+1)}}=\lim_{n\to\infty}\frac{\sqrt n(n+1)4^{n+1}(n!)^2}{(2n+2)!}$$
Approximating with $n=9$, one finds that
$$\Gamma(1/2)\approx1.70264$$
Which is pretty close to $\sqrt\pi=1.77245$.
Anyways, to the fun stuff!
It's easy to see by integration by parts that
$$\Gamma(x+1)=x\Gamma(x)$$
And thus,
$$\Gamma(3/2)=\frac12\Gamma(1/2)$$
From there, I recommend browsing through these answers.
A perhaps more useful formula might be
$$\Gamma(s)\Gamma(1-s)=\frac\pi{\sin(\pi s)}$$
A variety of proofs from the integral definition may be found from One-line proof of the Euler's reflection formula. However, this formula provides no light on how to evaluate other values, such as
$$\Gamma(1/3)=\frac{\pi^{2/3}2^{2/3}}{3^{1/12}\operatorname{agm}(1,3^{1/4}2^{-1/2})^{1/2}}$$
$$\Gamma(1/4)=\frac{2^{1/2}\pi^{3/4}}{\operatorname{agm}(1,2^{-1/2})}$$
where $\operatorname{agm}$ is the arithmetic-geometric mean defined by
$$\operatorname{agm}(x,y)=\lim_{n\to\infty}a_n\\a_0=x,~g_0=y\\a_{n+1}=\frac{a_n+g_n}2,\quad g_n=\sqrt{a_ng_n}$$
This is the closest thing to a closed form one can provide for rational values that are not halves of integers.
Portions on how to find values at such values are given in this PDF.
To find the values of $\Gamma(1/2)$ and $\Gamma(1/4)$, note that
$$\frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}=\int_0^1t^{x-1}(1-t)^{y-1}~\mathrm dt$$
Setting $x=y=\frac12$, we find that
$$\Gamma(1/2)^2=\int_0^1t^{-1/2}(1-t)^{-1/2}~\mathrm dt$$
Let $t=u^2$ to get
$$\Gamma(1/2)^2=2\int_0^1\frac{\mathrm du}{\sqrt{1-u^2}}$$
This may be solved either geometrically (consider the arc length formula applied to a circle) or with a trig substitution, and it ultimately yields
$$\Gamma(1/2)^2=\pi\\\Gamma(1/2)=\sqrt\pi$$
For $\Gamma(1/4)$, let $2x=y=\frac12$ to get
$$\frac{\Gamma(1/4)}{\Gamma(3/4)}\sqrt\pi=\int_0^1t^{-3/4}(1-t)^{-1/2}~\mathrm dt$$
Let $t=u^4$ to get
$$\frac{\Gamma(1/4)}{\Gamma(3/4)}\sqrt\pi=4\int_0^1\frac{\mathrm du}{\sqrt{1-u^4}}$$
This is a complete elliptic integral, which gives
$$\frac{\Gamma(1/4)}{\Gamma(3/4)}\sqrt\pi=4\mathrm K(i)=\frac{2\pi}{\operatorname{agm}(1,\sqrt2)}$$
Applying the reflection formula,
$$\Gamma(3/4)=\frac\pi{\sin(\pi/4)\Gamma(1/4)}=\frac{\pi\sqrt2}{\Gamma(1/4)}$$
$$\Gamma(1/4)^2=\frac{2^{3/2}\pi^{3/2}}{\operatorname{agm}(1,\sqrt2)}$$
$$\Gamma(1/4)=\frac{2^{3/4}\pi^{3/4}}{\operatorname{agm}(1,\sqrt2)^{1/2}}$$
By useing $\operatorname{agm}(ax,ay)=a\operatorname{agm}(x,y)=a\operatorname{agm}(y,x)$, the above may be rewritten as
$$\Gamma(1/4)=\frac{2^{1/2}\pi^{3/4}}{\operatorname{agm}(1,2^{-1/2})^{1/2}}$$

- 74,685
-
Thank you for all the work that you put into righting this ! Im curious how did Euler reach to that formula ? I cant find a proof of it. Thank you – David Sousa Aug 09 '17 at 00:12
-
Do you mean this one?$$\Gamma(x)\Gamma(1-x)=\frac\pi{\sin(\pi x)}$$If so, see here – Simply Beautiful Art Aug 09 '17 at 00:33
-
-
1@DavidSousa Well, one approach involves the Weierstrass factorization theorem. – Simply Beautiful Art Aug 10 '17 at 23:02