Skip to main content

Section 9.9 Constant Coefficients, Inhomogeneous

Form of the equation.

An \(n\)th order linear differential equation with constant coefficients is inhomogeneous if it has a nonzero “source” or “forcing function,” i.e. if it has a term that does NOT involve the unknown function. We will call this source \(b(x)\text{.}\) The form of these equations is:

\begin{align} \frac{d^ny}{dx^n} + a_{n-1} \frac{d^{n-1}y}{dx^{n-1}} + ... + a_0 y \amp = b(x)\tag{9.9.1}\\ \LL y\amp =b(x)\tag{9.9.2} \end{align}

In the second form for these equations, we have rewritten all the messy derivative information as a linear differential operator \(\LL\) so that it is easier to see the important steps of the algebra below.


The following theorem will suggest a strategy for solving this differential equation. The proof is simple and illustrative, it's worth reading.

The particular solution satisfies \(\LL y_p=b(x)\) and the general solution of the homogeneous equation satisfies \(\LL y_h=0\text{.}\) Since the differential operator \(\LL\) is linear (see Section 9.5), it is straightforward to see that:

\begin{align} \LL (y_p+y_h) \amp =\LL y_p + \LL y_h\notag\\ \amp = b(x)+0\notag\\ \amp = b(x)\tag{9.9.3} \end{align}

This theorem is telling us to solve the homogeneous equation, which we know has \(n\) linearly independent solutions. The general solution will have \(n\) undetermined coefficients. Then we find one particular solution and add this and we're done.


So how do we find a particular solution to an inhomogenous ODE with constant coefficients? The general case is difficult and beyond the scope of this book. But it is easy to find particular solutions for the special cases that come up most often in physics. We will illustrate the method with examples.

Consider the ODE

\begin{equation} \frac{d^2y}{dx^2} + \frac{dy}{dx} - 6 y = e^{5x}\text{.}\label{ExI1}\tag{9.9.4} \end{equation}

Since derivatives of exponential functions are proportional to themselves, we guess a solution of the form

\begin{equation} y_p = C e^{5x}\text{.}\label{ExI1G}\tag{9.9.5} \end{equation}

Substituting (9.9.5) into (9.9.4), we obtain

\begin{equation} (25 C + 5 C - 6C) \, e^{5x} = e^{5x}\tag{9.9.6} \end{equation}

which we can solve for \(C\text{,}\) yielding \(C=1/24\text{.}\) Be careful when implementing this method, as we are here solving for the constant coefficient, not the exponent as before. Putting our particular solution (9.9.5) together with the general homogenous solution derived in the previous section 9.7, the general solution of (9.9.4) is

\begin{equation} y = \frac{1}{24} e^{5x} + C_1 e^{-3x} + C_2 e^{2x}\tag{9.9.7} \end{equation}

Source terms that are trig functions are similar, again recalling Euler's formula. Consider the ODE

\begin{equation} \frac{d^2y}{dx^2} + 4y = \sin(3x)\text{.}\label{ExI3}\tag{9.9.8} \end{equation}

The trick here is to recognize that \(\sin(3x)\) involves both of \(e^{\pm3ix}\text{,}\) so we had better incorporate both into our Ansatz. However, we can do so by using trig functions, rather than exponentials. Thus, we try a particular solution of the form

\begin{equation} y_p = A \sin(3x) + B \cos(3x)\tag{9.9.9} \end{equation}

which results in

\begin{equation} -9A \sin(3x) -9B \cos(3x) + 4A \sin(3x) + 4B \cos(3x) = \sin(3x)\text{.}\tag{9.9.10} \end{equation}

Collecting terms, and setting the coefficients of \(\sin(3x)\) and \(\cos(3x)\) separately to zero results in

\begin{align} -9A + 4A \amp = 1\tag{9.9.11}\\ -9B + 4B \amp = 0\tag{9.9.12} \end{align}

so that \(A=-1/5\text{,}\) \(B=0\) and our general solution is

\begin{equation} y = -\frac15\sin(3x) + C_1 \cos(2x) + C_2 \sin(2x)\text{.}\tag{9.9.13} \end{equation}

Typically, the particular solution will involve both sines and cosines. (Why doesn't that happen here?)

Relationship to Fourier Series.

It is easy to solve equations with more complicated inhomogeneous terms as long as the inhomogeneous term can be written as a sum of terms of this simple type \(b(x)=b_1(x)+b_2(x)+\dots\text{.}\) We just solve an inhomogeneous equation for each of the terms \(b_i\) separately and add the solutions \(y=y_1+y_2+\dots\text{.}\) Notice how the linearity of the differential operator \(\LL\) guarantees that this method works in the following simple proof: Suppose \(\LL y_i = b_i\) for several values of the index \(i\text{.}\) Then:

\begin{align} \LL\amp = \LL (y_1 + y_2 +\dots)\notag\\ \amp =\LL y_1 +\LL y_2 + \dots\notag\\ \amp = b_1(x) + b_2(x) =\dots\notag\\ \amp =b(x)\tag{9.9.14} \end{align}

If the inhomogeneous term is a periodic function, then we can expand it in a Fourier series (see Chapter 10). Once you learn to do Fourier Series, the method you have just learned becomes much more general, it applies to any periodic “source” or “forcing function”.