{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $n \\ge 1$ and let $P_n$ be the [[Legendre polynomial|QFYGJVA996]] of degree $n$.\nLet $x_1, \\dots, x_n$ be the zeros of $P_n$; they are distinct and lie in $(-1, 1)$.\nThe $n$-point *Gauss–Legendre quadrature* rule is\n$$\\int_{-1}^{1} f(x)\\,dx \\approx \\sum_{i=1}^{n} w_i f(x_i), \\qquad w_i = \\frac{2}{(1 - x_i^2)\\, P_n'(x_i)^2}.$$\nIt is the $n$-point [[Gaussian quadrature|FP37BTP93K]] rule for the weight $w = 1$ on $(-1, 1)$.\n\n## Remarks\n\nThe rule is exact for every polynomial of degree at most $2n - 1$.\nFor an interval $[a, b]$ one uses $\\int_a^b g(t)\\,dt = \\frac{b - a}{2} \\int_{-1}^{1} g\\big(\\frac{b - a}{2} x + \\frac{a + b}{2}\\big)\\,dx$.\n\nExample: $n = 2$.\nHere $P_2(x) = \\frac12 (3x^2 - 1)$, with zeros $\\pm 1/\\sqrt{3}$, and $P_2'(x) = 3x$.\nThe weights are $2 / \\big((2/3) \\cdot 3\\big) = 1$.\nFor $f(x) = x^2$ the rule gives $2/3$, and for $f(x) = x^3$ it gives $0$, both exact.\n\nNon-example: for $n = 2$ and $f(x) = x^4$ the rule gives $2/9$ while the integral is $2/5$.\nThis is expected, since $4 \u003e 2n - 1 = 3$.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "RGGXDRCJVE",
    "kind": "definition",
    "msc": [
      "65D32",
      "41A55",
      "33C45"
    ],
    "name": "Gauss–Legendre quadrature",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Gauss–Legendre_quadrature"
      }
    ],
    "tag": "5ZA6VRDNB9",
    "uses": [
      "FP37BTP93K",
      "QFYGJVA996"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/5ZA6VRDNB9/",
  "links": [
    {
      "field": "defines",
      "target": "RGGXDRCJVE"
    },
    {
      "field": "uses",
      "target": "FP37BTP93K"
    },
    {
      "field": "uses",
      "target": "QFYGJVA996"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/5ZA6VRDNB9.md",
  "msc": [
    "65D32",
    "41A55",
    "33C45"
  ],
  "name": "Gauss–Legendre quadrature",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/5ZA/5ZA6VRDNB9.md",
  "status": null,
  "tag": "5ZA6VRDNB9",
  "uri": "m2://5ZA6VRDNB9",
  "url": "https://tamnd.github.io/math2/wiki/gauss-legendre-quadrature-definition/",
  "writing": {
    "tag": "5ZA6VRDNB9",
    "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
      }
    ]
  }
}
