To solve $ay'' + by' + cy = g(t)$ we need one particular solution $y_p$; then $y = y_p + y_h$ by superposition. When $g$ is a polynomial, an exponential, a sine or cosine, or a product of these, a good guess finds $y_p$ with simple algebra.
Key idea
Guess $y_p$ with the same shape as $g$, including every term that its derivatives produce, with unknown coefficients. If any term of the guess already solves the homogeneous equation, multiply the whole guess by $t$ (by $t^{2}$ for a double root). Substitute and match coefficients.
| Forcing $g(t)$ | Try $y_p$ |
|---|---|
| $Ge^{kt}$ | $Ae^{kt}$ |
| polynomial of degree $n$ | $A_nt^{n} + \dots + A_1t + A_0$ |
| $G\cos\omega t$ or $G\sin\omega t$ | $A\cos\omega t + B\sin\omega t$ |
| $e^{kt}\cos\omega t$ | $e^{kt}(A\cos\omega t + B\sin\omega t)$ |
Why it works
These families are closed under differentiation, so $L[\text{guess}]$ lands back in the same family and coefficients can be matched. For example $L[Ae^{kt}] = A(ak^{2} + bk + c)e^{kt}$ $= AP(k)e^{kt}$. That fails only when $P(k) = 0$, that is, when $k$ is a root and the guess is invisible to $L$. Then $L[Ate^{kt}] = AP'(k)e^{kt}$, which works when $k$ is a simple root.
Worked example: Exponential forcing
Find $y_p$ for $y'' - y' - 2y = 4e^{3t}$.
- Roots of $r^{2} - r - 2$: $2$ and $-1$; 3 is not a root, so try $Ae^{3t}$.
- $L[Ae^{3t}] = A(9 - 3 - 2)e^{3t}$ $= 4Ae^{3t}$.
- $4A = 4$, so $A = 1$.
Answer: $y_p = e^{3t}$
Worked example: Cosine forcing
Find $y_p$ for $y'' + 2y' + 5y = 10\cos t$.
- Try $y_p = A\cos t + B\sin t$: $y_p' = -A\sin t + B\cos t$, $y_p'' = -A\cos t - B\sin t$.
- Collect: $(4A + 2B)\cos t$ $+ (4B - 2A)\sin t$ $= 10\cos t$.
- So $4A + 2B = 10$ and $-2A + 4B = 0$: $A = 2$, $B = 1$.
Answer: $y_p = 2\cos t + \sin t$
Worked example: When the guess is already a solution
Find $y_p$ for $y'' - y' - 2y = 6e^{2t}$.
- $r = 2$ is a root, so $Ae^{2t}$ would give $L[Ae^{2t}] = 0$. Try $y_p = Ate^{2t}$.
- $y_p' = A(1 + 2t)e^{2t}$, $y_p'' = A(4 + 4t)e^{2t}$.
- $L[y_p]$ $= A[(4 + 4t) - (1 + 2t)$ $- 2t]e^{2t}$ $= 3Ae^{2t}$, so $3A = 6$.
Answer: $y_p = 2te^{2t}$
Common mistake
Guessing a term that already solves the homogeneous equation: for $y'' - y' - 2y = 6e^{2t}$, the guess $Ae^{2t}$ leads to $0 = 6e^{2t}$, which is impossible. Always find the homogeneous roots first and compare. Another slip: using only $A\cos\omega t$ when $g$ is a cosine; the derivative produces a sine, so the guess needs $B\sin\omega t$ too.