Simplifying trigonometric equations