(a) State the sum of $1+z+z^2+\cdots+z^{n-1}$, for $z\ne1$. [1]
(b) By letting $z=\cos\theta+i\sin\theta$, where $\cos\theta\ne1$, show that $$1+\cos\theta+\cos2\theta+\cdots+\cos(n-1)\theta
=\frac12\left(1-\cos n\theta+\frac{\sin n\theta\sin\theta}{1-\cos\theta}\right).$$ [7]
The diagram shows $y=\cos x$ for $0\leqslant x\leqslant1$, together with $n$ rectangles of width $\frac1n$.
(c) By considering the sum of the areas of these rectangles, show that $$\int_0^1\cos x\,\mathrm dx<
\frac1{2n}\left(1-\cos1+\frac{\sin1\sin(1/n)}{1-\cos(1/n)}\right).$$ [4]
(d) Use a similar method to find a lower bound for $\int_0^1\cos x\,\mathrm dx$. [3]