Derivative of trigonometric functions