Solution (source code)

= Solution

Two functions are <linearly dependent> if constants $c_1,c_2$, not both zero, satisfy $c_1y_1+c_2y_2=0$ identically. Differentiating also gives $c_1\dot y_1+c_2\dot y_2=0$. Since the determinant of these two equations is the nonzero <Wronskian> $W$, both constants must vanish. Hence \b[the two solutions are linearly independent.]

Differentiating the <Wronskian> and substituting the <homogeneous linear differential equation> gives
$$
\dot W=y_1\ddot y_2-y_2\ddot y_1=-p(t)(y_1\dot y_2-y_2\dot y_1)=-p(t)W.
$$
Integrating proves <Abel's identity>:
$$
\boxed{W(t)=W(t_0)\exp\left[-\int_{t_0}^t p(s)\,ds\right].}
$$
For <variation of parameters>, impose $\dot a_1y_1+\dot a_2y_2=0$ on the proposed <particular solution>. Then $\dot y=a_1\dot y_1+a_2\dot y_2$, and substitution into the inhomogeneous <differential equation> leaves $\dot a_1\dot y_1+\dot a_2\dot y_2=f$. Solving this two-by-two <linear system> gives
$$
\dot a_1=-\frac{fy_2}{W},\qquad \dot a_2=\frac{fy_1}{W},\qquad \boxed{a_1=-\int_{t_0}^t\frac{f(s)y_2(s)}{W(s)}\,ds,\quad a_2=\int_{t_0}^t\frac{f(s)y_1(s)}{W(s)}\,ds.}
$$
Arbitrary constants of integration merely add a <homogeneous solution>.

For the constant positive coefficient $q=\omega^2$, take $\omega>0$. Direct differentiation verifies that $y_1=\cos\omega t$ and $y_2=\sin\omega t$ solve the <homogeneous linear differential equation>; their <Wronskian> is $W=\omega$. The requested integrands are
$$
\frac{fy_1}{W}=\frac{\sin(2\omega t)}{2\omega},\qquad \frac{fy_2}{W}=\frac{1-\cos(2\omega t)}{2\omega}.
$$
Taking $t_0=0$ yields
$$
a_1=-\frac{t}{2\omega}+\frac{\sin(2\omega t)}{4\omega^2},\qquad a_2=\frac{1-\cos(2\omega t)}{4\omega^2}.
$$
Thus \b[$|a_1(t)|\sim t/(2\omega)$ grows with power one, whereas $a_2$ is bounded.] Their combination simplifies to $y_p=-t\cos(\omega t)/(2\omega)+\sin(\omega t)/(2\omega^2)$; the final sine term is itself a <homogeneous solution>. The secular term is the response to <resonance in a differential equation>.