An oscillator with a switch in forcing

Plot[HeavisideTheta[t],{t,-1,1}]

x'' + x' + 3 x = - H(t - 3) cos(2t)
x(0) = 0
x’(0) = 1

xh[t_]=2 E^(-t/2) Sin[Sqrt[11] t/2]/Sqrt[11]

Plot[xh[t],{t,0,20},PlotRange->All]

Plot[{xh[t],xh'[t]+xh[t],Cos[2 t]},{t,0,5},PlotRange->All,PlotStyle->{Black,Green,Red}]

x[t_]=xh[t]-HeavisideTheta[t-3] (E^((3-t)/2) ( (Cos[6]-2 Sin[6]) Cos[Sqrt[11] (t-3)/2]-(7 Cos[6]+6 Sin[6]) Sin[Sqrt[11] (t-3)/2]/Sqrt[11] ) -(Cos[6]-2 Sin[6]) Cos[2 (t-3)] + (2 Cos[6]+Sin[6]) Sin[2 (t-3)])/5;

Plot[x[t],{t,0,5}]

Plot[x[t],{t,0,50}]

Plot[{x[t],HeavisideTheta[t-10] Cos[2 t]},{t,9.5,10.5},PlotStyle->{Black,Red},PlotRange->All]