Given. An underdamped-parameter (actually overdamped: see roots below) second-order system driven by a period-2 square wave of height 2 on the first half-period.
Find. The response $y(t)$.
Check
No initial conditions are given, so “the response” is taken to mean the periodic steady state that every solution approaches (the homogeneous part always decays here, see Step 1), consistent with how this recurring archetype is asked throughout this exam series.
Approach. Expand the periodic forcing $r(t)$ as a Fourier series, then superpose the particular (steady-state) response to each harmonic using the standard frequency-response formula for a damped linear oscillator; the transient homogeneous part decays and does not affect the long-time response.
Homogeneous roots (confirm decay). $r^2+5r+3=0\Rightarrow r=\dfrac{-5\pm\sqrt{13}}{2}\approx-0.697,\,-4.303$, both negative, so any transient $C_1e^{r_1t}+C_2e^{r_2t}\to0$ and the long-time response is exactly the periodic particular solution found below.
Fourier series of $r(t)$. Period $T=2$, fundamental frequency $\omega_n=n\pi$. The average is $a_0/2=1$. Since $r$ is a rectangular pulse of height 2 on the first half of each period,
$$a_n=\frac1{1}\int_0^2r(t)\cos(n\pi t)\,dt=0\ \text{(all }n\text{)},\qquad b_n=\int_0^2 r(t)\sin(n\pi t)\,dt=\frac{2}{n\pi}\big(1-(-1)^n\big)=\begin{cases}\dfrac{4}{n\pi}&n\text{ odd}\\0&n\text{ even}\end{cases}$$
$$r(t)=1+\sum_{n\ \text{odd}}\frac{4}{n\pi}\sin(n\pi t).$$
Response to the constant term. For $y''+5y'+3y=1$, the constant particular solution solves $3y_p=1\Rightarrow y_p=\tfrac13$.
Response to each harmonic. For $y''+5y'+3y=B_n\sin(\omega_nt)$ with $\omega_n=n\pi$, try $y_p=M_n\sin(\omega_nt)+N_n\cos(\omega_nt)$. Writing $a_n^\ast=3-\omega_n^2$, matching coefficients gives the linear system $a_n^\ast M_n-5\omega_nN_n=B_n$, $5\omega_nM_n+a_n^\ast N_n=0$, whose solution is
$$M_n=\frac{B_n\,a_n^\ast}{(a_n^\ast)^2+25\omega_n^2},\qquad N_n=\frac{-5\omega_nB_n}{(a_n^\ast)^2+25\omega_n^2}.$$
Assemble the steady-state response. Summing the constant term and all odd harmonics ($B_n=4/(n\pi)$, $\omega_n=n\pi$, $a_n^\ast=3-n^2\pi^2$):