How to solve quadratic equations?