Does anyone know of a closed formula for $\displaystyle \cos\left(\sum_{n=0}^m a_n\right)$? I've seen formulas for $\displaystyle \cos\left(\sum_{n=0}^\infty a_n\right)$ and $ \displaystyle \tan\left(\sum_{n=0}^m a_n\right)$, but the former remains elusive. I can only think of two ways to approach the problem, either by taking the real part of complex exponentials or defining a recurrence relation, viz.
\begin{align} & \cos \left( \sum_{n=0}^m a_n \right) \\[8pt] = {} & \operatorname{Re} \left[ \exp \left(i\sum_{n=0}^m a_n \right) \right] \\[8pt] = {} & \frac{1}{2} \left[\exp\left(i\sum_{n=0}^m a_n \right) + \exp\left(-i\sum_{n=0}^m a_n\right) \right] \\[8pt] = {} & \frac{1}{2} \left[ \prod_{n=0}^m \exp(ia_n) + \prod_{n=0}^m \exp(-ia_n) \right] \\[8pt] = {} & \frac{1}{2} \left[ \prod_{n=0}^m \left[\cos(a_n) + i\sin(a_n) \right] \right] + \prod_{n=0}^m \left[\cos(a_n)-i\sin(a_n)\right] \end{align}
which amounts to finding a closed-form expression for
$$(A_0+B_0)(A_1+B_1)(A_2+B_2)\cdots(A_m+B_m)$$
similar to finding binomial coefficients, albeit more general. I know there should be $2^m$ unique terms arising from choosing either $A_0$ or $B_0$, then choosing either $A_1$ or $B_1$, etc. until you've chosen every combination. The recurrence relation would go as follows:
\begin{align} & \cos \left( \sum_{n=0}^m a_n\right) \\[8pt] = {} & \cos\left(a_m +\sum_{n=0}^{m-1} a_n \right) \\[8pt] = {} & \cos(a_m) \cos\left(\sum_{n=0}^{m-1} a_n \right) - \sin(a_m) \sin\left(\sum_{n=0}^{m-1} a_n\right) \end{align}
Jackson