Implement Newton's method for systems of nonlinear equations