### Abstract

This work contains a proof of Stirling's formula both for the factorial $n! \sim \sqrt{2\pi n} (n/e)^n$ on natural numbers and the real Gamma function $\Gamma(x)\sim \sqrt{2\pi/x} (x/e)^x$. The proof is based on work by Graham Jameson.

This is then extended to the full asymptotic expansion $$\log\Gamma(z) = \big(z - \tfrac{1}{2}\big)\log z - z + \tfrac{1}{2}\log(2\pi) + \sum_{k=1}^{n-1} \frac{B_{k+1}}{k(k+1)} z^{-k}\\ {} - \frac{1}{n} \int_0^\infty B_n([t])(t + z)^{-n}\,\text{d}t$$ uniformly for all complex $z\neq 0$ in the cone $\text{arg}(z)\leq \alpha$ for any $\alpha\in(0,\pi)$, with which the above asymptotic relation for Γ is also extended to complex arguments.

### License

BSD License

### Topics

- Mathematics/Analysis

### Session Stirling_Formula

- Stirling_Formula
- Gamma_Asymptotics

### Depends on

- Bernoulli Numbers
- Landau Symbols

### Used by

- Distributed Distinct Elements
- Clique is not solvable by monotone circuits of polynomial size
- Irrational numbers from THE BOOK
- The Lambert W Function on the Reals
- The Prime Number Theorem
- Lower bound on comparison-based sorting algorithms

## Cite

×

Stirling_Formula-AFP

    @article{Stirling_Formula-AFP,
      author  = {Manuel Eberl},
      title   = {Stirling's formula},
      journal = {Archive of Formal Proofs},
      month   = {September},
      year    = {2016},
      note    = {\url{https://isa-afp.org/entries/Stirling_Formula.html},
                 Formal proof development},
      ISSN    = {2150-914x},
    }

Download

## Download

× Download latest

Older releases:

- Sep 13, 2023 : Isabelle2023
- Oct 27, 2022 : Isabelle2022
- Dec 14, 2021 : Isabelle2021-1
- Feb 23, 2021 : Isabelle2021
- Apr 20, 2020 : Isabelle2020
- Jun 11, 2019 : Isabelle2019
- Aug 16, 2018 : Isabelle2018
- Oct 10, 2017 : Isabelle2017
- Dec 17, 2016 : Isabelle2016-1