{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $a \u003c b$, let $f \\colon [a, b] \\to \\R$ be continuous, and let $m = (a + b)/2$.\n*Simpson's rule* is the [[quadrature rule|ADSVMCY77A]]\n$$S(f) = \\frac{b - a}{6} \\big( f(a) + 4 f(m) + f(b) \\big).$$\nFor an even integer $N \\ge 2$, let $h = (b - a)/N$ and $x_i = a + i h$.\nThe *composite Simpson's rule* is\n$$S_N(f) = \\frac{h}{3} \\Big( f(x_0) + 4 f(x_1) + 2 f(x_2) + 4 f(x_3) + \\cdots + 2 f(x_{N-2}) + 4 f(x_{N-1}) + f(x_N) \\Big),$$\nthe sum of $S$ over the subintervals $[x_{2j}, x_{2j+2}]$.\n\n## Remarks\n\n$S$ is the closed [[Newton–Cotes formula|BQPQAY1FDJ]] with $n = 2$, and its [[degree of exactness|ZYT1JNT1Y0]] is $3$, one more than the degree of the interpolating parabola, by symmetry.\nExample: for $f(x) = x^3$ on $[0, 1]$, $S(f) = \\frac{1}{6}\\big(0 + \\frac{1}{2} + 1\\big) = \\frac{1}{4} = \\int_0^1 x^3\\, dx$.\nNon-example of exactness: for $f(x) = x^4$ on $[0, 1]$, $S(f) = \\frac{1}{6}\\big(0 + \\frac{1}{4} + 1\\big) = \\frac{5}{24}$, while the integral is $\\frac{1}{5}$; so the degree is not $4$.\nIf $f$ has a continuous fourth derivative, then $\\int_a^b f - S_N(f) = -\\frac{(b - a) h^4}{180} f^{(4)}(\\xi)$ for some $\\xi \\in [a, b]$.\nFor $x^4$ on $[0, 1]$ with $N = 2$ this gives $-\\frac{1}{16 \\cdot 180} \\cdot 24 = -\\frac{1}{120}$, matching $\\frac{1}{5} - \\frac{5}{24}$.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "MNXC26G3BQ",
    "kind": "definition",
    "msc": [
      "65D32",
      "41A55",
      "65D30"
    ],
    "name": "Simpson's rule",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Simpson%27s_rule"
      }
    ],
    "tag": "1FMBCFJ7K1",
    "uses": [
      "ADSVMCY77A",
      "BQPQAY1FDJ",
      "ZYT1JNT1Y0"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/1FMBCFJ7K1/",
  "links": [
    {
      "field": "defines",
      "target": "MNXC26G3BQ"
    },
    {
      "field": "uses",
      "target": "ADSVMCY77A"
    },
    {
      "field": "uses",
      "target": "BQPQAY1FDJ"
    },
    {
      "field": "uses",
      "target": "ZYT1JNT1Y0"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/1FMBCFJ7K1.md",
  "msc": [
    "65D32",
    "41A55",
    "65D30"
  ],
  "name": "Simpson's rule",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/1FM/1FMBCFJ7K1.md",
  "status": null,
  "tag": "1FMBCFJ7K1",
  "uri": "m2://1FMBCFJ7K1",
  "url": "https://tamnd.github.io/math2/wiki/simpsons-rule-definition/",
  "writing": {
    "tag": "1FMBCFJ7K1",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
