Improved OrthogIntegrate so that it still works when there are other
exponential factors in each term.