% QUADSQFERMI A quadrature routine used in Example 2.42.
%
function xw=quadsqfermi(N,i)
global r
c1=10*sqrt(10); c2=exp(-10*r)/r;
if i==1
  ab=r_jacobi01(N,0,1/2); xw=gauss(N,ab);
  xw(:,1)=10*xw(:,1);
  xw(:,2)=c1*xw(:,2)./((exp(xw(:,1))+1).^r);
else
  ab=r_laguerre(N); xw=gauss(N,ab);
  t=10+xw(:,1)/r;
  xw(:,1)=t;
  xw(:,2)=c2*xw(:,2).*sqrt(t)./((1+exp(-t)).^r);
end
