{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $k \\ge 1$ and let $a = t_0 \u003c t_1 \u003c \\cdots \u003c t_k = b$ be knots.\nA *cubic spline* with these knots is a function $s \\colon [a, b] \\to \\R$ such that:\n\n1. for each $i = 1, \\dots, k$, the restriction of $s$ to $[t_{i-1}, t_i]$ is a [[polynomial function|1G0B73WPX8]] of degree at most $3$;\n2. $s$ is twice continuously differentiable on $[a, b]$.\n\nA cubic spline is *natural* if moreover $s''(a) = s''(b) = 0$.\n\n## Remarks\n\nThis is the [[spline|84TJ8KQ926]] of degree $3$.\nWriting $s_i$ for the piece on $[t_{i-1}, t_i]$, clause 2 says that $s_i(t_i) = s_{i+1}(t_i)$, $s_i'(t_i) = s_{i+1}'(t_i)$ and $s_i''(t_i) = s_{i+1}''(t_i)$ for $1 \\le i \\le k - 1$, where $'$ is the [[derivative|0V1EJCT8G6]].\nThe cubic splines with fixed knots form a vector space of dimension $k + 3$.\nGiven values at all knots, there is exactly one natural cubic spline taking them.\n\nExample: knots $-1 \u003c 0 \u003c 1$ and $s(x) = 0$ for $x \\le 0$, $s(x) = x^3$ for $x \\ge 0$.\nAt $0$ both pieces have value, first derivative and second derivative $0$, so $s$ is a cubic spline.\nIt is not natural, since $s''(1) = 6 \\ne 0$.\n\nNon-example: $s(x) = \\abs{x}$ on $[-1, 1]$ with the knots $-1 \u003c 0 \u003c 1$ satisfies clause 1, since its pieces $-x$ and $x$ are polynomials.\nIt fails clause 2: its first derivative jumps from $-1$ to $1$ at $0$.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "V42H0R3EKX",
    "kind": "definition",
    "msc": [
      "41A15",
      "65D07"
    ],
    "name": "Cubic spline",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Spline_interpolation"
      }
    ],
    "tag": "B7YND5ZVMF",
    "uses": [
      "84TJ8KQ926",
      "1G0B73WPX8",
      "0V1EJCT8G6"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/B7YND5ZVMF/",
  "links": [
    {
      "field": "defines",
      "target": "V42H0R3EKX"
    },
    {
      "field": "uses",
      "target": "84TJ8KQ926"
    },
    {
      "field": "uses",
      "target": "1G0B73WPX8"
    },
    {
      "field": "uses",
      "target": "0V1EJCT8G6"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/B7YND5ZVMF.md",
  "msc": [
    "41A15",
    "65D07"
  ],
  "name": "Cubic spline",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/B7Y/B7YND5ZVMF.md",
  "status": null,
  "tag": "B7YND5ZVMF",
  "uri": "m2://B7YND5ZVMF",
  "url": "https://tamnd.github.io/math2/wiki/cubic-spline-definition/",
  "writing": {
    "tag": "B7YND5ZVMF",
    "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
      }
    ]
  }
}
