How to solve a trigonometric equation using sum and difference identities