Consider the equation
which we wish to solve for . Assume that , , and are real numbers and that we wish to be a complex number. Assume that the equation is nontrivial in that , , or (in which case or ). Then we expect two solutions, although they might happen to be the same, or one or both of them might be infinite (and so not exist as a complex number). I'll call these two solutions and ; which is which is somewhat arbitrary, but all of the formulas below are consistent about this.
If , then we may use the usual quadratic formula:
If , then we may rationalize the numerator:
If , then we may mix the formulas:
If , then we may mix the formulas the other way:
If more than one of the coefficients is nonzero, then you'll tend to minimize the risk of rounding errors (when using decimal approximations of the square roots) if you use the formula applicable to the coefficient that is the most nonzero (basically, the one with the largest absolute value, although the actual rule to pick the very best formula is more subtle).
Each of these formulas can sometimes give division by , but if you're using it when you're supposed to, then that can only happen when the corresponding solution is infinite, so that's perfectly appropriate. But if you use a formula when it's inapplicable, then you'll get even if the solution is finite, and that's bad.
See quadratic formula for more advanced discussion.
Last revised on October 21, 2020 at 10:39:41. See the history of this page for a list of all contributions to it.