{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nLet $s_N = \\sum_{n=0}^{N} \\frac{(-1)^n}{2n+1}$ be the partial sums.\n\n1. The numbers $b_n = 1/(2n+1)$ are positive, decreasing, and tend to $0$. By the [[alternating series test|0PK8QH1W1V]], the series converges.\n2. We compute $\\arctan 1$. By the definition of [[pi|0C1VYVNV2N]], $\\pi/2$ is the only zero of $\\cos$ in $[0, 2]$. Also $\\pi/2 \\ne 0$, since $\\cos 0 = 1$ by the definition of [[sine and cosine|0WB57D9488]].\n3. The function $\\cos$ is continuous and $\\cos 0 = 1 \u003e 0$. If $\\cos x \\le 0$ for some $x \\in [0, \\pi/2)$, the [[intermediate value theorem|00KAFBR32E]] would give a zero of $\\cos$ in $(0, x]$. This zero would lie in $[0, 2]$ and differ from $\\pi/2$, which is impossible. So $\\cos x \u003e 0$ on $[0, \\pi/2)$.\n4. By the [[mean value theorem|0BARQY52N5]] and the [[derivative of sine|00R4MWW532]], $\\sin(\\pi/4) - \\sin 0 = \\frac{\\pi}{4} \\cos \\xi$ for some $\\xi \\in (0, \\pi/4)$. By step 3 this is positive, and $\\sin 0 = 0$, so $\\sin(\\pi/4) \u003e 0$.\n5. By the [[angle addition formulas|028XEQCE88]], $0 = \\cos(\\pi/2) = \\cos^2(\\pi/4) - \\sin^2(\\pi/4)$. Since $\\sin(\\pi/4)$ and $\\cos(\\pi/4)$ are both positive, they are equal.\n6. So $\\tan(\\pi/4) = 1$, by the definition of the [[tangent function|06T0HS14PP]]. Since $\\pi/4 \\in (-\\pi/2, \\pi/2)$, the definition of the [[arctangent|065XW2V6C3]] gives $\\arctan 1 = \\pi/4$.\n7. Also $\\tan 0 = \\sin 0 / \\cos 0 = 0$, so $\\arctan 0 = 0$.\n8. The arctangent is differentiable with derivative $1/(1+x^2)$, by the [[derivative of arctangent|05P4B4Q22V]]. So it is [[continuous|07ZMX4ANJS]]. Its derivative is a quotient of continuous functions with $1 + x^2 \u003e 0$, so it is continuous, hence [[Riemann integrable|06SESV7GQY]] on $[0, 1]$.\n9. By the [[second fundamental theorem of calculus|0XYAFCN0PT]] and steps 6 and 7,\n$$\\int_0^1 \\frac{dt}{1 + t^2} = \\arctan 1 - \\arctan 0 = \\frac{\\pi}{4}.$$\n10. Let $n \\ge 1$ and $t \\in [0, 1]$. Apply the [[sum of a finite geometric series|05APWSX53S]] with $r = -t^2 \\ne 1$. It gives $\\sum_{k=0}^{n-1} (-1)^k t^{2k} = \\frac{1 - (-1)^n t^{2n}}{1 + t^2}$.\n11. Rearranging step 10 gives\n$$\\frac{1}{1 + t^2} = \\sum_{k=0}^{n-1} (-1)^k t^{2k} + (-1)^n \\frac{t^{2n}}{1 + t^2}.$$\n12. All functions in step 11 are continuous on $[0,1]$, hence integrable. By [[linearity of the integral|080RWVVSB6]] and the [[integral of a power|0Q3HYFT9RQ]], $\\int_0^1 t^{2k}\\, dt = \\frac{1}{2k+1}$. Integrating step 11 over $[0, 1]$ and using step 9 gives\n$$\\frac{\\pi}{4} = s_{n-1} + (-1)^n R_n, \\qquad R_n = \\int_0^1 \\frac{t^{2n}}{1 + t^2}\\, dt.$$\n13. For $t \\in [0, 1]$, $0 \\le \\frac{t^{2n}}{1 + t^2} \\le t^{2n}$. By [[monotonicity of the integral|0MBWQKM8QR]] and the integral of a power, $0 \\le R_n \\le \\frac{1}{2n+1}$.\n14. By steps 12 and 13, $\\abs{\\pi/4 - s_{n-1}} = R_n \\le \\frac{1}{2n+1}$ for every $n \\ge 1$.\n15. Let $\\varepsilon \u003e 0$, and take $n_0$ with $1/(2n_0 + 1) \u003c \\varepsilon$. For $N \\ge n_0 - 1$, step 14 with $n = N + 1$ gives $\\abs{\\pi/4 - s_N} \\le 1/(2N+3) \u003c \\varepsilon$.\n16. So $s_N \\to \\pi/4$ by the definition of the [[limit|0XKWSSY8P2]]. Hence $1 - \\frac13 + \\frac15 - \\frac17 + \\cdots = \\frac{\\pi}{4}$.\n\n## Idea\n\nSince $\\arctan' = 1/(1+t^2)$, the number $\\pi/4 = \\arctan 1$ is the integral of $1/(1+t^2)$ over $[0,1]$. Expanding $1/(1+t^2)$ as a finite geometric sum in $-t^2$ plus a remainder, and integrating term by term, gives a partial sum of the series. The remainder integral is at most $1/(2n+1)$, so it tends to $0$.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "40A05"
    ],
    "name": "Proof of the Leibniz formula for pi by integrating a finite geometric sum",
    "proves": "037FD5NBRT",
    "sources": [
      {
        "locator": "Proof 1",
        "url": "https://en.wikipedia.org/wiki/Leibniz_formula_for_%CF%80"
      }
    ],
    "tag": "2703AZH0B6",
    "uses": [
      "0PK8QH1W1V",
      "0C1VYVNV2N",
      "065XW2V6C3",
      "06T0HS14PP",
      "0WB57D9488",
      "028XEQCE88",
      "00KAFBR32E",
      "00R4MWW532",
      "0BARQY52N5",
      "05P4B4Q22V",
      "07ZMX4ANJS",
      "06SESV7GQY",
      "0XYAFCN0PT",
      "05APWSX53S",
      "080RWVVSB6",
      "0Q3HYFT9RQ",
      "0MBWQKM8QR",
      "0XKWSSY8P2"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/2703AZH0B6/",
  "links": [
    {
      "field": "proves",
      "target": "037FD5NBRT"
    },
    {
      "field": "uses",
      "target": "0PK8QH1W1V"
    },
    {
      "field": "uses",
      "target": "0C1VYVNV2N"
    },
    {
      "field": "uses",
      "target": "065XW2V6C3"
    },
    {
      "field": "uses",
      "target": "06T0HS14PP"
    },
    {
      "field": "uses",
      "target": "0WB57D9488"
    },
    {
      "field": "uses",
      "target": "028XEQCE88"
    },
    {
      "field": "uses",
      "target": "00KAFBR32E"
    },
    {
      "field": "uses",
      "target": "00R4MWW532"
    },
    {
      "field": "uses",
      "target": "0BARQY52N5"
    },
    {
      "field": "uses",
      "target": "05P4B4Q22V"
    },
    {
      "field": "uses",
      "target": "07ZMX4ANJS"
    },
    {
      "field": "uses",
      "target": "06SESV7GQY"
    },
    {
      "field": "uses",
      "target": "0XYAFCN0PT"
    },
    {
      "field": "uses",
      "target": "05APWSX53S"
    },
    {
      "field": "uses",
      "target": "080RWVVSB6"
    },
    {
      "field": "uses",
      "target": "0Q3HYFT9RQ"
    },
    {
      "field": "uses",
      "target": "0MBWQKM8QR"
    },
    {
      "field": "uses",
      "target": "0XKWSSY8P2"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/2703AZH0B6.md",
  "msc": [
    "40A05"
  ],
  "name": "Proof of the Leibniz formula for pi by integrating a finite geometric sum",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/270/2703AZH0B6.md",
  "status": null,
  "tag": "2703AZH0B6",
  "uri": "m2://2703AZH0B6",
  "url": "https://math2.tamnd.com/wiki/proof-of-the-leibniz-formula-for-pi-by-integrating-a-finite-geometric-sum/",
  "writing": {
    "tag": "2703AZH0B6",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
