You should take interval (k,k+1) because you end up with summing up for k=1 to n-1.

If you take interval (k-1,k) then for k=1 this is interval (0,1) but you need to find integral from 1 to n, not from 0 to n.

So, take interval (k,k+1).

Also notice that your answer is .

This is because you chose starting point to be 0, not 1.

Value of integral (using your formula) on interval (1-1=0,1) is , on interval (2-1=1,2) is which is exactly same answer for interval (1,1+1) using required formula.

It is just a question of shifting.