% Section 4.5 Exercise 6 and 11
% y'' + 9*y = sin(2*t)
% with the 
% particular solution:
% yp= 1/5*sin(2*t)
% and the 
% homogeneous solution:
% yh = c1*cos(3*t) + c2*sin(-3*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 = 1/5*sin(2*t);
y = yh + yp;

figure(6)
plot(t,yh,'.-.r',t,yp,'-ob',t,y,'-g','Linewidth',2)
legend('homogeneous','particular','solution')
title('Remark the transient !!!')