The function is .
Consider .
Product rule of derivatives: .
.
power rule of derivatives: .
Sum rule of cosine function: .
.
Differentiate on each side with respect to .
.
Product rule of derivatives: .
Power rule of derivatives: .
Sum rule of sine function: .
.
.