syms x y;
y = cos(x)^2;
dy = diff(y);
inty = int(y);
figure;hold on;
h1=ezplot(y,[-pi,pi]);set(h1,'color','r')
h2=ezplot(dy,[-pi,pi]);set(h2,'color','b');
h3=ezplot(inty,[-pi,pi]);set(h3,'color','g');
title('y=cos(x)^2 and dy/dx, integral y');
legend('y=cos(x)^2','dy/dx','int(y)');