Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Stirling's approximation
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Higher orders === In fact, further corrections can also be obtained using Laplace's method. From previous result, we know that <math>\Gamma(x) \sim x^x e^{-x}</math>, so we "peel off" this dominant term, then perform two changes of variables, to obtain:<math display="block">x^{-x}e^x\Gamma(x) = \int_\R e^{x(1+t-e^t)}dt</math>To verify this: <math>\int_\R e^{x(1+t-e^t)}dt \overset{t \mapsto \ln t}{=} e^x \int_0^\infty t^{x-1} e^{-xt} dt \overset{t \mapsto t/x}{=} x^{-x} e^x \int_0^\infty e^{-t} t^{x-1} dt = x^{-x} e^x \Gamma(x)</math>. Now the function <math>t \mapsto 1+t - e^t</math> is unimodal, with maximum value zero. Locally around zero, it looks like <math>-t^2/2</math>, which is why we are able to perform Laplace's method. In order to extend Laplace's method to higher orders, we perform another change of variables by <math>1+t-e^t = -\tau^2/2</math>. This equation cannot be solved in closed form, but it can be solved by serial expansion, which gives us <math>t = \tau - \tau^2/6 + \tau^3/36 + a_4 \tau^4 + O(\tau^5) </math>. Now plug back to the equation to obtain<math display="block">x^{-x}e^x\Gamma(x) = \int_\R e^{-x\tau^2/2}(1-\tau/3 + \tau^2/12 + 4a_4 \tau^3 + O(\tau^4)) d\tau = \sqrt{2\pi}(x^{-1/2} + x^{-3/2}/12) + O(x^{-5/2})</math>notice how we don't need to actually find <math>a_4</math>, since it is cancelled out by the integral. Higher orders can be achieved by computing more terms in <math>t = \tau + \cdots</math>, which can be obtained programmatically.{{NoteTag|note=For example, a program in Mathematica: <syntaxhighlight lang="mathematica"> series = tau - tau^2/6 + tau^3/36 + tau^4*a + tau^5*b; (*pick the right a,b to make the series equal 0 at higher orders*) Series[tau^2/2 + 1 + t - Exp[t] /. t -> series, {tau, 0, 8}] (*now do the integral*) integral = Integrate[Exp[-x*tau^2/2] * D[series /. a -> 0 /. b -> 0, tau], {tau, -Infinity, Infinity}]; Simplify[integral/Sqrt[2*Pi]*Sqrt[x]] </syntaxhighlight>|name=mathematica-program|content=content|text=text}} Thus we get Stirling's formula to two orders:<math display="block"> n! = \sqrt{2\pi n}\left(\frac{n}{e}\right)^n \left(1 + \frac{1}{12 n}+O\left(\frac{1}{n^2}\right) \right). </math>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)