function r = Newton(g, H, x1)

for k = 1:500
    d= inv(H(x1))* g(x1);
    x2 = x1 - d;
    disp(x1);
    disp(H(x1));
    disp(g(x1));
    disp('Sol = ');
    disp([k, x2']);
    if norm(d) < 0.0001 break;
    else x1 = x2;
    end;
end;
r = x2;