integrate using midpoint method x e^x