# The Method of Undetermined Coefficients

We will now look at a method for solving second order linear nonhomogenous differential equations, for $a, b, c \in \mathbb{R}$, in the form:

(1)

Note that the corresponding second order linear homogenous differential equation $a \frac{d^2y}{dt^2} + b \frac{dy}{dt} + cy = 0$ has constant coefficients. This method can be used when the coefficients of the corresponding second order linear homogenous differential equation does not have constant coefficients, but it is much more difficult to apply in most cases.

Recall from the Second Order Nonhomogenous Differential Equations page that the general solution to $\frac{d^2y}{dt^2} + p(t) \frac{dy}{dt} + q(t) y = g(t)$ is of the form $y = Cy_1(t) + Dy_2(t) + Y(t)$ where $y = Y(t)$ is a particular solution to this differential equation and $y = y_1(t)$ and $y = y_2(t)$ form a fundamental set of solutions to $\frac{d^2 y}{dt^2} + p(t) \frac{dy}{dt} + q(t) y = 0$. Solving the corresponding second order linear homogenous differential equation whose coefficients are constant is simple, and we will sometimes denote this solution (known as the complementary solution) by $y_h(t) = Cy_1(t) + Dy_2(t)$ (where the subscript $h$ stands for “homogenous). Thus, the difficult arises in finding a particular solution $Y(t)$ (which we will sometimes denote as $y_p$ where the subscript $p$ stands for “particular”) to the second order linear nonhomogenous differential equation.

One such technique for doing so is known as **The Method of Undetermined Coefficients** which we’ll look at now. We first find the general solution to the corresponding second order linear homogenous differential equation $a\frac{d^2y}{dt^2} + b \frac{dy}{dt} + cy = 0$. We will then check to make sure that the function $g(t)$ is in a particular form, namely, $g(t)$ is being a function that involves only exponential, sine, and cosine functions or polynomials alongside combinations of all of these.

If $g(t)$ can be written as $g(t) = g_1(t) + g_2(t) + … + g_n(t)$ where each $g_i(t)$ for $i = 1, 2, …, n$ is of the simplest forms mentioned above, then we will have to reduce the problem to solving each of the following second order linear nonhomogenous differential equations:

(2)

We then assume that $Y_i(t)$ is a particular solution to these differential equations, where $Y_i(t)$ is of the corresponding form containing exponential, sine, cosine, or polynomial functions. If necessary, we can multiply by $Y_i(t)$ by $t$ or $t^2$ to prevent duplication with the form of the solutions in the corresponding second order linear homogenous differential equation. If we let $s = 0, 1, 2$ be the smallest nonnegative integer such that none of the terms $Y_i(t)$ are a solution to the corresponding homogenous differential equation, then the following table gives us the forms to assume $Y_i(t)$ to be (where the $A$‘s and $B$‘s are the undetermined coefficients):

Form of $g_i(t)$ | Form of $Y_i(t)$ |
---|---|

$a_0 + a_1t + a_2t^2 + … + a_nt^n$ | $t^s (A_0 + A_1t + A_2t + … + A_n)$ |

$(a_0 + a_1t + a_2t^2 + … + a_nt^n)e^{\alpha t}$ | $t^s (A_0 + A_1t + A_2t + … + A_n)e^{\alpha t}$ |

$(a_0 + a_1t + a_2t^2 + … + a_nt^n ) \left\{\begin{matrix} \sin \beta t\\ \cos \beta t \end{matrix}\right.$ | $t^s [(A_0 + A_1t + A_2t + … + A_n)\cos \beta t + (B_0 + B_1t + B_2t + … + B_n)\sin \beta t]$ |

$e^{\alpha t}\left\{\begin{matrix} \sin \beta t\\ \cos \beta t \end{matrix}\right.$ | $e^{\alpha t}[\cos \beta t + \sin \beta t]$ |

$(a_0 + a_1t + a_2t^2 + … + a_nt^n)e^{\alpha t} \left\{\begin{matrix} \sin \beta t\\ \cos \beta t \end{matrix}\right.$ | $t^s [(A_0 + A_1t + A_2t + … + A_n)\cos \beta t + (B_0 + B_1t + B_2t + … + B_n) \sin \beta t]e^{\alpha t}$. |

To obtain a particular solution to our main second order linear nonhomogenous differential equation, we sum up the $Y_i(t)$‘s for $i = 1, 2, …, n$, that is:

(3)

Therefore the corresponding general solution to this second order linear nonhomogenous differential equation $\frac{d^2y}{dt^2} + p(t) \frac{dy}{dt} + q(t) y = g(t)$ will be of the form:

(4)

Let’s now look at an example of using the method of undetermined coefficients.

## Example 1

**Solve the second order linear nonhomogenous differential equation $\frac{d^2y}{dt^2} – \frac{dy}{dt} – 2y = -2t + 4t^2$.**

Let’s first solve for the complementary solution. The corresponding homogenous differential equation is:

(5)

The characteristic equation is $r^2 – r – 2 = 0$ which can be factored as $(r – 2)(r + 1) = 0$. Thus $r_1 = 2$ and $r_2 = -1$ and so the complementary solution is:

(6)

Now we need to find a particular solution to our differential equation. Note that $g(t) = -2t + 4t^2$ is a polynomial, and so the method of undetermined coefficients will work well here. Assume the form $Y(t) = t^s(A + Bt + Ct^2)$. Note that in this case, $s = 0$ since a polynomial will never be constructed from our complementary solution. Thus $Y(t) = A + Bt + Ct^2$.

Now we differentiate $Y$ twice to get that:

(7)

Plugging these values into our second order linear nonhomogenous differential equation and we have that:

(8)

Thus we obtain the following system of equations:

(9)

The above equations imply that $C = -2$, $B = 3$, and $A = -\frac{7}{2}$, and so our particular solution is:

(10)

Therefore the general solution to our second order linear nonhomogenous differential equation is:

(11)