$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$

# 2.4: The Method of Undetermined Coefficient

• • Contributed by William F. Trench
• Andrew G. Cowles Distinguished Professor Emeritus (Mathamatics) at Trinity University

$$\newcommand{\vecs}{\overset { \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

In this section we consider the constant coefficient equation

\begin{equation}\label{eq:2.4.1}
ay''+by'+cy=e^{\alpha x}G(x),
\end{equation}

where $$\alpha$$ is a constant and $$G$$ is a polynomial.

From Theorem $$(2.3.2)$$, the general solution of (\ref{eq:2.4.1}) is $$y=y_p+c_1y_1+c_2y_2$$, where $$y_p$$ is a particular solution of (\ref{eq:2.4.1}) and $$\{y_1,y_2\}$$ is a fundamental set of solutions of the complementary equation

\begin{eqnarray*}
ay''+by'+cy=0.
\end{eqnarray*}

In Section $$2.2$$ we showed how to find $$\{y_1,y_2\}$$. In this section we'll show how to find $$y_p$$. The procedure that we'll use is called $$\textcolor{blue}{\mbox{the method of undetermined coefficients}}$$.

Our first example is similar to Exercises $$(2.3E.16)$$ to $$(2.3E.21)$$.

### Example $$\PageIndex{1}$$

Find a particular solution of

\begin{equation}\label{eq:2.4.2}
y''-7y'+12y=4e^{2x}.
\end{equation}

Then find the general solution.

Substituting $$y_p=Ae^{2x}$$ for $$y$$ in (\ref{eq:2.4.2}) will produce a constant multiple of $$Ae^{2x}$$ on the left side of (\ref{eq:2.4.2}), so it may be possible to choose $$A$$ so that $$y_p$$ is a solution of (\ref{eq:2.4.2}). Let's try it; if $$y_p=Ae^{2x}$$ then

\begin{eqnarray*}
y_p''-7y_p'+12y_p=4Ae^{2x}-14Ae^{2x}+12Ae^{2x}=2Ae^{2x}=4e^{2x}
\end{eqnarray*}

if $$A=2$$. Therefore $$y_p=2e^{2x}$$ is a particular solution of (\ref{eq:2.4.2}). To find the general solution, we note that the characteristic polynomial of the complementary equation

\begin{equation}\label{eq:2.4.3}
y''-7y'+12y=0
\end{equation}

is $$p(r)=r^2-7r+12=(r-3)(r-4)$$, so $$\{e^{3x},e^{4x}\}$$ is a fundamental set of solutions of (\ref{eq:2.4.3}). Therefore the general solution of (\ref{eq:2.4.2}) is

\begin{eqnarray*}
y=2e^{2x}+c_1e^{3x}+c_2e^{4x}.
\end{eqnarray*}

### Example $$\PageIndex{2}$$

Find a particular solution of

\begin{equation}\label{eq:2.4.4}
y''-7y'+12y=5e^{4x}.
\end{equation}

Then find the general solution.

Fresh from our success in finding a particular solution of \ref{eq:2.4.2} (where we chose $$y_p=Ae^{2x}$$ because the right side of \ref{eq:2.4.2} is a constant multiple of $$e^{2x}$$) it may seem reasonable to try $$y_p=Ae^{4x}$$ as a particular solution of \ref{eq:2.4.4}. However, this won't work, since we saw in Example $$(2.4.1)$$ that $$e^{4x}$$ is a solution of the complementary equation \ref{eq:2.4.3}, so substituting $$y_p=Ae^{4x}$$ into the left side of \ref{eq:2.4.4} produces zero on the left, no matter how we choose $$A$$. To discover a suitable form for $$y_p$$, we use the same approach that we used in Section $$2.2$$ to find a second solution of

\begin{eqnarray*}
ay''+by'+cy=0
\end{eqnarray*}

in the case where the characteristic equation has a repeated real root: we look for solutions of \ref{eq:2.4.4} in the form $$y=ue^{4x}$$, where $$u$$ is a function to be determined. Substituting

\begin{equation}\label{eq:2.4.5}
\end{equation}

into \ref{eq:2.4.4} and canceling the common factor $$e^{4x}$$ yields

\begin{eqnarray*}
(u''+8u'+16u)-7(u'+4u)+12u=5,
\end{eqnarray*}

or

\begin{eqnarray*}
u''+u'=5.
\end{eqnarray*}

By inspection we see that $$u_p=5x$$ is a particular solution of this equation, so $$y_p=5xe^{4x}$$ is a particular solution of \ref{eq:2.4.4}. Therefore

\begin{eqnarray*}
y=5xe^{4x}+c_1e^{3x}+c_2e^{4x}
\end{eqnarray*}

is the general solution.

### Example $$\PageIndex{3}$$

Find a particular solution of

\begin{equation}\label{eq:2.4.6}
y''-8y'+16y=2e^{4x}.
\end{equation}

Since the characteristic polynomial of the complementary equation

\begin{equation}\label{eq:2.4.7}
y''-8y'+16y=0
\end{equation}

is $$p(r)=r^2-8r+16=(r-4)^2$$, both $$y_1=e^{4x}$$ and $$y_2=xe^{4x}$$ are solutions of \ref{eq:2.4.7}. Therefore \ref{eq:2.4.6) does not have a solution of the form $$y_p=Ae^{4x}$$ or $$y_p=Axe^{4x}$$. As in Example $$2.4.2)$$, we look for solutions of \ref{eq:2.4.6} in the form $$y=ue^{4x}$$, where $$u$$ is a function to be determined. Substituting from \ref{eq:2.4.5} into \ref{eq:2.4.6} and canceling the common factor $$e^{4x}$$ yields

\begin{eqnarray*}
(u''+8u'+16u)-8(u'+4u)+16u=2,
\end{eqnarray*}

or

\begin{eqnarray*}
u''=2.
\end{eqnarray*}

Integrating twice and taking the constants of integration to be zero shows that $$u_p=x^2$$is a particular solution of this equation, so $$y_p=x^2e^{4x}$$ is a particular solution of \ref{eq:2.4.4}. Therefore

\begin{eqnarray*}
y=e^{4x}(x^2+c_1+c_2x)
\end{eqnarray*}

is the general solution.

The preceding examples illustrate the following facts concerning the form of a particular solution $$y_p$$ of a constant coefficient equation

\begin{eqnarray*}
ay''+by'+cy=ke^{\alpha x},
\end{eqnarray*}

where $$k$$ is a nonzero constant:

(a) If $$e^{\alpha x}$$ isn't a solution of the complementary equation

\begin{equation}\label{eq:2.4.8}
ay''+by'+cy=0,
\end{equation}

then $$y_p=Ae^{\alpha x}$$, where $$A$$ is a constant. (See Example $$(2.4.1)$$.)

(b) If $$e^{\alpha x}$$ is a solution of \ref{eq:2.4.8} but $$xe^{\alpha x}$$ is not, then $$y_p=Axe^{\alpha x}$$, where $$A$$ is a constant. (See Example $$(2.4.2)$$.)

(c) If both $$e^{\alpha x}$$ and $$xe^{\alpha x}$$ are solutions of \ref{eq:2.4.8}, then $$y_p=Ax^2e^{\alpha x}$$, where $$A$$ is a constant. (See Example $$(2.4.3)$$.)

See Exercise $$(2.4E.30)$$ for the proofs of these facts.

In all three cases you can just substitute the appropriate form for $$y_p$$ and its derivatives directly into

\begin{eqnarray*}
ay_p''+by_p'+cy_p=ke^{\alpha x},
\end{eqnarray*}

and solve for the constant $$A$$, as we did in Example $$(2.4.1)$$. (See Exercises $$(2.4E.31)$$ to $$(2.4E.33)$$.) However, if the equation is

\begin{eqnarray*}
ay''+by'+cy=k e^{\alpha x}G(x),
\end{eqnarray*}

where $$G$$ is a polynomial of degree greater than zero, we recommend that you use the substitution $$y=ue^{\alpha x}$$ as we did in Examples $$(2.4.2)$$ and $$(2.4.3)$$. The equation for $$u$$ will turn out to be

\begin{equation}\label{eq:2.4.9}
au''+p'(\alpha)u'+p(\alpha)u=G(x),
\end{equation}

where $$p(r)=ar^2+br+c$$ is the characteristic polynomial of the complementary equation and $$p'(r)=2ar+b$$ (Exercise $$(2.4E.30)$$); however, you shouldn't memorize this since it's easy to derive the equation for $$u$$ in any particular case. Note, however, that if $$e^{\alpha x}$$ is a solution of the complementary equation then $$p(\alpha)=0$$, so \ref{eq:2.4.9} reduces to

\begin{eqnarray*}
au''+p'(\alpha)u'=G(x),
\end{eqnarray*}

while if both $$e^{\alpha x}$$ and $$xe^{\alpha x}$$ are solutions of the complementary equation then $$p(r)=a(r-\alpha)^2$$ and $$p'(r)=2a(r-\alpha)$$, so $$p(\alpha)=p'(\alpha)=0$$ and \ref{eq:2.4.9} reduces to

\begin{eqnarray*}
au''=G(x).
\end{eqnarray*}

### Example $$\PageIndex{4}$$

Find a particular solution of

\begin{equation}\label{eq:2.4.10}
y''-3y'+2y=e^{3x}(-1+2x+x^2).
\end{equation}

Substituting

\begin{eqnarray*}
\end{eqnarray*}

into \ref{eq:2.4.10} and canceling $$e^{3x}$$ yields

\begin{eqnarray*}
(u''+6u'+9u)-3(u'+3u)+2u=-1+2x+x^2,
\end{eqnarray*}

or

\begin{equation}\label{eq:2.4.11}
u''+3u'+2u=-1+2x+x^2.
\end{equation}

As in Example $$(2.3.2)$$, in order to guess a form for a particular solution of \ref{eq:2.4.11}, we note that substituting a second degree polynomial $$u_p=A+Bx+Cx^2$$ for $$u$$ in the left side of \ref{eq:2.4.11} produces another second degree polynomial with coefficients that depend upon $$A$$, $$B$$, and $$C$$; thus,

\begin{eqnarray*}
\end{eqnarray*}

If $$u_p$$ is to satisfy \ref{eq:2.4.11}, we must have

\begin{eqnarray*}
u_p''+3u_p'+2u_p&=&2C+3(B+2Cx)+2(A+Bx+Cx^2)\\
&=&(2C+3B+2A)+(6C+2B)x+2Cx^2=-1+2x+x^2.
\end{eqnarray*}

Equating coefficients of like powers of $$x$$ on the two sides of the last equality yields

\begin{eqnarray*}
\begin{array}{rcr}
2C&=&1\phantom{.}\\
2B+6C&=&2\phantom{.}\\
2A+3B+2C&=& -1.
\end{array}
\end{eqnarray*}

Solving these equations for $$C$$, $$B$$, and $$A$$ (in that order) yields $$C=1/2,B=-1/2,A=-1/4$$. Therefore

\begin{eqnarray*}
u_p=-{1\over4}(1+2x-2x^2)
\end{eqnarray*}

is a particular solution of \ref{eq:2.4.11}, and

\begin{eqnarray*}
y_p=u_pe^{3x}=-{e^{3x}\over4}(1+2x-2x^2)
\end{eqnarray*}

is a particular solution of \ref{eq:2.4.10}.

### Example $$\PageIndex{5}$$

Find a particular solution of

\begin{equation}\label{eq:2.4.12}
y''-4y'+3y=e^{3x}(6+8x+12x^2).
\end{equation}

Substituting

\begin{eqnarray*}
\end{eqnarray*}

into \ref{eq:2.4.12} and canceling $$e^{3x}$$ yields

\begin{eqnarray*}
(u''+6u'+9u)-4(u'+3u)+3u=6+8x+12x^2,
\end{eqnarray*}

or

\begin{equation}\label{eq:2.4.13}
u''+2u'=6+8x+12x^2.
\end{equation}

There's no $$u$$ term in this equation, since $$e^{3x}$$ is a solution of the complementary equation for \ref{eq:2.4.12}. (See

Exercise $$(2.4E.30)$$.) Therefore \ref{eq:2.4.13} does not have a particular solution of the form $$u_p=A+Bx+Cx^2$$ that we used successfully in Example $$(2.4.4)$$, since with this choice of $$u_p$$,

\begin{eqnarray*}
u_p''+2u_p'=2C+(B+2Cx)
\end{eqnarray*}

can't contain the last term ($$12x^2$$) on the right side of \ref{eq:2.4.13}. Instead, let's try $$u_p=Ax+Bx^2+Cx^3$$ on the grounds that

\begin{eqnarray*}
\end{eqnarray*}

together contain all the powers of $$x$$ that appear on the right side of \ref{eq:2.4.13}.

Substituting these expressions in place of $$u'$$ and $$u''$$ in \ref{eq:2.4.13} yields

\begin{eqnarray*}
(2B+6Cx)+2(A+2Bx+3Cx^2)=(2B+2A)+(6C+4B)x+6Cx^2=6+8x+12x^2.
\end{eqnarray*}

Comparing coefficients of like powers of $$x$$ on the two sides of the last equality shows that $$u_p$$ satisfies \ref{eq:2.4.13} if

\begin{eqnarray*}
\begin{array}{rcr}
6C&=&12\phantom{.}\\
4B+6C&=&8\phantom{.}\\
2A+2B\phantom{+6u_2}&=&6.
\end{array}
\end{eqnarray*}

Solving these equations successively yields $$C=2$$, $$B=-1$$, and $$A=4$$. Therefore

\begin{eqnarray*}
u_p=x(4-x+2x^2)
\end{eqnarray*}

