%derivtd
a=input('enter a =');
n=input('enter n =');
for k=1:n
   h(k)=10^(-k);
   Dh=( sin(a+h(k))-sin(a) )/h(k);
   err(k)=abs(Dh-cos(a));
end
semilogy(1:n,err)
