Our Gamma function calculator uses the **best Gamma function approximations** to help you find the value of the Gamma function for both **real and complex arguments**.

Scroll down if you are unsure what the Gamma function formula is or how to calculate the Gamma function at a particular point. We will explain the link between the Gamma function and factorials, give you the Gamma function integral formula, and, since a picture is worth a thousand words, show a few graphs of the Gamma function.

## What is the Gamma function? Gamma function properties

The Gamma function is very tightly linked to the notion of **factorial**. Hence, before moving on to the Gamma function properties, let us first recall what the factorial is.

#### Factorial operator

Let `n`

be a positive integer. The factorial of `n`

(denoted by `n!`

) is **the product of all integers between (and including) 1 and n**:

`n! = 1 β
2 β
... β
(n-1) β
n`

.

For instance

`5! = 1 β
2 β
3 β
4 β
5 = 120`

.

Factorials are essential in statistics and probability. They have many uses, too many to mention here, so let us just mention permutations & combinations, binomial coefficients along with Pascal's triangle, and the binomial probability distribution. If you want to learn more about factorials, especially their applications, visit our dedicated factorial calculator.

What is essential for us is the fact that the factorial is only defined for positive integers. Is there any way to **extend the factorial** to all positive numbers? How about all real (or even complex) numbers? We can think of this as the following interpolation problem:

Can we find a smooth curve that connects the points`(x, y)`

given by`y = x!`

at the positive integer values for x?

There have been several approaches to solve this problem, and the Gamma function is the most popular one.

#### Gamma function and factorials

Gamma is a function (denoted by the Greek letter `πͺ`

) that allows us to extend the notion of factorial well beyond positive integer numbers. Formally, the Gamma function formula is given by an integral (see the next section for more details). Most importantly, the Gamma function and factorials are linked via the relationship:

`πͺ(n) = (n - 1)!`

So it is indeed a solution to the interpolation problem described above. Below you can see the graph of the Gamma function `πͺ(n + 1) = n!`

for all positive numbers (the red dots are the values of the factorial at each integer of x):

π‘ Do you know that... this function was defined by the Swiss mathematician Leonhard Euler in the first half of the 18th century, while the name Gamma and notation `πͺ` was introduced by the French mathematician Adrien-Marie Legendre at the beginning of the 19th century. |

## Gamma function - integral formula

For more advanced readers, we now briefly discuss the Gamma function integral formula and show some more Gamma function properties. Namely, for a complex number `z`

taken from the positive complex half-plane (i.e., for `z`

with a positive real part), we define the Gamma function via the following integral:

This Gamma function integral is absolutely convergent. With the help of standard integration methods, we can also show that:

`πͺ(1) = 1`

and `πͺ(z + 1) = z * πͺ(z)`

.

In consequence, we get `πͺ(n) = (n β 1)!`

for any natural number `n`

. Hence, we've **extended the factorial to the positive complex half-plane**.

If `Re(z) β€ 0`

, then the above integral is not convergent, but `πͺ`

has a unique analytic continuation to the negative half-plane. To find this analytic continuation, we can use the formula:

`πͺ(z) = πͺ(z+1) / z`

.

However, this technique works if and only if `z`

is a non-positive integer. Therefore, we must leave the Gamma function undefined at these integers to avoid dividing by zero. So, we've **extended the factorial to the whole complex plane, except non-positive integers**.

The Gamma function graph plotted over the real numbers looks like this:

In the language of complex analysis, we say that Gamma is a meromorphic function in the whole complex plane. At each non-positive integer it has a simple pole and the residue at `-n`

is equal to `(-1)βΏ/n!`

for `n = 0, 1, 2, ...`

. **Gamma has no zeros**. Here is the plot of the absolute value of Gamma over the complex plane:

## How to calculate the Gamma function? Gamma function of 1/2

You now know what the Gamma function is and what the Gamma function formula looks like, but you probably still have very little idea how to determine its values. Well, we don't have good news for you: it's **highly non-trivial** to find the values of Gamma, apart from some very specific points, like Gamma function of 1/2.

Let's start with the simplest case. We've already seen that for **positive-integer arguments** we have

`πͺ(n) = (n β 1)!`

so we easily get

`πͺ(1) = 0! = 1`

`πͺ(2) = 1! = 1`

`πͺ(3) = 2! = 2`

`πͺ(4) = 3! = 6`

`etc.`

Next, we have a nice formula for **half-integer arguments**:

`πͺ(n/2) = (n-2)!! * β(Ο/2`

^{(n-1)})

where `n!!`

is a **double factorial**. Recall that the double factorial is defined as the product of all integers between `1`

and `n`

with the same parity as `n`

: if `n`

is even, then `n!! = 2 β
4 β
... β
n`

; and if `n`

is odd, then `n!! = 1 β
3 β
... β
n`

.

Using this half-integer formula, we obtain Gamma function of 1/2:

`πͺ(1/2) = βΟ`

,

and other fractions:

`πͺ(3/2) = 1/2 β
βΟ`

`πͺ(5/2) = 3/4 β
βΟ`

`etc.`

There are also formulas that link the values of Gamma at several points. Thanks to them, you can find the value of Gamma at some point `z`

provided that you know its value at some other point linked to `z`

. For instance, if `z`

is not an integer, then `πͺ(1-z)`

and `πͺ(z)`

are linked by **Euler's reflection formula:**

`πͺ(1-z) β
πͺ(z) = Ο / sin(Ο * z)`

.

Thanks to this formula we find:

`πͺ(-1/2) = -2 * βΟ`

`πͺ(-3/2) = 4/3 * βΟ`

`πͺ(-5/2) = -8/15 * βΟ`

`etc.`

The reflection formula allows us also to derive the following relationships:

`πͺ(1/3) β
πͺ(2/3) = 2β3/3 β
Ο`

`πͺ(1/4) β
πͺ(3/4) = β2 β
Ο`

`etc.`

Unfortunately, no simple expression for `πͺ(1/3)`

or `πͺ(1/4)`

exists.

Another interesting formula is the **Legendre duplication formula**. Assume that `2 * z`

is not equal to any non-positive integer. Then, if you know any two from `πͺ(z), πͺ(2 * z), and πͺ(z + 1/2)`

, you can find the third one. The equation that links all three is of the form:

`πͺ(z) β
πͺ(z + 1/2) = 2`

^{1 - 2*z} * βΟ * πͺ(2 * z)

## How to use this Gamma function calculator?

Are you still wondering how to calculate the Gamma function? Well, the best answer is: use our Gamma function calculator! Here we briefly describe how to use it:

- Choose the type of argument you want our Gamma function calculator to use. By default, we set it to
**real arguments**, but**complex numbers**are available as well. - Enter the argument in the appropriate field(s).
- The calculator uses very precise Gamma function approximations to determine the result. It appears just beneath the argument. Enjoy!
- If you need to
**increase the precision**of calculations, go to the`advanced mode`

. By default, this Gamma function calculator uses five sig figs to display the result.

## Gamma function approximations

As we have seen above, we can find precise values of the Gamma function for only very specific arguments. Fortunately, we can approximate Gamma **numerically with arbitrary precision**.
There are several Gamma function approximations, let us mention the most popular ones:

Stirling's and Lanczos' methods allow us to compute the values of Gamma with any precision we want, but they still require quite complicated calculations. Our Gamma function calculator uses the Lanczos approximation for small values and an extended Stirling approximation for large values.

Nemes' approximation leads to the following simple formula: