A second derivative describes how a function’s slope changes. In optimization, it adds local curvature to the first derivative, replacing a merely linear approximation with a quadratic one and often producing more informative steps. section 6.1
Use the second derivative to:
- Differentiate a univariate function twice to obtain its second derivative. section 6.1
- Represent second-order information for multivariate functions with a Hessian matrix. section 6.1
- Construct Newton updates from the gradient and inverse Hessian, typically using a unit step length. section 6.1.1
- Weight boosting residuals through the Hessian, focusing learning more strongly on badly misclassified examples. section 6.2.1
Newton’s descent on the Branin function
Starting from [2, −5], compute the Branin function’s gradient and Hessian, set the descent direction to −H⁻¹g, update with step length 1, and stop when successive estimates are sufficiently close. Compared with gradient descent, the resulting path reaches a local minimum more directly, although both methods can converge to a saddle point. section 6.1.1
Figure 6.1 Comparing gradient descent (left) and Newton’s method (right). Gradient descent only uses local first-order information near the current solution, which leads to a linear approximation of the function being optimized. Different step lengths will then lead to different next steps. Newton’s method uses both local first- and second-order information near the current solution, leading to a quadratic (parabolic) approximation of the function being optimized. This provides a better estimate of the next step.
Compare first-order linear and second-order quadratic approximations visually; the contrast clarifies why curvature can improve optimization steps. section 6.1


