Simplify a rational trigonometric expression