# Why is the most general solution of a non-homogenous linear ODE the sum of the complementary and particular solutions?

Take a linear, non-homogenous ODE:

$$Ay^{\prime\prime}(x) + By^\prime(x) + Cy(x) = f(x)$$

It is known that one can find the general solution to this equation by taking a solution to the following:

$$Ay_h^{\prime\prime}(x) + By_h^\prime(x) + Cy_h(x) = 0$$

And a particular solution of the original ODE:

$$Ay_p^{\prime\prime}(x) + By_p^\prime(x) + Cy_p(x) = f(x)$$

By adding the two together, you get the following:

$$A\Big(y_p^{\prime\prime}(x) + y_c^{\prime\prime}(x)\Big) + B\Big(y_p^\prime(x) + y_c^\prime(x)\Big) + C\Big(y_p(x) + y_c(x)\Big) = f(x)$$

Thus, it is proven that a solution to the ODE is given by $$y_p(x) + y_c(x)$$. Why, though, is this the most general solution? I'm aware the solution is made more general by the introduction of the general homogenous solution, but how do we know that there isn't a more comprehensive solution?

• This is because the LHS of the ODE is linear in $y$. If $y_1$ and $y_2$ are two solutions of the non-homogeneous ODE, their difference $y_1 - y_2$ will be a solution of the homogeneous ODE. – achille hui May 6 '19 at 0:18
• I've wondered this as well. Can you clarify @achillehui? Are you saying that because the difference of any two solutions is a solution there will be no other solutions because you just subtract them out? – Michael Stachowsky May 6 '19 at 0:34
• Err... OP, you are aware that technically the ODE presented in the first line simplifies to just $Dy = f$ if you define $D := A+B+C$ and factor, right? And similar for later equations. I imagine you meant to include derivatives in there somewhere. – Eevee Trainer May 6 '19 at 0:40
• @EeveeTrainer Haha, thanks for pointing that out - fixed. – VortixDev May 6 '19 at 0:44

To build on achille hui's point in the comments, this is to do with a larger property of linear maps. If you have a linear map $$T : V \to W$$, a point $$w \in W$$, and wish to solve $$Tx = w \tag{1}$$ for $$x \in V$$, then assuming the equation has a solution $$x_p$$, then the general solution to $$(1)$$ is given by \begin{align*} x &= x_p + x_c &\text{where } Tx_c = 0. \end{align*}
To show this property, consider a particular solution $$x_p$$ to $$(1)$$. If $$x$$ is another solution $$x$$ to $$(1)$$, then by linearity, $$T(x - x_p) = Tx - Tx_p = w - w = 0,$$ hence there must exist some $$x_c$$ satisfying $$Tx_c = 0$$ such that $$x - x_p = x_c$$, or equivalently, $$x = x_p + x_c$$. Conversely, if $$x = x_p + x_c$$, where $$x_c$$ satisfies $$Tx_c = 0$$, then by linearity, $$Tx = T(x_p + x_c) = Tx_p + Tx_c = w + 0 = w,$$ hence $$x$$ satisfies $$(1)$$ too. That is, $$x$$ satisfies $$(1)$$ if and only if it can be expressed as $$x = x_p + x_c$$ where $$Tx_c = 0$$, proving the property.
When we have a second order (or any order) linear ODE $$f(x)y'' + g(x)y' + h(x)y = r(x), \tag{2}$$ then we can define a linear operator $$T$$ from the vector space of twice differentiable functions in some neighbourhood of the initial point, to the space of real-valued functions on the aforementioned neighbourhood by $$T(y) = f \cdot y'' + g \cdot y' + h \cdot y$$ Then $$(2)$$ reduces to $$T(y) = r$$, which makes it analogous to $$(1)$$.
This property of linear maps also can be applied to matrix equations; the general solution to $$A\vec{x} = \vec{b}$$ is the general solution to $$A\vec{x} = \vec{0}$$ (aka the nullspace of $$A$$), but offset by a particular solution $$x_p$$.