function q=mygauss2(f,a,b);
% MYGAUSS2 integrates f by the n=2 Gauss rule
%
% f might be ">> f=inline('exp(-cos(x).^2)','x') "
% then ">> mygauss2(f,0,2) "

t=[-sqrt(3/5) 0 sqrt(3/5)]';

A=[5 8 5]/9;

c=(b-a)/2; d=(b+a)/2;

q=c*A*feval(f,c*t+d);