# The Method of Undetermined Coefficients Examples 2

Recall from The Method of Undetermined Coefficients page that if we have a second order linear nonhomogeneous differential equation with constant coefficients of the form $a \frac{d^2y}{dt^2} + b \frac{dy}{dt} + cy = g(t)$ where $a, b, c \in \mathbb{R}$, then if $g(t)$ is of a form containing polynomials, sines, cosines, or the exponential function $e^x$.

To solve these type of differential equations, we first need to solve the corresponding linear homogeneous differential equation $a \frac{d^2y}{dt^2} + b \frac{dy}{dt} + cy = 0$ for the homogeneous solution $y_h(t)$.. We then need to find a particular solution $Y(t)$ which will be of a particular form dependent on the combination of functions forming $g(t)$ (see the page linked above).

We can then solve for the coefficients and obtain a general solution $y = y_h(t) + Y(t)$.

We will now look at some more examples of applying this method.

## Example 1

**Solve the following second order linear nonhomogeneous differential equation $\frac{d^2y}{dt^2} - 2 \frac{dy}{dt} - 3 y = -3te^{-t}$ using the method of undetermined coefficients.**

The corresponding second order homogeneous differential equation is $\frac{d^2y}{dt^2} - 2 \frac{dy}{dt} - 3 y = 0$, and the characteristic equation is $r^2 - 2r - 3 = (r - 3)(r + 1) = 0$. The roots of the characteristic equation are therefore $r_1 = 3$ and $r_2 = -1$, and so the solution to the corresponding second order homogeneous differential equation is:

(1)We now need to find a particular solution $Y(t)$ to the second order nonhomogeneous differential equation. Assume $Y(t) = (P + Qt)e^{-t} = Pe^{-t} + Qte^{-t}$. Note that the first term is contained in the solution to the corresponding second order homogeneous differential equation, so instead, multiply each term by $t$ to get $Y(t) = Pte^{-t} + Qt^2e^{-t}$. The first and second derivatives of $Y$ are:

(2)Plugging $Y(t)$, $Y'(t)$, and $Y''(t)$ into the second order nonhomogeneous differential equation gives us:

(4)From the equation above, we see that $-8Q = -3$ so $Q = \frac{3}{8}$. We also see that $-4P + 2Q = 0$ so $P = \frac{3}{16}$. Therefore a particular solution to the second order nonhomogeneous differential equation is $\left ( \frac{3}{16}t + \frac{3}{8}t^2 \right ) e^{-t}$. Therefore the general solution to the second order nonhomogeneous differential equation from above is:

(5)