function c=trapi(dcdx,x)
% function c=trapi(dcdx,x)
% trapazoidal integration
nd=length(dcdx);
nd1=nd-1;
s=(dcdx(2:nd)+dcdx(1:nd1)).*(x(2:nd)-x(1:nd1));
c=.5*sum(s);
