## Lesson goal: Using the Quadratic Formula

Previous: Throwing darts to find Pi | Home | Next: The Pythagorean Theorem Calculator

Remember solving quadractic equations? If you have a quadractic equation in "standard form," which is $Ax^2+Bx+C=0$, then the two solutions to this equation will be $$x=\frac{-B\pm\sqrt{B^2-4AC}}{2A}.$$

In grade-school algebra the equations are kept simple in that the roots (or answers) to quadractic equations are always real. If you look carefully at the quadractic formula, there is a $\sqrt{B^2-4AC}$. As you know, you cannot take the square root of a negative number (if you want roots that are real numbers). In other words, $B^2-4AC$ (which is called the discriminant) must always be $\ge 0$, so in a quadratic equation solver, we must check that this is true (with an if statement) before continuing.