
     al=input('  al=  ');

 for NN=1:6
 
     N=2^(NN+2);

     h=2/N;

     j=[0:1:N];  x=-1+j*h;
     c=[2 ones(1,N-1) 2];

    for i=1:N+1
       for j=1:N+1
          if i==j 
             A(i,j)=1+h*exp(x(i)*x(i))/c(i);
          else
             A(i,j)=h*exp(x(i)*x(j))/c(j);
          end
        end
    ss=x(i)+al;
    b(i)=exp(al*x(i))+(exp(ss)-exp(-ss))/ss;
    end

    u=A\b';

    for i=1:N-1
       u_true(i)=exp(al*x(i));
       error(i)=abs(u(i)-u_true(i));
    end

       xx(NN)=N;
       err(NN)=max(error);
       ss=max(error)

 end
    fprintf(1,    '%10.0f        %10.3e \n', [xx; err]);

