It seems that Integrate in such cases with parameters will give the "generic" answer and it is up to you to work out the special cases. A simpler example:
Integrate[Cos[a x], {x, 0, 1}]
Limit[%, a -> 0]
One may wish the following to give a conditional expression:
Integrate[Cos[a x], {x, 0, 1}, GenerateConditions -> True]
but, sadly, it does not.