Superposition for linear ODEs
Statement
Let \(I \subseteq \mathbb{R}\) be an interval and let \(a_0, a_1, \dots, a_{n-1} : I \to \mathbb{K}\) (with \(\mathbb{K} = \mathbb{R}\) or \(\mathbb{K} = \mathbb{C}\)) be continuous functions. Define the linear differential operator \(L : C^n(I,\mathbb{K}) \to C^0(I,\mathbb{K})\) by \[ L[y](x) = y^{(n)}(x) + a_{n-1}(x)y^{(n-1)}(x) + \cdots + a_1(x)y'(x) + a_0(x)y(x). \] Then \(L\) is a \(\mathbb{K}\)-linear map, and consequently: (i) the solution set \(\mathcal{N}(L) = \{ y \in C^n(I,\mathbb{K}) : L[y]=0 \text{ on } I \}\) of the homogeneous equation \(L[y]=0\) is a \(\mathbb{K}\)-vector subspace of \(C^n(I,\mathbb{K})\); and (ii) if \(y_1\) solves \(L[y]=f_1\) and \(y_2\) solves \(L[y]=f_2\) on \(I\), then for any scalars \(c_1,c_2 \in \mathbb{K}\), the function \(c_1y_1+c_2y_2\) solves \(L[y] = c_1f_1+c_2f_2\) on \(I\).
Why it matters
Superposition is the single fact that converts the study of linear ODEs from an analytic problem into a linear-algebraic one. Once the solution set of \(L[y]=0\) is known to be a vector space, questions of "how many independent solutions are there" and "how do I build the general solution" become questions about bases, dimension, and spanning sets — answerable with Wronskians, eigenvalue methods, and reduction of order, none of which make sense unless the solution set is closed under addition and scalar multiplication first.
It also underlies the standard strategy for inhomogeneous equations: solve the homogeneous equation for the "complementary function" \(y_c\), find any one "particular solution" \(y_p\) of \(L[y]=f\), and superposition guarantees \(y_c+y_p\) is again a solution — indeed the general solution, once dimension-counting is added (T-065, existence-uniqueness for linear ODEs).
Hypotheses
Proof
Result
Reading. Because differentiation is linear and the coefficients \(a_k(x)\) only multiply (never square or compose with) \(y\) and its derivatives, plugging a linear combination of two candidate solutions into \(L\) gives exactly the same linear combination of what \(L\) does to each one separately. Zero solutions add to zero solutions; scaled solutions stay solutions; and mixed right-hand sides combine additively too.
Scope. Applies to any linear ODE (or linear system, or linear PDE with the analogous argument) of any order \(n\), with variable or constant, real or complex coefficients, provided the equation is genuinely linear in \(y\) and its derivatives — the coefficients \(a_k\) may depend on \(x\) but not on \(y\). It does not itself say anything about existence, uniqueness, or the dimension of \(\mathcal{N}(L)\) — that is the separate content of the existence–uniqueness theorem (T-065) and the Wronskian/independence machinery.
Corollaries & converses
- Any \(\mathbb{K}\)-linear combination of finitely many solutions of \(L[y]=0\) is again a solution (immediate induction on the two-term case in Step 6).
- If \(y_p\) is any particular solution of \(L[y]=f\) and \(y_h\) ranges over \(\mathcal{N}(L)\), then \(y_p+y_h\) ranges over all solutions of \(L[y]=f\): existence of a further solution \(\tilde y\) of \(L[y]=f\) gives \(L[\tilde y - y_p]=f-f=0\) by superposition, so \(\tilde y - y_p \in \mathcal{N}(L)\), i.e. \(\tilde y = y_p + (\tilde y-y_p)\) has the claimed form. This is the "general solution = particular + complementary" recipe.
- Converse-type statement: the property "\(\mathcal{N}(L)\) is a vector space" does not conversely imply \(L\) is linear — e.g. some highly special nonlinear operators can accidentally have a solution set closed under addition on a restricted class, but this is not implied by, nor does it recover, full superposition \(L[c_1y_1+c_2y_2]=c_1L[y_1]+c_2L[y_2]\) for arbitrary scalars and arbitrary right-hand sides; the theorem is one-directional (linearity \(\Rightarrow\) superposition) and the converse is not a meaningful strengthening in general.
- Superposition extends immediately to countable/finite linear combinations \(\sum_{j=1}^m c_jy_j\) of solutions to \(L[y]=f_j\), giving a solution of \(L[y]=\sum_j c_jf_j\); this is the basis of Fourier-series and eigenfunction-expansion solution methods for linear ODEs and PDEs.
Fails without
- Nonlinearity in \(y\): for the Riccati-type equation \(y' = y^2\), both \(y\equiv 0\) and \(y(x) = -1/x\) (on \(x\gt0\)) solve the equation, but \(y_1+y_2 = -1/x\) trivially still works only because one term is zero; take instead \(y_1(x)=-1/x\) and \(y_2(x) = -1/(x-1)\) (each solving \(y'=y^2\) on suitable intervals): \((y_1+y_2)' = 1/x^2+1/(x-1)^2\) while \((y_1+y_2)^2 = 1/x^2+2/[x(x-1)]+1/(x-1)^2\), and these differ (the cross term \(2/[x(x-1)]\) has no counterpart in the derivative), so \(y_1+y_2\) does not solve \(y'=y^2\). Superposition fails.
- Nonlinearity via a nonlinear function of \(y\): for \(y''+\sin y = 0\) (the pendulum equation), the constant solution \(y_1\equiv 0\) and any nontrivial oscillatory solution \(y_2\) both solve the equation, but \(y_1+y_2=y_2\) is not a new solution built by superposition in any useful sense once you try to combine two genuinely different nonlinear pendulum solutions \(y_2,y_3\): \(\sin(y_2+y_3)\ne \sin y_2+\sin y_3\) in general, so \((y_2+y_3)''+\sin(y_2+y_3) \ne 0\).
- Coefficients secretly depending on \(y\): for \(y'+p(y)y=0\) where \(p\) genuinely depends on \(y\) (a disguised nonlinear equation dressed in linear-looking notation), the additivity argument of Step 2 breaks because \(a_k\) is no longer a fixed function of \(x\) alone when evaluated along \(y_1\) versus \(y_2\) versus \(y_1+y_2\).
Common errors
- Applying superposition to add two solutions of different inhomogeneous equations without adjusting the right-hand side — forgetting that \(L[y_1+y_2]=f_1+f_2\), not \(f_1\) or \(f_2\) alone, so \(y_1+y_2\) solves \(L[y]=f_1+f_2\), which may not be the equation the student actually wants.
- Assuming superposition holds for any ODE that "looks tidy", e.g. applying it to \(y'=y^2\) or \(yy''=1\) without checking linearity first — the theorem's hypothesis (linearity in \(y,y',\dots,y^{(n)}\) with coefficients depending only on \(x\)) is not optional.
- Confusing superposition of solutions with superposition of initial conditions: adding two solutions \(y_1,y_2\) of the same linear IVP with different initial data gives a solution of the ODE with the sum of the initial data, not a new solution of the original IVP.
- Forgetting the particular-plus-complementary structure and believing that any two solutions of \(L[y]=f\) (with the same nonzero \(f\)) can be added to get another solution of \(L[y]=f\): in fact \(L[y_1+y_2]=2f\ne f\) unless \(f=0\); only their difference stays in \(\mathcal{N}(L)\).
- Treating "the coefficients are constants" as a hypothesis of the theorem — superposition needs only that the \(a_k(x)\) do not depend on \(y\); variable, non-constant coefficients are perfectly allowed.
Discussion
Superposition is really a one-line consequence of recognising \(L\) as a linear map between function spaces — the ODE-specific content is entirely in verifying that differentiation and pointwise multiplication by continuous functions preserve linearity, which is why the proof above is short but not vacuous: Step 4 is doing real work in confirming that the algebra of Steps 1–3 takes place inside a well-defined codomain \(C^0(I,\mathbb{K})\).
Historically, the recognition that solutions of linear differential equations could be combined goes back to the study of linear recurrences and the algebra of "operators" \(D=\frac{d}{dx}\) in the 18th and 19th centuries (Euler, Lagrange, and later the operational calculus of Heaviside), long before the formal language of vector spaces existed; the modern statement as "the kernel of a linear map is a subspace" is a 20th-century abstraction of what physicists and engineers had already been doing when they added two normal modes of a vibrating string or two solutions of a linear circuit equation.
The theorem is the entry point to an entire toolbox: once \(\mathcal{N}(L)\) is known to be a vector space, the natural next questions are its dimension (answered by the existence–uniqueness theorem for the associated IVP, giving \(\dim\mathcal{N}(L)=n\) for an \(n\)th-order equation on an interval where the \(a_k\) are continuous) and how to certify a spanning set is a basis (the Wronskian test). Superposition alone says nothing about dimension or independence — it only supplies the ambient linear structure in which those later theorems operate.
A subtlety worth flagging for more careful treatments: superposition as stated is a statement about the operator \(L\) acting on a fixed function space \(C^n(I,\mathbb{K})\); it says nothing about whether a particular linear combination \(c_1y_1+c_2y_2\) satisfies any auxiliary conditions (boundary conditions, initial conditions, integrability, decay at infinity) that may have been imposed alongside \(L[y]=f\). Superposition is compatible with linear boundary conditions (if \(B_j\) is a linear functional such as \(B_j[y]=y(a)\) or \(\int_a^b y\), then \(B_j[c_1y_1+c_2y_2]=c_1B_j[y_1]+c_2B_j[y_2]\) too), but fails immediately for nonlinear side conditions such as \(y(a)^2=1\), which is a common trap in boundary value problems.
Worked examples
Problems
- Show directly, without quoting the theorem, that if \(y_1,y_2\) solve \(y''+p(x)y'+q(x)y=0\) then so does \(y_1-y_2\).
Solution
Write \(y_1-y_2 = y_1+(-1)y_2\). Compute \((y_1-y_2)'' + p(x)(y_1-y_2)'+q(x)(y_1-y_2) = (y_1''+py_1'+qy_1) - (y_2''+py_2'+qy_2) = 0-0=0\), using linearity of differentiation to distribute the derivatives and the fact that both bracketed terms vanish by hypothesis. Hence \(y_1-y_2\) also solves the equation — the special case \(c_1=1,c_2=-1\) of superposition. - Let \(L[y]=y''+4y\). Given that \(y_1=\cos 2x\) and \(y_2=\sin 2x\) both solve \(L[y]=0\), write down (without further differentiating) a solution satisfying \(y(0)=3\).
Solution
By superposition, \(y=c_1\cos 2x+c_2\sin 2x\) solves \(L[y]=0\) for any \(c_1,c_2\). Imposing \(y(0)=c_1\cos0+c_2\sin0=c_1=3\) forces \(c_1=3\); \(c_2\) is unconstrained by this single condition, e.g. \(y=3\cos 2x\) (taking \(c_2=0\)) works, and more generally \(y=3\cos 2x+c_2\sin 2x\) for any \(c_2\in\mathbb{R}\). - Explain precisely why superposition does not apply to \(y'=y^2+x\), and exhibit two solutions \(y_1,y_2\) (numerically or qualitatively described) whose sum fails to solve the equation.
Solution
The equation is nonlinear because of the \(y^2\) term: writing \(L[y]=y'-y^2-x\), we get \(L[y_1+y_2] = y_1'+y_2' -(y_1+y_2)^2-x = (y_1'-y_1^2-x)+(y_2'-y_2^2-x) -2y_1y_2+x = L[y_1]+L[y_2] -2y_1y_2+x\), which differs from \(L[y_1]+L[y_2]\) by the leftover terms \(-2y_1y_2+x\) unless these vanish identically. Concretely if \(y_1,y_2\) are two distinct (non-constant, nonzero) solutions of this Riccati equation, \(-2y_1(x)y_2(x)+x\) is generically not the zero function, so \(y_1+y_2\) is not a solution. The failure traces directly to the hypothesis "linear in \(y\)" being violated. - Let \(L[y]=y'''-2y''+y'\) and suppose \(y_1\) solves \(L[y]=e^x\) while \(y_2\) solves \(L[y]=x\). Find, in terms of \(y_1,y_2\), a solution of \(L[y]=3e^x-2x\), and justify using the theorem.
Solution
By part (ii) of the theorem with \(c_1=3,c_2=-2\), \(L[3y_1-2y_2] = 3L[y_1]-2L[y_2] = 3e^x-2x\), so \(y=3y_1-2y_2\) is a solution of \(L[y]=3e^x-2x\). No new integration is required — only linear combination of the already-known particular solutions with matching coefficients on the right-hand side. - A student claims: "Since \(y=0\) always solves any homogeneous linear ODE \(L[y]=0\), and since \(y=0\) also 'solves' \(y'=\sqrt{y}\) trivially, superposition must apply to \(y'=\sqrt{y}\) too, because \(0+y_2=y_2\) for any other solution \(y_2\)." Identify the flaw in this reasoning.
Solution
The flaw is that superposition is a claim about every pair of solutions and every pair of scalars, not merely the trivial case where one of the two functions being added is the zero function (for which any operator, linear or not, satisfies \(L[0+y_2]=L[y_2]\) trivially — this says nothing about linearity). To test superposition properly one must add two nonzero, distinct solutions: e.g. \(y_1(x)=x^2/4\) solves \(y'=\sqrt y\) (for \(x\ge0\)), and so does any shifted version \(y_2(x) = (x-a)^2/4\) for \(x\ge a\); but \((y_1+y_2)' = x/2+(x-a)/2\) while \(\sqrt{y_1+y_2} = \sqrt{(x^2+(x-a)^2)/4}\), and these are not equal in general, so \(y_1+y_2\) fails to solve \(y'=\sqrt y\). The equation \(y'=\sqrt y\) is nonlinear, so the hypothesis of the theorem is violated regardless of the accidental zero solution.