function [x,n,err,vx]=newton(fun,dfun,x0,toll,nmax)
  %% [x,n,err]=newton(fun,dfun,x0,toll,nmax)
  n=0;				
  err='';
  x=x0;
  vx=[x];
  do
    fx=eval(fun);
    dfx=eval(dfun);
    if dfx == 0
      err='Divisione per zero';
      return;
    end
    inc=fx/dfx;
    x=x-inc;
    vx=[vx,x];
    n=n+1;
  until abs(inc) < toll | n==nmax
  if n==nmax
    err='No converge';
  end