{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $K$ be a [[field|04C5ZBG1WT]], let $n \\ge 0$, and let $x_0, \\dots, x_n \\in K$ be pairwise distinct.\nFor $j = 0, \\dots, n$, the *Lagrange basis polynomial* $\\ell_j$ is the polynomial in the [[polynomial ring|0SDC934R52]] $K[x]$ given by\n$$\\ell_j(x) = \\prod_{\\substack{0 \\le k \\le n \\\\ k \\ne j}} \\frac{x - x_k}{x_j - x_k}.$$\n\n## Remarks\n\nEach $\\ell_j$ has [[degree|0P4JRMSWNH]] $n$, and $\\ell_j(x_i) = 1$ if $i = j$ and $\\ell_j(x_i) = 0$ if $i \\ne j$.\nThe $\\ell_j$ form a [[basis|0KCQ9Y3QKA]] of the space of polynomials of degree at most $n$, and every such $p$ satisfies $p = \\sum_{j} p(x_j) \\, \\ell_j$.\nThey also satisfy $\\sum_j \\ell_j = 1$, the case $p = 1$.\nWith $\\ell(x) = \\prod_{k=0}^{n} (x - x_k)$, one has $\\ell_j(x) = \\dfrac{\\ell(x)}{(x - x_j) \\, \\ell'(x_j)}$.\n\nExample: for the nodes $0, 1, 2$ in $\\R$, $\\ell_1(x) = \\frac{(x - 0)(x - 2)}{(1 - 0)(1 - 2)} = -x(x - 2)$.\nCheck: $\\ell_1(0) = 0$, $\\ell_1(1) = 1$ and $\\ell_1(2) = 0$.\n\nNon-example: for the nodes $0, 0, 1$, the nodes are not distinct, and the factor $\\frac{x - x_1}{x_0 - x_1}$ in $\\ell_0$ has denominator $0$, so $\\ell_0$ is not defined.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "DA3CQJ5MJ6",
    "kind": "definition",
    "msc": [
      "41A05",
      "65D05"
    ],
    "name": "Lagrange basis polynomials",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Lagrange_polynomial"
      }
    ],
    "tag": "ZCVB4ZQ0SA",
    "uses": [
      "04C5ZBG1WT",
      "0SDC934R52",
      "0P4JRMSWNH",
      "0KCQ9Y3QKA"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/ZCVB4ZQ0SA/",
  "links": [
    {
      "field": "defines",
      "target": "DA3CQJ5MJ6"
    },
    {
      "field": "uses",
      "target": "04C5ZBG1WT"
    },
    {
      "field": "uses",
      "target": "0SDC934R52"
    },
    {
      "field": "uses",
      "target": "0P4JRMSWNH"
    },
    {
      "field": "uses",
      "target": "0KCQ9Y3QKA"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/ZCVB4ZQ0SA.md",
  "msc": [
    "41A05",
    "65D05"
  ],
  "name": "Lagrange basis polynomials",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/ZCV/ZCVB4ZQ0SA.md",
  "status": null,
  "tag": "ZCVB4ZQ0SA",
  "uri": "m2://ZCVB4ZQ0SA",
  "url": "https://tamnd.github.io/math2/wiki/lagrange-basis-polynomials-definition/",
  "writing": {
    "tag": "ZCVB4ZQ0SA",
    "kind": "definition",
    "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
      }
    ]
  }
}
