Solving equations with one, none, or infinite solutions