My question:
What exactly is Green's Function and why can I use it to solve harmonic oscillator problems? In other words, how is Green's function connected to physics problems like the harmonic oscillator?
My question is motivated by a bonus question on my worksheet:
A undamped, harmonic oscillating mass $m$ with frequency $\omega_0$ is excited by an external time dependent impulse $F(t)$:
$$F(t)= \begin{cases} 0, & \text{if $t \le 0$} \\ f_0\sin{\Omega t}, & \text{if $0\le t \le T=\frac{2\pi}{\Omega}$}\\ 0, & \text{if $t \ge T$} \end{cases}$$
find $x(t)$ of the driven harmonic oscillation by using Green's Function.
Can someone explain to me what Green's function is and how I can use it to solve this question?
If some of the moderators think this question is better suited for physics stack exchange, please let me know.
I'll restrict the context a little bit. If you have a homogeneous linear 2nd order ODE $y''+ay'+by=0$ with constant coefficients (something like the harmonic oscillator equation $y''+ky=0$), the Green's function $g$ is the solution to the problem
$$g''+ag'+bg=0,g(0)=0,g'(0)=1.$$
The Green's function is useful because the solution to the problem
$$y''+ay'+by=f,y(0)=0,y'(0)=0$$
turns out to be
$$\int_0^t g(t-s) f(s) ds.$$
Thus by adding an appropriately chosen homogeneous solution, you can solve the general problem
$$y''+ay'+by=f,y(0)=y_0,y'(0)=y_1.$$
This generalizes to essentially all linear ODEs, with some modifications. If you want to see those I can explain them, but this is enough for your question.
Edit: this method turns out to be a bit ugly for this problem. The issue is partly that the forcing gets turned off partway through the process. A nice technique in this sort of situation is the Laplace transform method. Another tool which helps us when we use trigonometric forcing is to write it as the real or imaginary part of the corresponding complex exponential.
With that in mind, start with
$$my''+ky=(1-\theta(t-T))\sin(\Omega t),y(0)=0,y'(0)=0.$$
This is the imaginary part of the solution to $mz''+kz=(1-\theta(t-T))e^{i \Omega t}$. If you take Laplace transforms on both sides and solve for $Z$, you get
$$Z=\frac{1-e^{-Ts} e^{i \Omega T}}{(s-i \Omega)(ms^2+k)}$$
using a Laplace transform table. Notably in your case $e^{i \Omega T}=1$. So now the problem comes down to finding the inverse Laplace transform of
$$\frac{1-e^{-Ts}}{(s-i\Omega)(ms^2+k)}.$$
It is convenient to write this as
$$\frac{1}{m} \frac{1-e^{-Ts}}{(s-i\Omega)(s+\omega_0 i)(s-\omega_0 i)}.$$
Provided $\Omega \neq \omega_0$, this can be partial fraction decomposed to
$$\frac{1}{m} \left ( 1-e^{-Ts} \right ) \left ( \frac{A}{s-i\Omega} + \frac{B}{s+\omega_0 i} + \frac{C}{s-\omega_0 i} \right ).$$
Now if $h(t)=A e^{i \Omega t} + B e^{i \omega_0 t} + C e^{-i \omega_0 t}$ then the solution is
$$z(t)=\frac{1}{m} \left ( h(t) - \theta(t-T) h(t-T) \right )$$
and as I said before $y$ is the imaginary part of $z$.