{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $K$ be a field, let $d \\ge 1$, and let $a_0, \\dots, a_{d-1} \\colon \\N \\to K$ be sequences.\nFor a sequence $u \\colon \\N \\to K$, let $Lu$ be the sequence\n$$(Lu)(n) = u_{n+d} + a_{d-1}(n)\\, u_{n+d-1} + \\cdots + a_0(n)\\, u_n .$$\nThen the following hold.\n\n1. If $Lu = 0$ and $Lv = 0$, then $L(\\alpha u + \\beta v) = 0$ for all $\\alpha, \\beta \\in K$.\n2. If $Lu = g_1$ and $Lv = g_2$, then $L(\\alpha u + \\beta v) = \\alpha g_1 + \\beta g_2$ for all $\\alpha, \\beta \\in K$.\n3. If $Lp = g$, then a sequence $u$ satisfies $Lu = g$ if and only if $u = p + h$ for a sequence $h$ with $Lh = 0$.\n\n## Remarks\n\nAll three parts follow from the linearity of $L$: $L(\\alpha u + \\beta v) = \\alpha Lu + \\beta Lv$, which one checks term by term.\nFor part 3, if $Lu = g$ then $L(u - p) = g - g = 0$, and conversely $L(p + h) = g + 0 = g$.\nExample: for $u_{n+1} - 2 u_n = 1$, the constant $p_n = -1$ is a particular solution, and the [[homogeneous|8Y28JQB0Q5]] solutions are $c\\, 2^n$, so all solutions are $c\\, 2^n - 1$.\nLinearity is necessary: for $u_{n+1} = u_n^2$, the sequence $u_n = 1$ is a solution, but $2u$ is not, since $2 \\ne 4$.\nThe same principle holds for linear differential equations; see the [[superposition principle|0F2VBPXNP9]].\n\n## Explanations\n\n### L1 human\n\nFor a linear recurrence, you can add solutions and scale them, and the result is again a solution of the matching equation.\nSo to solve an inhomogeneous recurrence, find one solution of it by any trick, then add all solutions of the homogeneous recurrence.\n\n### L2 human\n\nPart 1 says that the solutions of a homogeneous linear recurrence form a vector space over $K$.\nSince the leading coefficient is $1$, the first $d$ terms determine a solution, by the same induction as in [[uniqueness given initial values|WREYNFJHH2]]; so this space has dimension $d$.\nPart 3 says that the solutions of the inhomogeneous recurrence form an affine space, a translate of that vector space.\nThis is the base of the method of undetermined coefficients and of [[variation of parameters|QQFYC988SJ]] for difference equations.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "about": [
      "8Y28JQB0Q5"
    ],
    "kind": "statement",
    "msc": [
      "39A06"
    ],
    "name": "Superposition of solutions",
    "role": "proposition",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Superposition_principle"
      }
    ],
    "tag": "7W7VV861JW",
    "uses": [
      "8Y28JQB0Q5",
      "0G9EKM0E15"
    ]
  },
  "kind": "statement",
  "link": "https://tamnd.github.io/math2/node/7W7VV861JW/",
  "links": [
    {
      "field": "about",
      "target": "8Y28JQB0Q5"
    },
    {
      "field": "uses",
      "target": "8Y28JQB0Q5"
    },
    {
      "field": "uses",
      "target": "0G9EKM0E15"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/7W7VV861JW.md",
  "msc": [
    "39A06"
  ],
  "name": "Superposition of solutions",
  "prov": null,
  "role": "proposition",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/7W7/7W7VV861JW.md",
  "status": null,
  "tag": "7W7VV861JW",
  "uri": "m2://7W7VV861JW",
  "url": "https://tamnd.github.io/math2/wiki/superposition-of-solutions/",
  "writing": {
    "tag": "7W7VV861JW",
    "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
      }
    ]
  }
}
