% Section 4.5 Exercise 2
% y'' + 6*y' + 8*y = -3*exp(-t)
% with the 
% particular solution:
% yp= 3*exp(-t)
% and the 
% homogeneous solution:
% yh = c1*exp(-t)*cos(2*t) + c2*exp(-t)*sin(2*t) 
t = linspace(-1,10,100);
c1=1;c2=0.001;
yh = c1*exp(-t).*cos(2*t) + c2*exp(-t).*sin(2*t) ;
yp = 3*exp(-t);
y = yh + yp;

figure(3)
plot(t,yh,'.-.r',t,yp,'-ob',t,y,'-g','Linewidth',2)
legend('homogeneous','particular','solution')

