Solution (source code)

= Solution

Let $\tau=t-t'$ and $\Omega=\sqrt{k^2+m^2-\lambda^2}>0$. First take $\lambda=e\gamma>0$. Since $|e^{-i\omega\tau}|=e^{\tau\operatorname{Im}\omega}$, close the <contour> below for $\tau>0$, and above for $\tau<0$. On the chosen semicircle the exponential is bounded and the denominator grows as $R^2$, so the arc integral tends to zero. The upper <contour> encloses no <pole>, giving \b[$G=0$ for $t<t'$]. The lower <contour> is clockwise, hence the real-axis integral divided by $2\pi$ is $-i$ times the sum of <residues>. Since $D'(\omega_+)=-2\Omega$ and $D'(\omega_-)=2\Omega$, that sum is
$$
-\frac{e^{-i(\Omega-i\lambda)\tau}}{2\Omega}+\frac{e^{-i(-\Omega-i\lambda)\tau}}{2\Omega}=i e^{-\lambda\tau}\frac{\sin(\Omega\tau)}{\Omega}.
$$
Thus
$$
\boxed{G(\mathbf k;t,t')=H(t-t')\,e^{-\lambda(t-t')}\frac{\sin[\Omega(t-t')]}{\Omega}\quad(\lambda>0).}
$$
This is the <causal Green function of a damped oscillator>. Its value is continuous through $\tau=0$, and its derivative jumps from zero to one; integrating the <differential equation> through zero verifies the delta-source normalization and the <residue> sign. The limits are $H(\tau)\tau e^{-\lambda\tau}$ at <critical damping> and $H(\tau)e^{-\lambda\tau}\sinh(\kappa\tau)/\kappa$ in the overdamped regime.

For completeness, if the unspecified charge has $e<0$, the same real-axis integral instead encloses upper <poles> for $\tau<0$ and gives $-H(-\tau)e^{-\lambda\tau}\sin(\Omega\tau)/\Omega$, an advanced <Green function>. A causal growing response would require an inverse-Laplace <contour> above those <poles>, not the stated real-axis Fourier integral. At $e=0$ the real-axis integral needs a <pole> prescription; shifting both <poles> below it gives the retarded zero-damping limit. These distinctions are necessary because $\gamma>0$ alone does not fix the sign of damping.