All articles
UndergraduateReflection

Starting Later: Geometric Bounds for Stirling’s Formula

A reflection on Bikash Chakraborty’s article in The College Mathematics Journal, with a geometric extension of its bounds.

Stirling’s formulaAsymptotic analysisInequalitiesInteractive

Stirling's formula describes the extraordinary growth of a factorial with a remarkably compact expression:

n!2πn(ne)nn!\sim\sqrt{2\pi n}\left(\frac ne\right)^n

This also means that

Rn:=n!(n/e)nn2πR_n:=\frac{n!}{(n/e)^n\sqrt n}\longrightarrow\sqrt{2\pi}

In “Stirling's Formula: A Better Approximation”, Bikash Chakraborty returns to an integral comparison from Walter Rudin's Principles of Mathematical Analysis. Rudin's exercise (Chapter 8, Problem 20) gives e7/8<Rn<ee^{7/8}<R_n<e for integers n>2n>2. Chakraborty keeps the same basic idea, modifies the geometry, and sharpens both bounds to

e7/8<(2e3)3/2<Rn<e222<e,n>2e^{7/8}<\left(\frac{2e}{3}\right)^{3/2}<R_n<\frac{e^2}{2\sqrt2}<e,\qquad n>2

In decimals,

2.39887529397<2.43952253514<Rn<2.61242583706<2.718281828462.39887529397<2.43952253514<R_n<2.61242583706<2.71828182846

The proof is highly pedagogical because it turns a factorial into a comparison of visible areas under y=logxy=\log x.

What caught my attention was a small geometric choice on which the argument depends: the point at which the area comparison begins. Chakraborty begins at 22. If the construction begins later, the initial factors can be retained exactly while only the remaining tail is estimated.

The geometric core idea of Chakraborty’s argument

For completeness, let us try to understand Chakraborty's argument. Taking logarithms turns the product defining n!n! into the sum log(n!)=j=1nlogj\log(n!)=\sum_{j=1}^n\log j. If g(x)=logxg(x)=\log x, then g(x)=1/x2<0g''(x)=-1/x^2<0, so the graph is strictly concave. Every chord lies below the curve, while every tangent line lies above it. These facts give two complementary area comparisons.

On [m,m+1][m,m+1], the chord joining (m,logm)(m,\log m) and (m+1,log(m+1))(m+1,\log(m+1)) lies below the curve. For the other direction, the tangent at the integer mm lies above the curve on the centred interval [m12,m+12][m-\tfrac12,m+\tfrac12]. Thus the tangent points are integers and the endpoints of their intervals are half-integers. A final half-width rectangle completes the cover up to nn.

Interactive 1 · Chakraborty's construction

The areas in the proof

Visible areas
Chords belowdomain [2, n]
logx26

Cn<2nlogxdxC_n<\int_2^n\log x\,dx

5.33680 < 5.36426gap 0.02746
Tangents abovedomain [3/2, n]
logx3/26

3/2nlogxdx<Tn\int_{3/2}^n\log x\,dx<T_n

5.64236 < 5.68337gap 0.04101

At n=6n=6, the chord total undercounts by 0.02746, while the tangent cover overcounts by 0.04101. The two panels use different starting points, exactly as in the proof.

Chord trapezoids and the upper bound

For an integer mm, the chord has equation

m(x)=(m+1x)logm+(xm)log(m+1),mxm+1\ell_m(x)=(m+1-x)\log m+(x-m)\log(m+1),\qquad m\le x\le m+1

The interval has width one, and the two vertical sides have heights logm\log m and log(m+1)\log(m+1). Its area is therefore the trapezoid area

mm+1m(x)dx=logm+log(m+1)2\int_m^{m+1}\ell_m(x)\,dx=\frac{\log m+\log(m+1)}{2}

For Chakraborty's starting point k=2k=2, add these trapezoids for m=2,,n1m=2,\ldots,n-1. Each intermediate logarithm occurs twice with coefficient one half, while the two endpoint logarithms occur once. Hence

