function ex4_4_anim

     nn = 1000;
     m  = 6;

     x = [-1:1.0/nn:1];

     S = ones(1,length(x))/3 - 4.0/pi^2 * cos(pi*x);
     
     for i=1:m

        for j=2^(i-1)+1:2^i
            S = S + 4.0/pi^2 * (-1)^j/j^2 * cos(j*pi*x);
        end
        
        N = 2^i

        h=plot(x,x.^2,'k-');
        set(h,'LineWidth',2);
        set(gca,'LineWidth',2);
        set(gca,'FontSize',18);
        hold on;
        h=plot(x,S,'b-');
        set(h,'LineWidth',2);
        hold off;

        pause;
     end
