In the first image, the term seems to have been added and then subtracted, in one line of the calculation, for no reason whatever. Those terms don't appear in either the previous line or the following line of the calculation, and the whole thing would be improved if you just wipe them out.

In the second image, if then . This is the same as the sum defining , except that the first term has been dropped, and one term has been added at the end.