Revision as of 16:12, 17 November 2007 by imported>David Gerard
In algebra, completing the square is a way of rewriting a quadratic polynomial as the sum of a constant and a constant multiple of the square of a first-degree polynomial. Thus one has
![{\displaystyle ax^{2}+bx+c=a(\cdots \cdots )^{2}+{\text{constant}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/cd2d9504eef2bf503012dbb917e5cd21497cb6cb)
and completing the square is the way of filling in the blank between the brackets. Completing the square is used for solving quadratic equations (the proof of the well-known quadratic formula consists of completing the square). The technique is also used to find the maximum or minimum value of a quadratic function, or in other words, the vertex of a parabola.
The technique relies on the elementary algebraic identity
![{\displaystyle (u+v)^{2}=u^{2}+2uv+v^{2}.\qquad \qquad (*)}](https://wikimedia.org/api/rest_v1/media/math/render/svg/36f415701d213b9209ef66cf2fcff3461067a307)
Concrete examples
We want to fill in this blank:
![{\displaystyle 3x^{2}+42x-5.\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/3552b996dfc181bf84ab6b226c9d00b179cd6139)
We write
![{\displaystyle {\begin{aligned}3x^{2}+42x-5&{}=3(x^{2}+14x)-5\\&{}=3(x^{2}+2x\cdot 7)-5.\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f38d156f7d1352468dd72dda99055c3df8f4d0aa)
Now the expression (x2 + 2x·7) corresponds to u2 + 2uv in the elementary identity labeled (*) above. If x2 is u2 and 2x·7 is 2uv, then v must be 7. Therefore (u + v)2 must be (x + 7). So we continue:
![{\displaystyle {\begin{aligned}&{}3(x^{2}+2x\cdot 7)-5\\&{}=3\left(x^{2}+2x\cdot 7+7^{2}\right)-5-3(7^{2}),\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f7263a0fe864ffeb67d5a8d915fc501f4a183e6b)
Now we have added 72 inside the parentheses, and compensated (thus justifying the "=") by subtracting 3(72) outside the parentheses. The expression inside the parentheses is now u2 + 2uv + v2, and by the elementary identity labeled (*) above, it is therefore equal to (u + v)2, i.e. to (x + 7)2. So now we have
![{\displaystyle 3(x+7)^{2}-5-3(7^{2})=3(x+7)^{2}-152.\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/0ba3a6fcc9d1f477ba8610f8f2514dc5f478f879)
Thus we have the equality
![{\displaystyle 3x^{2}+42x-5=3(x+7)^{2}-152.\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/200d4a2c49337f0971fedbd782075f6c067817dd)
More abstractly
It is possible to give a closed formula for the completion in terms of the coefficients a, b and c. Namely,
![{\displaystyle ax^{2}+bx+c=a\left(x+{\frac {b}{2a}}\right)^{2}-{\frac {\Delta }{4a}},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/4d170d446d8f0a92c78297cee530a60da08bfdeb)
where
stands for the well-known discriminant of the polynomial, that is
Indeed, we have
![{\displaystyle {\begin{aligned}ax^{2}+bx+c&{}=a\left(x^{2}+{\frac {b}{a}}x\right)+c\\&{}=a\left(x^{2}+2{\frac {b}{2a}}x\right)+c.\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f046f872e79ed28ad5934b0ca2876f1a4da2edb8)
The last expression inside parentheses above corresponds to u2 + 2uv in the identity labelled (*) above. We need to add the third term, v2:
![{\displaystyle {\begin{aligned}ax^{2}+bx+c&{}=a\left(x^{2}+{\frac {b}{a}}x\right)+c\\&{}=a\left(x^{2}+2{\frac {b}{2a}}x+\left({\frac {b}{2a}}\right)^{2}\right)+c-a\left({\frac {b}{2a}}\right)^{2}\\&{}=a\left(x+{\frac {b}{2a}}\right)^{2}+c-{\frac {b^{2}}{4a}}\\&{}=a\left(x+{\frac {b}{2a}}\right)^{2}+{\frac {4ac-b^{2}}{4a}}.\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/39c2de61c9d6e5160708f4b8c6482fe3805f7030)