The Quadratic Formula
The general second-order (real) polynomial is
![$\displaystyle p(x) \isdef a x^2 + b x + c \protect$](http://www.dsprelated.com/josimages_new/mdft/img122.png) |
(2.1) |
where the coefficients
![$ a,b,c$](http://www.dsprelated.com/josimages_new/mdft/img123.png)
are any
real numbers, and we assume
![$ a\neq 0$](http://www.dsprelated.com/josimages_new/mdft/img124.png)
since otherwise
it would not be second order. Some experiments plotting
![$ p(x)$](http://www.dsprelated.com/josimages_new/mdft/img117.png)
for different
values of the coefficients leads one to guess that the curve is always a
scaled and translated
parabola. The canonical parabola centered
at
![$ x=x_0$](http://www.dsprelated.com/josimages_new/mdft/img125.png)
is given by
![$\displaystyle y(x) = d\cdot (x-x_0)^2 + e \protect$](http://www.dsprelated.com/josimages_new/mdft/img126.png) |
(2.2) |
where the magnitude of
![$ d$](http://www.dsprelated.com/josimages_new/mdft/img127.png)
determines the width of the parabola, and
![$ e$](http://www.dsprelated.com/josimages_new/mdft/img92.png)
provides an arbitrary vertical offset. If
![$ d>0$](http://www.dsprelated.com/josimages_new/mdft/img128.png)
, the parabola has
the minimum value
![$ e$](http://www.dsprelated.com/josimages_new/mdft/img92.png)
at
![$ x=x_0$](http://www.dsprelated.com/josimages_new/mdft/img125.png)
; when
![$ d<0$](http://www.dsprelated.com/josimages_new/mdft/img129.png)
, the parabola reaches a
maximum at
![$ x=x_0$](http://www.dsprelated.com/josimages_new/mdft/img125.png)
(also equal to
![$ e$](http://www.dsprelated.com/josimages_new/mdft/img92.png)
). If we can find
![$ d,e,x_0$](http://www.dsprelated.com/josimages_new/mdft/img130.png)
in
terms of
![$ a,b,c$](http://www.dsprelated.com/josimages_new/mdft/img123.png)
for any quadratic polynomial, then we can easily
factor the polynomial. This is called
completing the square.
Multiplying out the right-hand side of Eq.
![$ \,$](http://www.dsprelated.com/josimages_new/mdft/img131.png)
(
2.2) above, we get
![$\displaystyle y(x) = d(x-x_0)^2 + e = d x^2 -2 d x_0 x + d x_0^2 + e. \protect$](http://www.dsprelated.com/josimages_new/mdft/img132.png) |
(2.3) |
Equating coefficients of like powers of
![$ x$](http://www.dsprelated.com/josimages_new/mdft/img25.png)
to the general second-order
polynomial in Eq.
![$ \,$](http://www.dsprelated.com/josimages_new/mdft/img131.png)
(
2.1) gives
Using these answers, any second-order polynomial
can be rewritten as a scaled, translated parabola
In this form, the roots are easily found by solving
![$ p(x)=0$](http://www.dsprelated.com/josimages_new/mdft/img136.png)
to get
This is the general
quadratic formula. It was obtained by simple
algebraic manipulation of the original polynomial. There is only one
``catch.'' What happens when
![$ b^2 - 4ac$](http://www.dsprelated.com/josimages_new/mdft/img138.png)
is negative? This introduces the
square root of a negative number which we could insist ``does not exist.''
Alternatively, we could invent
complex numbers to accommodate it.
Next Section: Complex RootsPrevious Section: Factoring a Polynomial