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} a_{n} \frac{d^ny}{dx^n} + a_{n-1} \frac{d^{n-1}y}{dx^{n-1}} + ... + a_0 y \amp = b(x)\notag\\ \LL y\amp =b(x)\tag{9.9.1} \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.

Strategy.

The following theorem explains how you will know when you have the most general solution of these equations. The proof is simple and illustrative, it's worth reading.

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

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

This theorem is telling us first 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.

Method/Simple Examples.

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{.}\tag{9.9.3} \end{equation}

Since derivatives of exponential functions are proportional to themselves, we choose an ansatz of the form

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

Notice that in this ansatz we are solving for the constant coefficient \(C\text{,}\) not the exponent as in section 9.7. The exponent is determined by the form of the inhomogeneous term.

Substituting (9.9.4) into (9.9.3), we obtain

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

which we can solve for \(C\text{,}\) yielding \(C=1/24\text{.}\) Putting our particular solution (9.9.4) together with the general homogenous solution derived in Section 9.7, the general solution of (9.9.3) is

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

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

\begin{equation} \frac{d^2y}{dx^2} + 4y = \sin(3x)\text{.}\tag{9.9.7} \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 trigonometric 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.8} \end{equation}

which results in

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

Collecting terms, and setting the coefficients of the linearly independent functions \(\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 = C_1 \cos(2x) + C_2 \sin(2x)-\frac15\sin(3x)\text{.}\tag{9.9.13} \end{equation}

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

More General Cases.

The method above will work for any single inhomogeneous term of the form \(x^m e^{\alpha x} \cos{\beta x}\) or \(x^m e^{\alpha x} \sin{\beta x}\text{,}\) where \(m\) is a non-negative integer and \(\alpha\) and \(\beta\) are real numbers, including possibly zero, with one caveat: since, in the differential equation, you will be taking derivatives of the proposed solution in the ansatz, the proposed solution should also contain terms of the same form as the derivatives, each with its own unknown constant. For example, if the inhomogeneous term is \(x^2 \cos{3x}\text{,}\) the proposed solution should be

\begin{align} A x^2 \cos{3x} \amp + B x \cos{3x} + C \cos{3x}\notag\\ \amp + D x^2 \sin{3x} + E x \sin{3x} + F \sin{3x}\tag{9.9.14} \end{align}

and you will need to solve for all of the constants \(\left\{A, B, C, D, E, F\right\}\text{.}\) (Keep differentiating until you don't get any terms with a new form.)

It is also possible to solve equations with more complicated inhomogeneous terms as long as the inhomogeneous term can be written as a linear combination of terms of the types above \(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_p=y_{p_1}+y_{p_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_{p_i} = b_i\) for several values of the index \(i\text{.}\) Then:

\begin{align} \LL\amp = \LL (y_{p_1} + y_{p_2} +\dots)\notag\\ \amp =\LL y_{p_1} +\LL y_{p_2} + \dots\notag\\ \amp = b_1(x) + b_2(x) =\dots\notag\\ \amp =b(x)\tag{9.9.15} \end{align}

Relationship to Fourier Series and Power Series.

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”. Similarly, if the inhomogeneous term can be expanded in a power series (see Chapter 7), then this method will also work. So, we see that the method is actually quite general. Of course, if you only use a few terms of the Fourier or power series, then you will only get an approximate solution of the differential equation.