Solving trigonometric equations using pythagorean identities