\documentclass[a4paper,12pt]{article}
\begin{document}

\noindent {\bf Question}

\noindent Calculate the Taylor series of the function
\[ f(x) = \cos(2x) \]
about $x_0 =\pi$.


\medskip

\noindent {\bf Answer}

\noindent  The Taylor series centered at $x_0 =\pi$ is the series
\[ \sum_{n=0}^\infty \frac{1}{n!} f^{(n)}(\pi) (x-\pi)^n. \]

\medskip
\noindent Note that $f^{(n)}(\pi) =\pm \sin(\pi) =0$ for $n$ odd,
that $f^{(4k)}(\pi) =\cos(\pi) =1$, and that $f^{(4k+2)}(\pi)
=-\cos(\pi) = -1$ for $k\ge 0$.  Hence, the Taylor series becomes
\begin{eqnarray*}
\lefteqn{ \sum_{k=0}^\infty \frac{1}{(4k)!} f^{(4k)}(\pi)
(x-\pi)^{4k} + \sum_{k=0}^\infty \frac{1}{(4k+2)!} f^{(4k+2)}(\pi)
(x-\pi)^{4k+2} }
\\
& = &  \sum_{k=0}^\infty \frac{1}{(4k)!} (x-\pi)^{4k} -
\sum_{k=0}^\infty \frac{1}{(4k+2)!} (x-\pi)^{4k+2} \\ & = &
\sum_{p=0}^\infty \frac{1}{(2p)!} (-1)^p (x-\pi)^{2p}.
\end{eqnarray*}


\end{document}
