Quadratic formula (I won't put the details, they are found on Wiki) :
Say : $\displaystyle ax^2 + bx + c = 0$
You can define a "discriminant" (to know where it comes from, wikipedia) : $\displaystyle \triangle = b^2 - 4ac$
If this discriminant is negative, then the equation has no solution in R and cannot be factorized (you'll see later it has solutions, though).
If this discriminant is zero, then the equation has one root (solution). In fact, it has two, but they are the same. This solution is :
$\displaystyle x = \frac{\ {-b}}{2a}$
If this discriminant is positive, then the equation has two distinct roots :
$\displaystyle x = \frac{\ {-b} {\pm} \sqrt{\triangle}}{2a}$
There you go