Solving for specific trigonometric functions