Forced Vibration with Damping

u''  +  (1/8) u'  +  u  =  
        3 cos(2  t),  u(0)  =  2, u' (0)  =  0

Solution of the homogeneous equation:

L[u_]  :=  D[u, {t, 2}]  +  (1/8) D[u, t]  +  u

Solve[(r^2) +  (1/8) r  + 1  == 0]

uc[
          t_]  =   (E^(-t/16)) (c1 Cos[((Sqrt[255])/16) t] + 
              c2 Sin[((Sqrt[255])/16) t]);

Find a particular solution:

up[t_]  =  b0 Cos[2  t]  +  b1 Sin[2  t];

L[up[t]] // Simplify

Solve[{-3 b0 + (b1/4) == 3, 
        b0 + 12 b1 == 0}]

up[t_]  =  
      up[t]  /.  {b0 -> -(144/145), 
          b1 -> (12/145)}

General solution:

u[t_]  =  uc[t]  +  up[t]

Initial conditions:

Solve[{u[0]  ==  2,  u'[0]  ==  0}]

Solution to the initial value problem:

u[t_]  =  
      u[t]  /.  {c2 -> ((2 (Sqrt[(5/51)]))/29), 
          c1 -> (434/145)}

Plot[{3 Cos[2  t],  u[t]}, {t, 0, 15  π}, 
      PlotStyle -> {RGBColor[1, 0, 0], RGBColor[0, 0, 1]}]