mrange = 10:10:100;
counter = 0;
for m = mrange+1
  counter = counter + 1;
  x = linspace(-1, 1, m);
  h = 2 / (m - 1);
  u = abs(x).^(7/2);
  u1 = (u(3:m) - u(1:m-2)) / (2 * h);
  u2 = (u(3:m) - 2 * u(2:m-1) + u(1:m-2)) / h ^ 2;
  u1exact = 7/2*abs(x).^(5/2).*sign(x);
  u2exact = 35/4*abs(x).^(3/2);
  err1(counter) = norm(u1 - u1exact(2:m-1), inf);
  err2(counter) = norm(u2 - u2exact(2:m-1), inf);
  estimate(counter) = h.^2; 
end
loglog(mrange, err2, 'r*', mrange, err1, 'b*', mrange, estimate, 'k')
set(gca,'xtick',[10,20,50,100])
set(gca,'xticklabel',{'10','20','50','100'})
set(gca,'ytick',[0.001,0.01,0.1,1])
set(gca,'yticklabel',{'0.001','0.01','0.1','1'})
axis([10,100,0.0001,1])
legend('error second derivative', 'error first derivative', 'h^2')
xlabel('m')
ylabel('error in infinity norm')
