Derivation of trigonometric functions