How to find the roots of quadratic functions?