is a particular solution of \ref{eq:2.4.13}, and

\begin{eqnarray*}
y_p=u_pe^{3x}=xe^{3x}(4-x+2x^2)
\end{eqnarray*}

is a particular solution of \ref{eq:2.4.12}.

### Example $$\PageIndex{6}$$

Find a particular solution of

\begin{equation}\label{eq:2.4.14}
4y''+4y'+y=e^{-x/2}(-8+48x+144x^2).
\end{equation}

Substituting

\begin{eqnarray*}
\end{eqnarray*}

into \ref{eq:2.4.14} and canceling $$e^{-x/2}$$ yields

\begin{eqnarray*}
4\left(u''-u'+{u\over4}\right)+4\left(u'-{u\over2}\right)+u=4u''=-8+48x+144x^2,
\end{eqnarray*}

or

\begin{equation}\label{eq:2.4.15}
u''=-2+12x+36x^2,
\end{equation}

which does not contain $$u$$ or $$u'$$ because $$e^{-x/2}$$ and $$xe^{-x/2}$$ are both solutions of the complementary equation. (See Exercise $$(2.4E.30)$$.) To obtain a particular solution of \ref{eq:2.4.15} we integrate twice, taking the constants of integration to be zero; thus,

\begin{eqnarray*}
\end{eqnarray*}

