Find the derivative of
Split the sum. Differentiation is linear, so handle and independently and add the results.
Differentiate the quadratic term. .
Differentiate the cosine with the chain rule. The inner function is , whose derivative is . Since , Forgetting the inner factor — or losing the minus sign — is the usual error here.
Combine the two pieces.
Verify numerically. At the formula gives , and a central difference quotient of at agrees to six decimals.
Need to solve a different problem like this? Open the solver →