I want to be able to use Simplify (or FullSimplify) to simplify expressions involving, for example, sums of integrals, for instance turning

$$ \int_a^b f(x)\,dx + \int_b^c f(x)\,dx $$


$$ \int_a^c f(x)\,dx $$

Certainly this can be done with replacement rules, but doing so requires cobbling together a lot of special cases like this one:

HoldPattern[Integrate[u_, {x_, a_, b_}] + Integrate[u_, {x_, b_, c_}] + rest___] :>
  Integrate[u, {x, a, c}]

Using rules like than requires fiddly mixing of steps with Expand, Simplify, ReplaceAll, ReplaceRepeated, and on and on, and the whole process is annoying and error prone, especially if you screw up your rules. On top of that, you have to worry about ordering them properly in order to get them to fire in ways that lead to simplification.

All in all, the process is a real pain in the neck.

I keep wanting to find a better way. Is there one?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.