{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "019QZ6RRVH"
    }
  ],
  "body": "\n## Statement\n\nLet $a$ be a real number, let $n$ be a natural number, and let $f \\colon [a, a + n] \\to \\mathbb{R}$ be a decreasing function.\nThen\n$$\\sum_{i=1}^{n} f(a + i) \\le \\int_a^{a+n} f(x)\\, dx \\le \\sum_{i=0}^{n-1} f(a + i).$$\n\n## Remarks\n\nOn each interval $[a + i, a + i + 1]$ we have $f(a + i + 1) \\le f(x) \\le f(a + i)$. Integrate and add over $i$.\nThe integral exists because monotone functions are [[Riemann integrable|04YKAYDQPW]].\nWith $f(x) = 1/x$ and $a = 1$ it gives $\\ln(n + 1) \\le H_n \\le 1 + \\ln n$ for the [[harmonic numbers|0D2Y6G4C4S]].\nMathlib states the first inequality as `AntitoneOn.sum_le_integral`.\n\n## Explanations\n\n### L1 human\n\nThe sum of the values at the right ends of unit intervals is an area of rectangles below the graph of a decreasing function.\nThe sum of the values at the left ends is an area of rectangles above it.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "kind": "statement",
    "msc": [
      "26A42"
    ],
    "name": "Comparison of a series and an integral",
    "role": "proposition",
    "sources": [
      {
        "locator": "Proof",
        "url": "https://en.wikipedia.org/wiki/Integral_test_for_convergence"
      }
    ],
    "tag": "069HKV4X1E",
    "uses": [
      "0QM4TXT3DR"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/069HKV4X1E/",
  "links": [
    {
      "field": "uses",
      "target": "0QM4TXT3DR"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/069HKV4X1E.md",
  "msc": [
    "26A42"
  ],
  "name": "Comparison of a series and an integral",
  "prov": null,
  "role": "proposition",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/069/069HKV4X1E.md",
  "status": null,
  "tag": "069HKV4X1E",
  "uri": "m2://069HKV4X1E",
  "url": "https://math2.tamnd.com/wiki/comparison-of-a-series-and-an-integral/",
  "writing": {
    "tag": "069HKV4X1E",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