Therefore

\begin{eqnarray*}
y_p=u_pe^{-x/2}=x^2e^{-x/2}(-1+2x+3x^2)
\end{eqnarray*}

is a particular solution of \ref{eq:2.4.14}.

## Summary

The preceding examples illustrate the following facts concerning particular solutions of a constant coefficient equation of the form

\begin{eqnarray*}
ay''+by'+cy=e^{\alpha x}G(x),
\end{eqnarray*}

where $$G$$ is a polynomial (see Exercise $$(2.4E.30)$$):

(a) If $$e^{\alpha x}$$ isn't a solution of the complementary equation

\begin{equation}\label{eq:2.4.16}
ay''+by'+cy=0,
\end{equation}

then $$y_p=e^{\alpha x}Q(x)$$, where $$Q$$ is a polynomial of the same degree as $$G$$. (See Example $$(2.4.4)$$).

(b) If $$e^{\alpha x}$$ is a solution of \ref{eq:2.4.16} but $$xe^{\alpha x}$$ is not, then $$y_p=xe^{\alpha x}Q(x)$$, where $$Q$$ is a polynomial of the same degree as $$G$$. (See Example $$(2.4.5)$$.)

(c) If both $$e^{\alpha x}$$ and $$xe^{\alpha x}$$ are solutions of \ref{eq:2.4.16}, then $$y_p=x^2e^{\alpha x}Q(x)$$, where $$Q$$ is a polynomial of the same degree as $$G$$. (See Example $$(2.4.6)$$.)

