Verifying a trigonometric identity