\documentclass{amsart}

\setlength{\parindent}{0pt}

\renewcommand{\Re}{\mathrm{Re}}

\setlength{\arraycolsep}{2pt}
\thispagestyle{empty}

\begin{document}

\fbox{\begin{minipage}{.9\textwidth}
\textbf{Lagrange's Identity:}

\[1+\cos(\theta)+\cos(2\theta)+\cdots+\cos(n\theta)
=\frac{1}{2}+\frac{\sin((n+1/2)\theta)}{2\sin(\theta/2)}\]

\bigskip

\end{minipage}}

\bigskip

\proof From the addition formulas
\begin{eqnarray*}
  \cos(A+B) &=& \cos(A)\cos(B)-\sin(A)\sin(B)\\
  \sin(A+B) &=& \sin(A)\cos(B)+\cos(A)\sin(B)
\end{eqnarray*}
we get
\begin{eqnarray*}
    \cos(\theta) &=& \cos(\theta/2+\theta/2)=\cos^2(\theta/2)-\sin^2(\theta/2)
                  =  1-2\sin^2(\theta/2)\\
1 - \cos(\theta) &=& 2\sin^2(\theta/2)\\
    \sin(\theta) &=& \sin(\theta/2+\theta/2)=2\sin(\theta/2)\cos(\theta/2)
\end{eqnarray*}
Plug in $z = e^{i\theta}$ into the algebraic identity
\[1+z+\cdots+z^n = \frac{1-z^{n+1}}{1-z}\]
to get
\[1+e^{i\theta}+\cdots+e^{in\theta} = \frac{1-e^{i(n+1)\theta}}{1-e^{i\theta}}\]
Taking the real parts of both sides of this equation gives
\begin{eqnarray*}
1+\cos(\theta)+\cos(2\theta)&+&\cdots+\cos(n\theta)\\
&=& \Re\Big[\frac{1-e^{i(n+1)\theta}}{1-e^{i\theta}} \Big]\\
&=& \Re\Big[
    \frac{(1-e^{i(n+1)\theta})(1-e^{-i\theta})}{(1-e^{i\theta})(1-e^{-i\theta})}
    \Big]\\
&=& \Re\Big[\frac{1-e^{-i\theta}-e^{i(n+1)\theta}+e^{in\theta}}
    {1-e^{i\theta}-e^{-i\theta}+1} \Big]\\
&=& \frac{1-\cos(\theta)-\cos((n+1)\theta)+\cos(n\theta)}{2-2\cos(\theta)}\\
&=& \frac{1}{2}+\frac{-\cos(n\theta)\cos(\theta)+\sin(n\theta)\sin(\theta)
    +\cos(n\theta)}{2(1-\cos(\theta))}\\
&=& \frac{1}{2}+\frac{\cos(n\theta)(1-\cos(\theta))+\sin(n\theta)\sin(\theta)}
    {2(1-\cos(\theta))}\\
&=& \frac{1}{2}+\frac{\cos(n\theta)(2\sin^2(\theta/2))
    +\sin(n\theta)2\sin(\theta/2)\cos(\theta/2)}{2(2\sin^2(\theta/2))}\\
&=& \frac{1}{2}+\frac{\cos(n\theta)\sin(\theta/2)
    +\sin(n\theta)\cos(\theta/2)}{2\sin(\theta/2)}\\
&=& \frac{1}{2}+\frac{\sin((n+1/2)\theta)}{2\sin(\theta/2)}
\end{eqnarray*}



\end{document}
