Mistake in proof of Lemma 2.3 in Chapter 3 of Stein and Shakarchi's Fourier Analysis

Solution 1:

Note that $1-r=1-(1-1/N)=1/N$. Then:

$$MN(1-r)+\frac{M}{N}\frac{1}{1-r}=MN(1/N)+\frac{M}{N}\frac{1}{1/N}=M+\frac{M}{N}\cdot N=2M$$