Simplifying trigonometric expressions