I have an equation of the form
with $n$ exponential terms. $a_i,b_i$ are real numbers (a result of some previous computation). My intention is to apply integral operator $\int_p^qdx$ to the function above. When number of terms in above equation becomes very large (in fact on my PC about greater than 30), the evaluation becomes very slow. So I thought why not bypass the integration step and use replacement rules because I know what the integral is going to look like. That is I want to do the following replacement, which I hope will speed up evaluation:
Exp[-b*x] -> (Exp[-b*q]-Exp[-b*p])/b a0 -> a0(q-p)
I want to repeat that $a_i,b_i$, are real numbers which are output of some previous computation, and not just symbols, even though for generality I had to represent them as symbols here rather than as numbers.
I wish I could tell you what I tried, but honestly I have no clue how to proceed with this problem. How do I match patterns and do replacement in this case? Thanks in advance for any help.
P.S. I saw this post: Replace pattern for exponentials but wasn't helpful to me.