Using the gradient of the objective function for faster optimization.