In an indefinite integration you will get a constant c. It doesn't have to be the same in b oth integrals so the constant in the right integral will cover for the addition of '1'.
In definite integration, you will need to put the boundaries on 1 to.
So it will be lie:
1_{x=b}-1_{x=a}
Which is of course zero, and therefore there is no contradiction.