Repeated integration by parts gives the Gamma integral
The logarithm of its integrand is , whose unique maximum is at . Write . For fixed and large , a Taylor expansion gives
The Big O notation here is for a fixed , or uniformly for in a fixed bounded interval. It does not claim a uniform approximation over the entire growing integration domain. Consequently the peak, divided by its height, approaches .
Figure 1.
The peak of a factorial integral approaches a Gaussian after recentering and rescaling
. The plotted functions are for , with zero outside their domains. Each has peak height one. They are rescaled integrands, not normalized probability density functions. Details.
The exact substitution gives
Replacing the integral by the Gaussian integral produces . Thus the estimate is peak height times width times the area of a standard Gaussian peak. This is Laplace's method in a concrete form; controlling the integral's tails justifies the replacement. The next terms, including their products after exponentiation, produce the Stirling correction by Gaussian moments.
Watson's lemma applies to Laplace-type endpoint integrals such as as , when has a local algebraic expansion with and suitable integrability or exponential-growth control away from the endpoint. Each term contributes . The exponential selects a neighborhood of .
Laplace method instead treats by locating the dominant maxima of a real phase . A smooth nondegenerate interior maximum produces a neighborhood governed by a Gaussian function of width ; endpoint or degenerate maxima require their corresponding local scaling. Contributions away from a strict dominant maximum must be smaller. These methods overlap after suitable changes of variable, but their usual starting forms emphasize an endpoint amplitude expansion and an exponential maximum, respectively.
For the Gamma function, put . Then
The phase has its unique maximum at , with value and second derivative . Set . Near this maximum,
Combining the amplitude and exponential expansions in Laplace method gives
Localization near justifies extending the limits for the Gaussian integral; the distant endpoint is not being expanded uniformly by this local series. Odd terms integrate to zero. The moments of the Gaussian integral satisfy , , , so the relative correction is
The two terms of the Stirling formula, obtained by the Stirling correction by Gaussian moments, are therefore
Stirling formula Created 2026-09-24 Updated 2026-10-14
Stirling's formula turns the long product defining a factorial into a short expression. For positive integers , put
Then as . This is asymptotic equivalence: , so the relative error tends to zero. It does not say that the absolute error tends to zero, and the formula is not an equality for finite . The Gamma function extends this approximation beyond integer inputs. [ref]
For ,
The leading estimate is about low. Multiplying by the first correction factor gives
which is about low. The Stirling correction by Gaussian moments explains why this factor is rather than an arbitrary numerical adjustment.
Figure 1.
Relative factorial errors shrink faster after the first Stirling correction
. For each integer , the curves compare and with the exact factorial. The vertical axis is the nonnegative relative error, on a logarithmic scale. Details.
The usefulness is in ratios as well as in enormous numbers. Applying Stirling's formula to the three factorials in a central binomial coefficient gives
This counts the ways to choose exactly half of objects. Equivalently, for independent fair coin tosses, the binomial distribution assigns probability to exactly heads. An exponentially large count becomes a simple probability scale after cancellation.
For numerical calculations, taking the natural logarithm yields
where . Computing a logarithm of a large factorial avoids representing the factorial itself. The Robbins bounds for Stirling's formula give a finite- interval for this logarithmic remainder, rather than only a limiting statement.
The factor is beautiful because a Gaussian integral lies behind a discrete product. The Gaussian peak behind Stirling's formula displays this connection through the Gamma integral and Laplace's method. A rigorous proof must also control the tails of the integral; the local expansion explains the geometry but is not by itself a complete proof.
James Stirling published Methodus differentialis in 1730, a treatise on summation and interpolation of infinite series. This setting connects the formula with a practical calculation problem: taking logarithms turns a long product into a sum, whose growth can be approximated. [ref]