Superposition Principle for Linear ODE

April 13, 2026

Problem

If y1 and y2 both solve y'' + y = 0, show that c1 y1 + c2 y2 is also a solution. Animate the sum of cos x and sin x combining into a new oscillation.

Explanation

The superposition principle

The superposition principle is the single most useful property of linear ODEs. It says:

If y1(x)y_1(x) and y2(x)y_2(x) are both solutions of a linear homogeneous ODE Ly=0L y = 0, then so is every linear combination c1y1+c2y2c_1 y_1 + c_2 y_2, for any constants c1,c2c_1, c_2.

It's the reason the general solution is built as a sum of basis solutions. It's why Fourier series make sense. It's why linear circuits decompose into modes. Almost every computational technique for linear ODEs — characteristic equation, Laplace transform, variation of parameters — leans on this principle to assemble the final answer from simpler pieces.

Why it works — linearity unwrapped

A linear operator is one that respects scalar multiplication and addition: L(c1y1+c2y2)=c1Ly1+c2Ly2.L(c_1 y_1 + c_2 y_2) = c_1 \, L y_1 + c_2 \, L y_2.

For the operator Ly=y+yL y = y'' + y (and more generally any L=ak(x)DkL = \sum a_k(x) D^{k} with D=d/dxD = d/dx), this linearity is a direct consequence of the linearity of differentiation: (c1y1+c2y2)=c1y1+c2y2(c_1 y_1 + c_2 y_2)' = c_1 y_1' + c_2 y_2', and similarly for higher derivatives.

If both y1y_1 and y2y_2 satisfy Ly=0L y = 0, then L(c1y1+c2y2)=c10+c20=0,L(c_1 y_1 + c_2 y_2) = c_1 \cdot 0 + c_2 \cdot 0 = 0, so the linear combination is also a solution.

Critical: this is for homogeneous equations Ly=0L y = 0. For non-homogeneous Ly=gL y = g, superposition holds in a slightly different form (see below).

The given problem

y+y=0y'' + y = 0

