Problem 18, p.178

Solve y''  +  2  y'  +  5  y  =  
        4  (e^(-t)) cos(2  t), y(0) = 1, y' (0)  =  0.

Solution

Characteristic polynomial:

Solve[r^2  +  2  r  +  5  ==  0]

yp[t_]  = 
        t (E^(-t)) (A Cos[2  t]  +  
              B Sin[2  t]);

yp'[t] // Simplify

yp''[t] // Simplify

yp''[t]  +  2  yp'[t]  +  5  yp[t] // Simplify

This equals 4  (e^(-t)) cos(2  t) when A  =  0and B  =  1, so a particular solution is (Subscript[y, p]) =  t (e^(-t)) sin(
            2  t)  and the general solution is:

y[
          t_]  =  (E^(-t)) (c1 Cos[2  t]  +  
                c2 Sin[2  t]) + 
          t (E^(-t)) Sin[2  t];

Initial conditions:

y[0] == 1

y'[0] == 0

So (Subscript[c, 1]) =  1,  (Subscript[c, 2])  =  1/2 and the final answer is:

y[
          t_]  =  (E^(-t)) (Cos[
                  2  t]  +  (1/2) Sin[2  t]) + 
          t (E^(-t)) Sin[2  t];

Plot[y[t], {t, 0, 2  π}]