Cn=m=2n1logm+log(m+1)2=12log2+m=3n1logm+12logn=log(n!)12log(2n)<2nlogxdx.\begin{aligned}C_n&=\sum_{m=2}^{n-1}\frac{\log m+\log(m+1)}2\\&=\frac12\log2+\sum_{m=3}^{n-1}\log m+\frac12\log n\\&=\log(n!)-\frac12\log(2n)<\int_2^n\log x\,dx.\end{aligned}

Now 2nlogxdx=nlognn2log2+2\int_2^n\log x\,dx=n\log n-n-2\log2+2. Substituting this and collecting the terms in logRn\log R_n gives

logRn<232log2=log ⁣(e222),Rn<e222.\log R_n<2-\frac32\log2=\log\!\left(\frac{e^2}{2\sqrt2}\right),\qquad R_n<\frac{e^2}{2\sqrt2}.

Tangent cells and the lower bound

The tangent to logx\log x at the integer mm is

τm(x)=logm+xmm.\tau_m(x)=\log m+\frac{x-m}{m}.

Chakraborty uses it on the unit cell centred at mm. Put u=xmu=x-m. The constant part contributes logm\log m, while the linear part has equal positive and negative areas and cancels:

m1/2m+1/2τm(x)dx=1/21/2(logm+um)du=logm.\begin{aligned}\int_{m-1/2}^{m+1/2}\tau_m(x)\,dx&=\int_{-1/2}^{1/2}\left(\log m+\frac{u}{m}\right)du\\&=\log m.\end{aligned}

This is the tangent-cell formula. The cells for m=2,,n1m=2,\ldots,n-1 cover the interval from 3/23/2 to n1/2n-1/2. To reach nn, add a final rectangle of width one half and height logn\log n. Their combined area is

Tn=m=2n1logm+12logn=log(n!)12logn.\begin{aligned}T_n&=\sum_{m=2}^{n-1}\log m+\frac12\log n\\&=\log(n!)-\frac12\log n.\end{aligned}

Because every tangent cell and the final rectangle lie above the logarithmic curve,

3/2nlogxdx<Tn=log(n!)12logn.\int_{3/2}^{n}\log x\,dx<T_n=\log(n!)-\frac12\log n.

Evaluating the integral and rearranging gives

logRn>3232log32=log ⁣(2e3)3/2,(2e3)3/2<Rn.\log R_n>\frac32-\frac32\log\frac32=\log\!\left(\frac{2e}{3}\right)^{3/2},\qquad \left(\frac{2e}{3}\right)^{3/2}<R_n.

The two constants therefore record the same concave curve in two ways: the chord construction begins at 22, while the first centred tangent cell begins at 3/23/2.

Move the starting point

Fix integers nk2n\ge k\ge2. Keep the initial product 12(k1)=(k1)!1\cdot2\cdots(k-1)=(k-1)! untouched, and apply the geometric comparison only from kk onwards.

Interactive 2 · assemble the proof

Move the starting line

Chords belowan under-area makes the upper bound
38logx

Gap 0.01727

Tangents abovean over-area makes the lower bound
3−½8logx

Gap 0.02693

Chord constructionR8<R3=2.576976R_{8}<R_{3}=2.576976

Tangent construction2.465563=L3<R82.465563=L_{3}<R_{8}

Only the starting line moves. The factors before kk remain exact; the same local comparison is applied to the tail.

For n>kn>k, adding the chord trapezoids from kk to nn gives

12logk+j=k+1n1logj+12logn<knlogxdx\frac12\log k+\sum_{j=k+1}^{n-1}\log j+\frac12\log n<\int_k^n\log x\,dx

Evaluating the integral and collecting logarithms yields Rn<RkR_n<R_k. When n=kn=k, equality is immediate. Hence RnRkR_n\le R_k, and the upper constant at starting point kk is Uk=Rk=k!ekkkkU_k=R_k=\dfrac{k!e^k}{k^k\sqrt k}.

Add the centred tangent cells for j=k,,n1j=k,\ldots,n-1 and finish with a half-width rectangle of height logn\log n. Their combined area lies strictly above the curve, so

k1/2nlogxdx<j=kn1logj+12logn\int_{k-1/2}^{n}\log x\,dx<\sum_{j=k}^{n-1}\log j+\frac12\log n

Rearrangement gives Lk=(k1)!(ek12)k1/2L_k=(k-1)!\left(\dfrac{e}{k-\tfrac12}\right)^{k-1/2}.

