Solving multiple angle trigonometric equations