
     al=input('  al=  ');

 for NN=1:19
 
     N=NN+1

     j=[0:1:N];  x=[cos(pi*j/N)]';
     c=[2 ones(1,N-1) 2];

     for k=1:N+1
        if rem(k-1, 2)==0
           b(k)=2/(1-(k-1)^2);
        else
           b(k)=0;
        end
     end

    for k=1:N+1
       dd=0;
          for j=1:N+1
             dd=dd+b(j)*cos((j-1)*(k-1)*pi/N)/c(j);
          end
       d(k)=2*dd/(N*c(k));
    end
 
    for i=1:N+1
       for j=1:N+1
          if i==j 
             A(i,j)=1+d(i)*exp(x(i)*x(i));
          else
             A(i,j)=d(j)*exp(x(i)*x(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]);

