The function is
Apply derivative on each side with respect to .
Chain rule of derivative : .
Product rule of derivatives : .
.