A family of bounds

The two constructions combine into the following theorem.

At k=2k=2, this recovers Chakraborty's pair of constants. Moving the starting point one step, to k=3k=3, gives for every integer n>2n>2

2(2e5)5/2<Rn2e3932\left(\frac{2e}{5}\right)^{5/2}<R_n\le\frac{2e^3}{9\sqrt3}

or 2.465563424<Rn2.5769755892.465563424<R_n\le2.576975589. This interval is about 35.6%35.6\%narrower than Chakraborty's interval over the same integer range. The non-strict upper sign matters: equality occurs at n=3n=3.

Starting pointUniform tailLower endpointUpper endpointWidth
k=2k=2n2n\ge22.4395225352.6124258370.172903302
k=3k=3n3n\ge32.4655634242.5769755890.111412165
k=5k=5n5n\ge52.4835911202.5486994880.065108369
k=10k=10n10n\ge102.4956654162.5275971200.031931705
k=20k=20n20n\ge202.5012787692.5170934750.015814706

When the integer becomes real

The Gamma function extends the factorial beyond the integers. Since Γ(n+1)=n!\Gamma(n+1)=n!, define, for real x>2x>2,

R(x):=Γ(x+1)(x/e)xxR(x):=\frac{\Gamma(x+1)}{(x/e)^x\sqrt x}

At an integer nn, this is exactly RnR_n. The lower endpoints of the starting-point construction also have the continuous companion

L(x):=Γ(x)(ex12)x1/2L(x):=\Gamma(x)\left(\frac{e}{x-\tfrac12}\right)^{x-1/2}

with L(k)=LkL(k)=L_k and R(k)=UkR(k)=U_k at every integer k2k\ge2. The comparison is transparent because the Gamma factors cancel:

R(x)L(x)=e(112x)x1/2>1\frac{R(x)}{L(x)}=\sqrt e\left(1-\frac1{2x}\right)^{x-1/2}>1

The inequality still has the same geometric meaning. In fact,

logR(x)L(x)=12logxx1/2xlogtdt=x1/2xlogxtdt>0\begin{aligned}\log\frac{R(x)}{L(x)}&=\frac12\log x-\int_{x-1/2}^{x}\log t\,dt\\&=\int_{x-1/2}^{x}\log\frac{x}{t}\,dt>0\end{aligned}

This is the excess of the final half-width rectangle of height logx\log x above the logarithmic curve. Consequently L(x)<R(x)L(x)<R(x) for every real x>2x>2.

Interactive 3 · the continuous picture

Between the integers

R(x)L(x)√2π
R of x and its lower companion L of x at x equals 6.00R decreases and L increases towards square root of two pi. A vertical probe marks the selected real value of x.2.442.502.562.6225102030real input xnormalized value

Lower L(x)L(x)2.487746388

Upper R(x)R(x)2.541653013

Gap0.053906626

At x=6.00x=6.00, the ratio R(x)/L(x)R(x)/L(x) is 1.0216689. The shaded interval narrows towards 2π\sqrt{2\pi}.

The quotient R(x)/L(x)R(x)/L(x) tends to 11. The Gamma-function form of Stirling's formula gives R(x)2πR(x)\to\sqrt{2\pi}, and so L(x)L(x) approaches the same limit. Here L(x)L(x) is a continuous companion to the geometric lower endpoints, not an independent computational estimate for Gamma: away from the integers, the original sum of logarithms no longer telescopes into a factorial.

Sources and further reading

  1. Bikash Chakraborty, “Stirling's Formula: A Better Approximation”, The College Mathematics Journal, published online 31 August 2026, DOI 10.1080/07468342.2026.2721230.
  2. Walter Rudin, Principles of Mathematical Analysis, 3rd ed., Chapter 8, Problem 20.
  3. NIST Digital Library of Mathematical Functions, §5.11, Asymptotic Expansions, for the Gamma-function form of Stirling's expansion.

The approximation itself did not change. The sharper bounds appeared when the same geometry was asked to begin somewhere else.

Reading preferences

Display settings

Choose a comfortable text size and page theme. Preferences are stored only on this device.

Text size
Theme

Medium text · Light theme

On this device