{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Example\n\nLet $\\Gamma$ be the [[gamma function|0V3FZMVB4K]], let $\\ln \\Gamma$ be its principal branch on $\\C \\setminus (-\\infty, 0]$, and let $B_{2k}$ be the [[Bernoulli numbers|0RAS24E1R5]].\nFix $\\delta$ with $0 \u003c \\delta \u003c \\pi$.\nAs $z \\to \\infty$ in the sector $\\abs{\\arg z} \\le \\pi - \\delta$,\n$$\\ln \\Gamma(z) \\sim \\left(z - \\tfrac{1}{2}\\right) \\ln z - z + \\tfrac{1}{2} \\ln(2\\pi) + \\sum_{k=1}^{\\infty} \\frac{B_{2k}}{2k(2k-1) \\, z^{2k-1}}.$$\nThis is an [[asymptotic expansion|BJQTEPEZ9G]] in the scale $z \\ln z, z, \\ln z, 1, z^{-1}, z^{-3}, z^{-5}, \\ldots$.\nWith $B_2 = \\frac{1}{6}$, $B_4 = -\\frac{1}{30}$ and $B_6 = \\frac{1}{42}$, the first correction terms are\n$$\\frac{1}{12 z} - \\frac{1}{360 z^3} + \\frac{1}{1260 z^5}.$$\n\n## Remarks\n\nThe series diverges for every $z$.\nIndeed $\\abs{B_{2k}}$ grows like $2 (2k)! / (2\\pi)^{2k}$, so the terms grow like a factorial divided by a power of $z$.\nFor real $z = x \u003e 0$, the error after the term in $z^{-(2N-1)}$ has the sign of the first omitted term and is smaller in absolute value.\nFor $x = 10$, the first correction $\\frac{1}{120}$ already gives $\\ln \\Gamma(10) = \\ln(9!)$ with an error below $\\frac{1}{360\\,000} \u003c 3 \\cdot 10^{-6}$.\nTaking the exponential of the first terms gives [[Stirling's formula|0KC0F51T6A]] $n! \\sim \\sqrt{2\\pi n} \\, (n/e)^n$.\n\n## Explanations\n\n### L1 human\n\nStirling's series is a sharpened Stirling formula for the logarithm of the factorial.\nEach extra term makes the estimate better for large $z$, up to a point.\nIf one keeps adding terms forever, the sum blows up, which shows that a useful asymptotic expansion can diverge.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "instance_of": [
      "BJQTEPEZ9G"
    ],
    "kind": "example",
    "msc": [
      "33B15",
      "41A60"
    ],
    "name": "Stirling's series",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Stirling%27s_approximation"
      }
    ],
    "tag": "K29QYWB6A5"
  },
  "kind": "example",
  "link": "https://math2.tamnd.com/node/K29QYWB6A5/",
  "links": [
    {
      "field": "instance_of",
      "target": "BJQTEPEZ9G"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/K29QYWB6A5.md",
  "msc": [
    "33B15",
    "41A60"
  ],
  "name": "Stirling's series",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/K29/K29QYWB6A5.md",
  "status": null,
  "tag": "K29QYWB6A5",
  "uri": "m2://K29QYWB6A5",
  "url": "https://math2.tamnd.com/wiki/stirlings-series/",
  "writing": {
    "tag": "K29QYWB6A5",
    "kind": "example",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
