How to solve a system of nonlinear equations