Find the first five terms of the Maclaurin expansion for \(f(x) = e^{x}\cos x.\)
Then \[ \begin{eqnarray*} e^{x}\cos x &=& 1 \!\left( 1-\frac{x^{2}}{2!}+\frac{x^{4}}{4!}-\cdots\right) +x\!\left( 1-\frac{x^{2}}{2!}+\frac{x^{4}}{4!}-\cdots\right) \\[5pt] && +\, \frac{x^{2}}{2!}\left( 1-\frac{x^{2}}{2!}+\frac{x^{4}}{4!}-\cdots\right) +\frac{x^{3}}{3!}\left( 1-\frac{x^{2}}{2!}+\frac{x^{4}}{4!}-\cdots\right) \\[5pt] && +\, \frac{x^{4}}{4!}\left(1-\frac{x^{2}}{2!}+\frac{x^{4}}{4!}-\cdots \right)+\frac{x^{5}}{5!} \left(1-\frac{x^{2}}{2!}+\frac{x^{4}}{4!}-\cdots\right)+\cdots \\[5pt] &=& \left( 1-\frac{x^{2}}{2}+\frac{x^{4}}{24}\right) +\left( x-\frac{x^{3}}{ 2}+\frac{x^{5}}{24}\right) +\left( \frac{x^{2}}{2}-\frac{x^{4}}{4}\right) +\left( \frac{x^{3}}{6}-\frac{x^{5}}{12}\right) \\[5pt] && +\, \frac{x^{4}}{24}+\frac{x^{5}}{120}+\cdots \\[5pt] &=& 1+x+\left( -\frac{1}{2}+\frac{1}{2}\right) x^{2}+\left( -\frac{1}{2}+ \frac{1}{6}\right) x^{3}+\left( \frac{1}{24}-\frac{1}{4}+\frac{1}{24}\right) x^{4}\\[5pt] &&+\,\left( \frac{1}{24}-\frac{1}{12}+\frac{1}{120}\right) x^{5}+\cdots \\[5pt] &=& 1+x-\frac{1}{3}x^{3}-\frac{1}{6}x^{4}-\frac{1}{30}x^{5}+\cdots \end{eqnarray*} \]