how to solving the problems involving quadratic equation?