How to solve the sum and product of the root?