
     al=input('  al=  ');

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

     h=2/N;

     j=[0:1:N];  x=-1+j*h;

    c(1)=1;  c(N+1)=1; 

    for j=2:N
       if rem(j,2)==0
          c(j)=4;
       else
          c(j)=2;
       end
    end

    for i=1:N+1
       for j=1:N+1
          if i==j 
             A(i,j)=1+(h/3)*exp(x(i)*x(i))*c(i);
          else
             A(i,j)=(h/3)*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]);

