The differentiation formula is .
Let , then .
Apply derivative on each side.
Trigonometric identity : .
Substitute .
.
Substitute and in .