solve_univariate: fixed the condition for x**w