Expanding trigonometric functions