Let $Y_1$ and $Y_2$ be solutions of
$$L(y) = y'' + p(t)y' + q(t)y = g(t),$$where $p(t)$, $q(t)$, $g(t)$ are continuous on $I = (\alpha, \beta)$. Then $Y_1 - Y_2$ is a solution to
$$L(y) = y'' + p(t)y' + q(t)y = 0.$$That is, if $\{y_1, y_2\}$ is a fundamental set of solutions to the homogeneous $L(y) = 0$, then
$$Y_1(t) - Y_2(t) = c_1 y_1(t) + c_2 y_2(t)$$for some constants $c_1$, $c_2$.
The general solution of
$$L(y) = y'' + p(t)y' + q(t)y = g(t)$$can be written as
$$y(t) = \phi(t) = c_1 y_1(t) + c_2 y_2(t) + Y(t),$$where $\{y_1, y_2\}$ is a fundamental set of solutions (called complementary functions) of the corresponding homogeneous DE, and $Y(t)$ is a specific solution (called a particular integral) of the DE.
Example (B&D). Solve
$$y'' - 3y' - 4y = 3e^{2t}. \tag{1}$$We divide the process into two parts:
Part I: homogeneous equation. We solve
$$y'' - 3y' - 4y = 0.$$This gives the characteristic equation
$$r^2 - 3r - 4 = (r + 1)(r - 4) = 0$$so that complementary functions are $\{e^{-t}, e^{4t}\}$.
Part II:
Since $g(t) = 3e^{2t}$ and it satisfies (1), so it is reasonable to try $Y(t) = Ae^{2t}$. Notice that
$$Y' = 2Ae^{2t}, \quad Y'' = 4Ae^{2t},$$and substitute them into the (1) yields
$$(4A - 3(2A) - 4A)e^{2t} = 3e^{2t}.$$Thus we must require
$$-6A = 3,$$or $A = -1/2$. Thus the particular integral is $Y(t) = -\frac{1}{2}e^{2t}$. We deduce that the general solution is given by
A simple check by substituting this $y$ into the DE (1) easily verifies that our finding is correct.
Example (B&D). Solve
$$y'' - 3y' - 4y = 2\sin t. \tag{2}$$The complementary functions are the same as before: $\{e^{-t}, e^{4t}\}$.
Part IIa: Since $g(t) = 2\sin t$, let us first substitute $Y(t) = A\sin t$ into the (2) and this yields
$$(-A\sin t) - 3(A\cos t) - 4(A\sin t) = 2\sin t.$$That is,
$$(2 + 5A)\sin t + 3A\cos t = 0,$$which is impossible (since $\cos t$ and $\sin t$ are linearly independent) unless both $3A = 0$ and $2 + 5A = 0$. The first equation gives $A = 0$. But then the second equation is impossible. This is a contradiction. Hence the choice of $Y(t) = A\sin t$ is incorrect.
Part IIb: Let us try $Y(t) = A\sin t + B\cos t$. Then
\begin{align} Y' &= A\cos t - B\sin t \\ Y'' &= -A\sin t - B\cos t. \end{align}Substitute them into the DE (2) yields
$$(-A + 3B - 4A)\sin t + (-B - 3A - 4B)\cos t = 2\sin t.$$That is,
\begin{align} -5A + 3B &= 2; \\ -3A - 5B &= 0. \end{align}Thus, $A = -5/17$ and $B = 3/17$. So the general solution to the DE (2) is given by
Example (B&D). Solve
$$y'' - 3y' - 4y = -8e^t\cos 2t. \tag{3}$$We note that the complementary functions are the same as in the earlier examples. We also learnt from the last example that we should allow both $\sin$ and $\cos$ whenever the non-homogeneous $g$ has the same. So let us try
$$Y(t) = Ae^t\cos t + Be^t\sin t.$$We have
$$Y'(t) = (A + 2B)e^t\cos 2t + (-2A + B)e^t\sin 2t.$$We also have
$$Y''(t) = (-3A + 4B)e^t\cos 2t + (-4A - 3B)e^t\sin 2t.$$Substitute them into the DE (3) yields
$$10A + 2B = 8, \quad 2A - 10B = 0.$$Hence $A = 10/13$ and $B = 2/13$. Thus, the particular integral is given by
Thus the general solution is given by
$$y(t) = c_1 e^{-t} + c_2 e^{4t} + Y(t).$$Example (B&D) "Multiple" $g$. Solve
$$y'' - 3y' - 4y = 3e^{2t} + 2\sin t - 8e^t\cos 2t. \tag{4}$$This may seem a difficult problem. But let us recall the following solved DEs:
\begin{align} y'' - 3y' - 4y &= 3e^{2t}, & Y_1(t) &= -\tfrac{1}{2}e^{2t}; \\ y'' - 3y' - 4y &= 2\sin t, & Y_2(t) &= -\tfrac{5}{17}\sin t + \tfrac{3}{17}\cos t; \\ y'' - 3y' - 4y &= -8e^t\cos 2t, & Y_3(t) &= \tfrac{10}{13}e^t\cos 2t + \tfrac{2}{13}e^t\sin 2t. \end{align}We claim that the general solution is given by
Suppose $g(t) = \sum_{k=1}^n g_k(t)$. If we have solved
$$L(y) = y'' + p(t)y' + q(t)y = g_k(t), \quad L(Y_k(t)) = g_k(t)$$for each $k = 1, \ldots, n$, then
$$L(Y_1 + \cdots + Y_n) = L(Y_1) + \cdots + L(Y_n) = g_1 + \cdots + g_n,$$as required.
Use the method of undetermined coefficients to find the general solution:
Find a particular solution to:
$$y'' - 3y' - 4y = 3e^{2t}$$The RHS is $3e^{2t}$. What form should we try for the particular solution $Y(t)$?
With $Y = Ae^{2t}$, what are $Y'$ and $Y''$?
Substitute into $Y'' - 3Y' - 4Y = 3e^{2t}$:
From $-6Ae^{2t} = 3e^{2t}$, solve for $A$:
The particular solution is: