Here (and here), I saw an equation for a horizontal frictionless harmonic oscillator (a mass on a spring) that was suddenty hit by a hummer (i.e. the duration of the hit goes to zero). The equation looks like this (neglecting the coefficients): $$x'' + x = \delta_{\pi}(t)$$ My question is how to derive it.
Some clarification of what I'm specifically interested in.
I know how to derive the left hand side but I want to know how do we end up having Dirac delta on the right hand side.
Normally, we would draw a free body diagram for the mass and write down the second Newton's law in projections on the horizontal axis $x$. Thus, for the moment of the hammer hit we have:
$$ma = F_{spring} - F_{hammer}$$
$$x''-\frac{k}{m} x = - \frac{1}{m} F_{hammer}$$
At this point, we've derived the left hand side. How do we convert the right hand side to a Dirac delta containing function?
As I understand, the second Newton's law that I have written works only for the moment of the hammer hit. That's because $F_{hammer}$ exists only at the moment of the hammer hit - say - at $t=0$.
In other words, $F_{hammer} (t)$ looks like this:
In order to use our equation for all the values on the $t$ axis, we have to "expand" $F_{hammer} (t)$ to the entire $t$ axis. I believe that Dirac delta has something to do with that. I.e. Dirac delta converts our plot to the following one:
I'm very curious about the essence of the mathematical trick that expands the function $F_{hammer}$ which exists only at one point to the entire $t$ axis.