function y=gauss2pts(fh,a,b)
%assign sample points and weights
y2=[-sqrt(1/3),sqrt(1/3)];
w2=[1,1];
c1=(b-a)/2;
c2=(a+b)/2;
sum=0;
for i=1:2
    x=c1*y2(i)+c2;
    sum=sum+w2(i)*feval(fh,x);
end
y=c1*sum;