\begin{alignat}{3}
\cos \sum_j \alpha_j
& = \sum_{k=0}^\infty (-1)^k
&& \sum_{|A|=2k} & \prod_{j\in A} \sin\alpha_j \prod_{j\notin A} \cos\alpha_j \\
\sin \sum_j \alpha_j
& = \sum_{k=0}^\infty (-1)^k
&& \sum_{|A|=2k+1} & \prod_{j\in A} \sin\alpha_j \prod_{j\notin A} \cos\alpha_j
\end{alignat}
It seems that "alignat" aligns everything either on the right or on the left. However, in the interest of a sort of poetic rhythm that I think may actually aid understanding and reduce distractions, it seems like a good idea for the two giant Sigmas with subscripts |A|=2k and |A|=2k+1 should be aligned with each other, and they're not because of the difference in the subscripts.
So how should that be done?
Also, the subscript 2k+1 is uncomfortably close to the subscript j\in A that follows it. How should that be dealt with?
Postscript in response to the answer and comments below: I've just run TeXworks on the document that I quote in its entirety below. I still get this: "Sorry, but "C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\texify.exe" did not succeed."
\documentclass{article}
\usepackage{mathtools}
\usepackage{eqparbox}
\newcommand\eqmathbox[2][M]{\eqmakebox[M#1 {$\scriptstyle#2$}}
\begin{document}
trigonometric identities
\end{document}




