# Euler Gamma function approximation for factorials

## Euler Gamma function.

In the previous post we introduced the Stirling formula, which is an accurate approximation for factorials even for small numbers. In this post we will look closely at an other extension of the concept of factorials, The gamma function. But unlike the factorial, the gamma function is more broadly defined for all complex numbers other than non-positive integers. In this post we will only study the behavior of this faction over .

The gamma function is defined as follows

### 1- Domain of definition

The Gamma function is defined over

Indeed, we have the function is continuous and positive over .

- near 0

Therefore

- near

Therefore

We can deduce then that

In other terms

### 2- we have

By recursion it can be shown that

### 3- is of over

Let’s consider the function

For all

- We have
- is continuous
- Let

And since the function is integrable over .

Therefore

And

### 4- is convex over

Indeed

Therefore is convex.

### 5- such that

- existence of

We have

By applying Rolle’s theorem, we find that

- uniqueness of

Since then is strictly increasing. Therefore is unique.

It follows also that:

### 6- near and

- near

We have

Therefore

Finally

- near

We have

Finally

We can verify our results with some python code:

```
1 from scipy import gamma
2
3 gamma(0)
4 # inf
5
6 gamma(inf)
7 # inf
```

Gamma function is considered as the “correct” substitute for the factorial in various integrals, which seems to come more or less from its integral definition.