In all three cases, you can just substitute the appropriate form for $$y_p$$ and its derivatives directly into

\begin{eqnarray*}
ay_p''+by_p'+cy_p=e^{\alpha x}G(x),
\end{eqnarray*}

and solve for the coefficients of the polynomial $$Q$$. However, if you try this you will see that the computations are more tedious than those that you encounter by making the substitution $$y=ue^{\alpha x}$$ and finding a particular solution of the resulting equation for $$u$$. (See Exercises $$(2.4E.34)$$ to $$(2.4E.36)$$.) In Case (a) the equation for $$u$$ will be of the form

\begin{eqnarray*}
au''+p'(\alpha)u'+p(\alpha)u=G(x),
\end{eqnarray*}

with a particular solution of the form $$u_p=Q(x)$$, a polynomial of the same degree as $$G$$, whose coefficients can be found by the method used in Example $$(2.4.4)$$. In Case (b) the equation for $$u$$ will be of the form

\begin{eqnarray*}
au''+p'(\alpha)u'=G(x)
\end{eqnarray*}

(no $$u$$ term on the left), with a particular solution of the form $$u_p=xQ(x)$$, where $$Q$$ is a polynomial of the same degree as $$G$$ whose coefficents can be found by the method used in Example $$(2.4.5)$$. In Case (c) the equation for $$u$$ will be of the form

\begin{eqnarray*}
au''=G(x)
\end{eqnarray*}

with a particular solution of the form $$u_p=x^2Q(x)$$ that can be obtained by integrating $$G(x)/a$$ twice and taking the constants of integration to be zero, as in Example $$(2.4.6)$$.

## Using the Principle of Superposition

The next example shows how to combine the method of undetermined coefficients and Theorem $$(2.3.3)$$, the principle of superposition.

### Example $$\PageIndex{7}$$

Find a particular solution of

\begin{equation}\label{eq:2.4.17}
y''-7y'+12y=4e^{2x}+5e^{4x}.
\end{equation}

In Example $$(2.4.1)$$ we found that $$y_{p_1}=2e^{2x}$$ is a particular solution of

\begin{eqnarray*}
y''-7y'+12y=4e^{2x},
\end{eqnarray*}

and in Example $$(2.4.2)$$ we found that $$y_{p_2}=5xe^{4x}$$ is a particular solution of

\begin{eqnarray*}
y''-7y'+12y=5e^{4x}.
\end{eqnarray*}

Therefore the principle of superposition implies that $$y_p=2e^{2x}+5xe^{4x}$$ is a particular solution of \ref{eq:2.4.17}.