Solving equations and determining the number of solutions