function [F,J] = newton_ex(x)

% The function. 
F = [x(1)^3-2*x(2)-2; 
     x(1)^3-5*x(3)^2+7; 
     x(2)*x(3)^2-1];
 
% The Jacobian. 
J = [3*x(1)^2, -2, 0;
     3*x(1)^2, 0, -10*x(3);
     0, x(3)^2, 2*x(2)*x(3)];
 