# Simplifying Redundant Piecewise Cases

I would like to perform a summation from $1$ to $M$ of a simple piecewise function. For example,

a[i_] := Piecewise[{{a, i == 1}}, b];
Assuming[Element[M, Integers] && M >= 1, Sum[a[i], {i, 1, M}]]


For $M \geq 1$, the exact solution is $a - b + bM$. With Mathematica, however, I get

$$\begin{cases} a & M\leq1 \\ a - b + bM & \text{True} \end{cases}$$

This is not wrong, but I would like to simplify out the redundant first case. I cannot seem to find the correct set of assumptions and simplifications necessary to do this.

• You may not find this satisfying, but Sum[c[i], {i, M}] // Last works. – bbgodfrey May 17 '17 at 15:39
• Simplify[Sum[a[i], {i, 1, M}], M > 1] – yohbs May 17 '17 at 19:42