Undetermined coefficients needs forcing terms whose derivatives stay in a small family. For $\sec t$, $\ln t$ or $\frac{1}{t}$ there is no finite guess. Variation of parameters works for any continuous $g$, as long as you know two independent homogeneous solutions.
Key idea
Why it works
Worked example: A secant forcing
- $y_1 = \cos t$, $y_2 = \sin t$, $W = \cos^{2} t + \sin^{2} t = 1$.
- $u_1' = -\sin t\sec t = -\tan t$, so $u_1 = \ln(\cos t)$.
- $u_2' = \cos t\sec t = 1$, so $u_2 = t$.
Answer: $y_p = \cos t\,\ln(\cos t) + t\sin t$
Worked example: A repeated root and $\frac{1}{t}$
- $y_1 = e^{t}$, $y_2 = te^{t}$, $W = e^{2t}$.
- $u_1' = -\frac{te^{t}\cdot e^{t}/t}{e^{2t}} = -1$ and $u_2' = \frac{e^{t}\cdot e^{t}/t}{e^{2t}} = \frac{1}{t}$.
- $u_1 = -t$, $u_2 = \ln t$, so $y_p = -te^{t} + te^{t}\ln t$.
- $-te^{t}$ is a homogeneous solution, so it can be dropped.
Answer: $y_p = te^{t}\ln t$
Worked example: Standard form matters
- Divide by $t^{2}$: the forcing in standard form is $g = t$, not $t^{3}$.
- $W = t\cdot 2t - 1\cdot t^{2} = t^{2}$.
- $u_1' = -\frac{t^{2}\cdot t}{t^{2}} = -t$ and $u_2' = \frac{t\cdot t}{t^{2}} = 1$, so $u_1 = -\frac{t^{2}}{2}$, $u_2 = t$.
Answer: $y_p = -\frac{t^{3}}{2} + t^{3} = \frac{t^{3}}{2}$
Common mistake