Ratio and Quadratic equation