Take the formula for $\cos\left(\sum_{n=0}^\infty a_n\right)$ and let all but finitely many terms be 0. Notice that you have a sum of products of sines and cosines. Each product ashas only finitely many sine factors. If one of those is the sine of 0, then the whole term vanishes. But if none is the sine of 0, then you have the product of finitely many cosines of nonzero numbers and finitelyinfinitely factors each of which is $\cos 0 = 1$. In effect, those $\cos 0$ factors also vanish. There you have it.
....also: Look at 19th- and early 20th-century books on trigonometry. Lot's of stuff is there that you won't find in more recent books on that topic.