function r = Newton_Raphson(f, J, x1)

while 1
    x2 = x1 - inv(J(x1))* f(x1);
    disp(x2);
    if norm((x1-x2)./x2) < 0.0001 break;
    else x1 = x2;
    end;
end;
r = x2;