How to solve trigonometric equations