Basis: y1=cosxy_1 = \cos x, y2=sinxy_2 = \sin x (both solve the equation; see #184 for the characteristic-equation derivation).

Step-by-step verification

Consider y=c1cosx+c2sinxy = c_1 \cos x + c_2 \sin x.

y=c1sinx+c2cosxy' = -c_1 \sin x + c_2 \cos x y=c1cosxc2sinx=yy'' = -c_1 \cos x - c_2 \sin x = -y

Therefore y+y=y+y=0.  y'' + y = -y + y = 0. \; \checkmark

Linear combination works for all c1,c2Rc_1, c_2 \in \mathbb{R}. \boxed{}

Applications — why superposition rules linear theory

1. General solution = linear combination of a basis. For a linear homogeneous nn-th order ODE, the solution space is nn-dimensional (see #195 — the Wronskian is nonzero for a linearly independent basis). Every solution is y=i=1nciyiy = \sum_{i=1}^{n} c_i y_i for some basis {y1,,yn}\{y_1, \ldots, y_n\}. Without superposition, the solution space wouldn't be a vector space.

2. Non-homogeneous = particular + homogeneous. For Ly=g(x)L y = g(x), if ypy_p is any particular solution and yhy_h solves Lyh=0L y_h = 0, then yp+yhy_p + y_h solves L(yp+yh)=Lyp+Lyh=g+0=gL(y_p + y_h) = L y_p + L y_h = g + 0 = g. The general solution is yp+(all yh)y_p + (\text{all } y_h).

3. Multiple forcing terms. For Ly=g1+g2L y = g_1 + g_2, find yp,1y_{p,1} with Lyp,1=g1L y_{p,1} = g_1 and yp,2y_{p,2} with Lyp,2=g2L y_{p,2} = g_2; then yp=yp,1+yp,2y_p = y_{p,1} + y_{p,2} solves the sum. This is the principle of superposition of forces in physics (linear response to multiple sources).

4. Fourier / spectral methods. Decompose a complicated forcing into a sum of simple waves (sines/cosines, exponentials, eigenfunctions), solve for each piece, sum. Only possible because the linear operator distributes over sums.

5. Linear circuits and filters. The response of a linear circuit to a sum of inputs is the sum of responses. That's why you can break a complicated signal into frequency components, filter each, and recombine.

What breaks for non-linear ODEs

Consider y=y2y' = y^{2} (a non-linear first-order ODE). If y1y_1 and y2y_2 both solve it, their sum y1+y2y_1 + y_2 probably doesn't: (y1+y2)=y1+y2=y12+y22(y_1 + y_2)' = y_1' + y_2' = y_1^{2} + y_2^{2} but we'd need (y1+y2)=(y1+y2)2=y12+2y1y2+y22(y_1 + y_2)' = (y_1 + y_2)^{2} = y_1^{2} + 2 y_1 y_2 + y_2^{2}. Missing the cross term 2y1y22 y_1 y_2.

Non-linear ODEs have no general superposition. This is why they're so much harder — you can't build solutions from simpler pieces in a general way.

A more complete statement (general linearity)

For the linear operator L=k=0nak(x)DkL = \sum_{k=0}^{n} a_k(x) D^{k} acting on scalar-valued functions, the following are equivalent:

  1. LL is linear: L(c1y1+c2y2)=c1Ly1+c2Ly2L(c_1 y_1 + c_2 y_2) = c_1 L y_1 + c_2 L y_2 for all smooth y1,y2y_1, y_2 and scalars c1,c2c_1, c_2.
  2. The set of solutions of Ly=0L y = 0 is a vector space (closed under linear combinations).
  3. The solution set of Ly=gL y = g is an affine subspace {yp+yh:yhker(L)}\{y_p + y_h : y_h \in \text{ker}(L)\} — a shift of the vector space of homogeneous solutions.

All three statements are the formal expression of superposition at different levels of abstraction.

Wronskian recap

For two solutions y1,y2y_1, y_2 of a linear homogeneous 2nd-order ODE, Wronskian W(y1,y2)0W(y_1, y_2) \ne 0 at a point ⇒ they are linearly independent ⇒ they form a basis of the solution space ⇒ every solution is a superposition c1y1+c2y2c_1 y_1 + c_2 y_2 (see #195).

Cautionary example — superposition needs both homogeneous ingredients

Let Ly=y+yL y = y'' + y. Suppose y1=cosx+1y_1 = \cos x + 1 and y2=sinx+2y_2 = \sin x + 2. Do these satisfy Ly=0L y = 0?

Ly1=cosx+(cosx+1)=10L y_1 = -\cos x + (\cos x + 1) = 1 \ne 0. So y1y_1 is not a homogeneous solution (it's a non-homogeneous one for Ly=1L y = 1). Superposition won't give a valid homogeneous combo from these.

Moral: before applying superposition, verify each ingredient solves Ly=0L y = 0.

Initial-value problem — assembling the solution

For y+y=0y'' + y = 0 with y(0)=Ay(0) = A, y(0)=By'(0) = B: y=C1cosx+C2sinxy = C_1 \cos x + C_2 \sin x y(0)=C1=A,y(0)=C2=By(0) = C_1 = A, \quad y'(0) = C_2 = B y(x)=Acosx+Bsinx.y(x) = A \cos x + B \sin x.

Two pieces of initial data pick out one member of the 2-parameter family.

Equivalent amplitude–phase form: y(x)=Rcos(xφ),R=A2+B2,  φ=arctan(B/A).y(x) = R \cos(x - \varphi), \quad R = \sqrt{A^{2} + B^{2}}, \; \varphi = \arctan(B/A).

The sum of two sinusoids with the same frequency is another sinusoid — nothing new is added by the superposition beyond the 2D space spanned by cos,sin\cos, \sin.

Common mistakes

  • Forgetting that superposition fails for non-linear ODEs. A common bug is applying it to "Riccati" or "Bernoulli" equations without first linearising.
  • Superposing non-homogeneous solutions. Two solutions of Ly=gL y = g don't add to give another solution of Ly=gL y = g; they give L(y1+y2)=2gL(y_1 + y_2) = 2 g. The difference of two solutions of Ly=gL y = g is homogeneous.
  • Using linear combinations across different ODEs. Superposition is within one linear operator's solution space — combining solutions of different ODEs gives nothing useful.
  • Mistaking the principle for additivity of initial conditions. Be careful: the IVP Ly=0L y = 0, y(0)=Ay(0) = A, y(0)=By'(0) = B has a unique solution; superposition is about adding solutions, not about adding initial conditions.

Try it in the visualization

Slide c1c_1 and c2c_2 independently and watch y=c1cosx+c2sinxy = c_1 \cos x + c_2 \sin x shift its amplitude and phase continuously — the 2D space of solutions made visible. Toggle to see the amplitude–phase envelope R=c12+c22R = \sqrt{c_1^{2} + c_2^{2}} live-update.

Interactive Visualization

Parameters

1.50
1.00
-0.80
2.00
8.00
4.00
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day
Superposition Principle for Linear ODE | MathSpin