function g = rosenbrock_gradient(x1, x2)
  %
  % The gradient of the Rosenbrock function. See rosenbrock.m for more
  % information.
  %
  f_x1 = -400*x1*(x2 - x1^2) + 2*x1 - 2;
  f_x2 = 200*(x2 - x1^2);
  g = [f_x1; f_x2];
end
