On this page
Some integrals have no closed form but become easy once a parameter gets large. Laplace's method is the tool for ∫e^(Mf(x))dx, and the shortest route to Stirling's formula for n!.
What is Laplace's method for integrals?
Laplace's method is a technique for approximating integrals of the form ∫e^(Mf(x))dx, where f is twice differentiable and M is a large number. It is named after Pierre-Simon Laplace, who presented it in 1774 (Wikipedia, Laplace's method).
The exponential magnifies differences. Where f is 0.1 below its maximum f(x₀), the integrand is smaller by a factor of e^(−0.1M), about 1/22,000 for M = 100. So almost all the area sits in a narrow spike around x₀, and only the shape of f near x₀ matters.
How do you derive the formula from a Taylor expansion?
Take the maximum x₀ to lie strictly inside the interval, so f′(x₀) = 0 and f″(x₀) < 0. Near x₀, the second-order Taylor polynomial is all you need (our post on how accurate a Taylor polynomial is explains the remainder you are dropping):
f(x) ≈ f(x₀) + ½f″(x₀)(x − x₀)²
Put this in the exponent:
e^(Mf(x)) ≈ e^(Mf(x₀)) · e^(−½M(−f″(x₀))(x − x₀)²)
The second factor is a Gaussian, and its width is 1/√(−Mf″(x₀)). Outside that narrow width the integrand is tiny, so extending the limits to −∞ and +∞ changes almost nothing. Then use ∫e^(−au²)du = √(π/a) with a = −½Mf″(x₀):
∫e^(Mf(x))dx ≈ √(2π/(−Mf″(x₀))) · e^(Mf(x₀))
This is the leading-order result in the Wikipedia article. The exact conditions and the full asymptotic series are in DLMF §2.3, from the NIST Digital Library of Mathematical Functions.
How does Laplace's method give Stirling's formula?
Start from Euler's integral Γ(z) = ∫₀^∞ e^(−t)t^(z−1)dt (DLMF 5.2.1). With z = n + 1 this gives n! = ∫₀^∞ xⁿe^(−x)dx. Our explainer on the gamma function and factorials beyond whole numbers covers why.
Write xⁿe^(−x) = e^(n ln x − x). The peak is at x = n, so it moves as n grows. Rescale with x = nz, dx = n dz.
Then n! = n^(n+1) ∫₀^∞ e^(n(ln z − z))dz. Now M = n and f(z) = ln z − z.
f′(z) = 1/z − 1 vanishes at z₀ = 1. There f(1) = −1, and f″(z) = −1/z² gives f″(1) = −1.
Laplace's formula gives ∫₀^∞ e^(n(ln z − z))dz ≈ √(2π/n)·e^(−n).
Multiply: n! ≈ n^(n+1)·√(2π/n)·e^(−n) = √(2πn)(n/e)ⁿ.
This is the derivation on the Wikipedia page, and it matches the leading term of Stirling's formula in DLMF 5.11.3. To check it at n = 10: 10! = 3,628,800, while √(20π)(10/e)¹⁰ is about 3,598,700, roughly 0.83% too low. The diagram at the top shows where the gap comes from: the Gaussian matches the integrand at its peak, but the integrand is lopsided away from it. For using the result, see our guide to Stirling's approximation for n!.
How big is the error in Laplace's method?
The Gaussian step drops the cubic and higher Taylor terms. Away from x₀ they matter, which is why the n = 10 curve is skewed to the right. For an interior maximum, the leading correction is smaller than the main term by a factor of order 1/M.
Stirling's formula shows this concretely. DLMF 5.11.3 and 5.11.4 give Γ(z) ~ e^(−z)z^z√(2π/z)(1 + 1/(12z) + …). Since n! = nΓ(n), that becomes n! ≈ √(2πn)(n/e)ⁿ(1 + 1/(12n)). At n = 10 the correction factor is about 1.0083, which accounts for almost all of the 0.83% gap. With the correction included, the estimate is within 0.01% of 3,628,800.
What if the maximum is at an endpoint?
At an endpoint, f′ need not be zero, so the linear Taylor term dominates. Say the maximum is at the left end a, with f′(a) < 0. Then f(x) ≈ f(a) + f′(a)(x − a), and ∫ from a to ∞ of e^(Mf′(a)(x − a))dx = 1/(−Mf′(a)). So:
∫e^(Mf(x))dx ≈ e^(Mf(a)) / (−Mf′(a))
The integral now scales like 1/M rather than 1/√M. For example, ∫₀¹e^(−M sin x)dx has its maximum at x = 0, where f′(0) = −1, so the integral is about 1/M. If instead f′(a) = 0 and f″(a) < 0, only half the Gaussian lies inside the interval, so you get ½√(2π/(−Mf″(a)))·e^(Mf(a)). Both cases come from the endpoint expansion in DLMF 2.3.15, with the exponent's leading power equal to 1 and 2 respectively.
If the Taylor step or the rescaling is where you get stuck, the Fermi Concept Library covers every concept in mathematics, each with its own lesson. The Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning, so you can check each line of your working.



