{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "Q0M7PT9VN2"
    },
    {
      "field": "uses",
      "target": "ZMT8JF21R6"
    }
  ],
  "body": "\n## Statement\n\nLet $n \\ge 0$, let $a \u003c b$, and let $f \\colon [a, b] \\to \\R$ be $n + 1$ times continuously differentiable.\nLet $x_0, \\dots, x_n \\in [a, b]$ be pairwise distinct, and let $p$ be the [[interpolation polynomial|SS1YMS2NPC]] of degree at most $n$ with $p(x_i) = f(x_i)$ for all $i$.\nThen for every $x \\in [a, b]$ there is $\\xi$ in the smallest closed interval that contains $x, x_0, \\dots, x_n$ such that\n$$f(x) - p(x) = \\frac{f^{(n+1)}(\\xi)}{(n + 1)!} \\prod_{i=0}^{n} (x - x_i).$$\n\n## Remarks\n\nIf $x$ is a node, both sides are $0$.\nOtherwise set $\\omega(t) = \\prod_i (t - x_i)$ and choose the constant $c$ so that $g(t) = f(t) - p(t) - c \\, \\omega(t)$ vanishes at $t = x$.\nThen $g$ has $n + 2$ distinct zeros, and $n + 1$ applications of [[Rolle's theorem|0194DY35BG]] give a zero $\\xi$ of the [[derivative|0V1EJCT8G6]] $g^{(n+1)} = f^{(n+1)} - c \\, (n + 1)!$.\nThis gives $c = f^{(n+1)}(\\xi)/(n + 1)!$.\n\nExample: take $f = \\exp$ on $[0, 1]$ with the nodes $0$ and $1$.\nAt $x = 1/2$ the error of the linear interpolant is $\\frac{e^{\\xi}}{2} \\cdot \\frac{1}{2} \\cdot \\left(-\\frac{1}{2}\\right)$ for some $\\xi \\in [0, 1]$.\nSo its absolute value is at most $e/8$.\n\nFor $n = 0$ the formula is the mean value theorem.\nIt is the analogue of [[Taylor's theorem|03QHBVW4TT]] with the Lagrange remainder, with $n + 1$ separate points in place of one point of high contact.\n\n## Explanations\n\n### L1 human\n\nWhen a polynomial is fitted through some points of a smooth curve, it matches the curve exactly at those points and is off somewhere else.\nThe formula says how far off it is.\nThe error is small when the curve does not bend too much, measured by a high derivative, and when the point is close to the nodes.\n\n### L2 human\n\nTaking the maximum over $[a, b]$ gives $\\norm{f - p}_\\infty \\le \\frac{\\norm{f^{(n+1)}}_\\infty}{(n + 1)!} \\max_{x \\in [a, b]} \\abs{\\omega(x)}$.\nThe first factor depends only on $f$, the second only on the nodes.\n[[Chebyshev nodes|HYK8J56PSH]] make the second factor as small as possible on an interval.\nWhen the derivatives of $f$ grow fast, the bound can fail to tend to $0$, which is what happens in [[Runge's phenomenon|ZMT8JF21R6]].\nIn terms of [[divided differences|N5ZHV4HWDC]], for $x$ not a node the error equals $f[x_0, \\dots, x_n, x] \\, \\omega(x)$.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "about": [
      "SS1YMS2NPC"
    ],
    "kind": "statement",
    "msc": [
      "41A05",
      "65D05",
      "41A80"
    ],
    "name": "Interpolation error formula",
    "role": "theorem",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Polynomial_interpolation"
      }
    ],
    "tag": "HASA2XSG66",
    "uses": [
      "SS1YMS2NPC",
      "0V1EJCT8G6",
      "0194DY35BG"
    ]
  },
  "kind": "statement",
  "link": "https://tamnd.github.io/math2/node/HASA2XSG66/",
  "links": [
    {
      "field": "about",
      "target": "SS1YMS2NPC"
    },
    {
      "field": "uses",
      "target": "SS1YMS2NPC"
    },
    {
      "field": "uses",
      "target": "0V1EJCT8G6"
    },
    {
      "field": "uses",
      "target": "0194DY35BG"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/HASA2XSG66.md",
  "msc": [
    "41A05",
    "65D05",
    "41A80"
  ],
  "name": "Interpolation error formula",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/HAS/HASA2XSG66.md",
  "status": null,
  "tag": "HASA2XSG66",
  "uri": "m2://HASA2XSG66",
  "url": "https://tamnd.github.io/math2/wiki/interpolation-error-formula/",
  "writing": {
    "tag": "HASA2XSG66",
    "kind": "statement",
    "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
      }
    ]
  }
}
