function x = newton(f,Jf,x0,tol)
x = x0;
delta = -Jf(x)\f(x);
while (norm(delta,inf) > tol)
  x = x+delta;
  delta = -Jf(x)\f(x);
  norm(delta,inf)
end
