Solution (source code)

= Solution

Before the impulse the zero initial data force $y_2=0$. An impulse modeled by the <Dirac delta function> requires continuity of $y_2$: a jump in $y_2$ would introduce an unwanted derivative of a delta in $y_2''$. Integrating the equation across $t=a$ then gives the velocity jump $y_2'(a+)-y_2'(a-)=1$.

The <causal Green function of a damped oscillator> is
$$
g(s)=e^{-ks}\frac{\sin\omega s}{\omega},\qquad g(0)=0,\quad g'(0)=1.
$$
The jump conditions give the causal impulse response
$$
\boxed{y_2(t,a)=H(t-a)e^{-k(t-a)}\frac{\sin[\omega(t-a)]}{\omega}}.
$$
Here $H$ is the <Heaviside step function>. For $\omega=0$, interpret the quotient continuously as $t-a$, giving $H(t-a)(t-a)e^{-k(t-a)}$. Both initial values are zero because $a>0$.