(* Solution to Problem Set 9. At the Mathematica prompt, type << ans9.math *) (* The Green's function *) G[dt_] := 1/nu E^(-e dt/2) Sin[nu dt]; (* G[dt_] := 1/nu E^(-e dt/2) Sinh[nu dt]; *) (* The forcing function *) f[t_] := Sin[q t]; (* The solution *) u = Integrate[ G[t-tp] f[tp] , {tp,0,t}]; (* The solution after a long time *) uc = Coefficient[u, Cos[q t]]; us = Coefficient[u, Sin[q t]]; ulong = Together[ uc Cos[q t] + us Sin[q t] ]; (* The square of the amplitude after a long time *) asq = Factor[ uc^2 + us^2 ]; (* Print out TeX version of the solution *) u // TeXForm