Completing the square
From Wikipedia, the free encyclopedia
Completing the square is an algebra technique, used in algebra for (among other things) solving quadratic equations, in analytic geometry for discovering the shapes of graphs, and in calculus for computing integrals, including, but hardly limited to, the integrals that define Laplace transforms. The essential objective is to reduce a quadratic polynomial in a variable in an equation or expression to a squared polynomial of linear order. This can reduce an equation to one that one knows how to solve, or an integral to one that one knows how to evaluate.
The purpose of completing the square is to fill in the following blank:
- <math>ax^2 + bx + c = a(\cdots\cdots)^2 + \mbox{constant}.\,</math>
The expression that will replace the blank depends of course on the variable x. The "constant" does not; that is why it is a "constant".
Contents |
[edit] Overview
In elementary algebra, completing the square is a technique in which an expression involving a quadratic polynomial is transformed to one involving a squared linear polynomial and a constant. It converts a polynomial fragment of the form
- <math>a x^2 + b x\,\!</math>
to one of the form
- <math>(c x + d)^2 + e\,\!</math>
The coefficients a, b, c, d and e above can be expressions in their own right, containing variables other than x.
Completing the square is commonly used to derive the quadratic formula, which solves a quadratic equation.
- <math>\begin{align}
ax^2+bx+c &{}= 0\\
ax^2+bx &{}= -c\\
x^2 + \frac{b}{a} x &{}= -\frac{c}{a}\\
x^2 + \frac{b}{a} x + \left(\frac{b}{2a}\right)^2 &{}= \left(\frac{b}{2a}\right)^2 -\frac{c}{a} &\text{complete the square}\\
\left(x + \frac{b}{2a}\right)^2 &{}= \frac{b^2-4ac}{4a^2}\\
x + \frac{b}{2a} &{}= \pm\frac{\sqrt{b^2-4ac}}{2a}\\
x &{}= \frac{-b \pm \sqrt{b^2-4ac}}{2a}
\end{align}</math>
[edit] General formula
Assume a is positive. To achieve
- <math>a x^2 + b x = (c x + d)^2 + e , \,\!</math>
we must set
- <math>
\begin{align}
c &{}= \sqrt{a} ,\\
d &{}= \frac{b}{2\sqrt{a}} ,\\
e &{}= -d^2\\
&{}= -\left(\frac{b}{2\sqrt{a}}\right)^2\\
&{}= -\frac{b^2}{4a} .
\end{align}</math>
This gives
- <math>a x^2 + b x = \left(\sqrt{a}\,x + \frac{b}{2 \sqrt{a}}\right)^2 -
\frac{b^2}{4a} . \,\!</math>
[edit] Examples
[edit] Concrete example
- <math>\begin{align}5x^2 + 7x - 6 &{}= 5\left(x^2 + {7 \over 5}x\right) -6 \\
&{}= 5\left(x^2 + {7 \over 5}x +\left({7 \over 10}\right)^2\right) - 6 - 5\left({7 \over 10}\right)^2 \\ &{}= 5\left(x + {7 \over 10}\right)^2 - 6 - {7^2 \over 2\cdot 10} \\ &{}= 5\left(x + {7 \over 10}\right)^2 - {6\cdot 20 + 7^2 \over 20} \\ &{}= 5\left(x + {7 \over 10}\right)^2 - {169 \over 20}. \end{align} </math>
With this we can find the values of x that produce zero, the roots of the polynomial.
- <math>
\begin{align} 5x^2 + 7x - 6 &{}= 0\\ 5\left(x + {7 \over 10}\right)^2 - {169 \over 20} &{}= 0\\ \left(x + {7 \over 10}\right)^2 &{}= {169 \over 100}\\ &{}= \left({13 \over 10}\right)^2\\ x + {7 \over 10} &{}= \pm {13 \over 10}\\ x &{}= {-7 \pm 13 \over 10}\\ &{}= {3 \over 5}\mbox{ or }-2. \end{align}</math>
We can also find the x value where the function defined by the polynomial,
- <math>y = 5x^2 + 7x - 6 , \,\!</math>
achieves its most extreme values. The highest power, x2, has a positive coefficient, so large positive or negative values of x produce large values of y. Thus the interesting extreme is the minimum value for y. From the squared form,
- <math>y = 5\left(x + \frac{7}{10}\right)^2 - \frac{169}{20} , </math>
we see that if
- <math>x = -{7 \over 10} , </math>
then y = 169⁄20 = 8.45; but if x is any other number, then y is 169⁄20 plus a nonzero square. Since squares of nonzero real numbers are positive, it must be that whenever x is any other number than −7⁄10, then y > 8.45. Thus the point (x, y) = (−7⁄10, 169⁄20) = (−0.7, 8.45) has the minimum possible value of y.
[edit] Calculus example
Consider the problem of finding this antiderivative:
- <math>\int\frac{1}{9x^2-90x+241}\,dx\,\!</math>.
This can be done by completing the square of the denominator. The denominator is
- <math>9x^2-90x+241=9(x^2-10x)+241\,\!</math>.
Completing the square by adding (10⁄2)2 = 25 to x2−10x gives a perfect square, x2 − 10x + 25 = (x−5)2. The denominator becomes
- <math>
\begin{align}
9(x^2-10x)+241 &{}=9(x^2-10x+25)+241-9(25)\\
&{}=9(x-5)^2+16 .
\end{align}</math>
So our integral is
- <math>
\begin{align}
\int\frac{1}{9x^2-90x+241}\,dx &{}=\frac{1}{9}\int\frac{1}{(x-5)^2+(4/3)^2}\,dx\\
&{}=\frac{1}{9}\cdot\frac{3}{4}\arctan\frac{3(x-5)}{4}+C .
\end{align}</math>
The point is that the revised denominator allows us to match a known result from a table of integrals,
- <math>\int\frac{1}{u^2+a^2}\,du = \frac{1}{a} \arctan \frac{u}{a} + C .</math>
[edit] Complex number examples
Consider the expression
- <math> |z|^2 - b^*z - bz^* + c,\,</math>
where z and b are complex numbers, z* and b* are the complex conjugates of z and b, respectively, and c is a real number. Using the identity |u|2 = uu* we can rewrite this as
- <math> |z-b|^2 - |b|^2 + c , \,\!</math>
which is clearly a real quantity. This is because
- <math>
\begin{align}
|z-b|^2 &{}= (z-b)(z-b)^*\\
&{}= (z-b)(z^*-b^*)\\
&{}= zz^* - zb^* - bz^* + bb^*\\
&{}= |z|^2 - zb^* - bz^* + |b|^2 .
\end{align}</math>
As another example, the expression
- <math> ax^2 + by^2 + c , \,\!</math>
where a, b, c, x, and y are real numbers, with a > 0 and b > 0, may be expressed in terms of the square of the absolute value of a complex number. Define
- <math> z = \sqrt{a}\,x + i \sqrt{b} \,y . </math>
Then
- <math>
\begin{align}
|z|^2 &{}= z z^*\\
&{}= (\sqrt{a}\,x + i \sqrt{b}\,y)(\sqrt{a}\,x - i \sqrt{b}\,y) \\
&{}= ax^2 - i\sqrt{ab}\,xy + i\sqrt{ba}\,yx - i^2by^2 \\
&{}= ax^2 + by^2 ,
\end{align}</math>
so
- <math> ax^2 + by^2 + c = |z|^2 + c . \,\!</math>
[edit] A variation on the technique
As conventionally taught, completing the square consists of adding the third term, v 2 to
- <math>u^2 + 2uv\,</math>
to get a square. There are also cases in which one can add the middle term, either 2uv or −2uv, to
- <math>u^2 + v^2\,</math>
to get a square.
[edit] Example: the sum of a positive number and its reciprocal
By writing
- <math>
\begin{align} x + {1 \over x} &{} = \left(x - 2 + {1 \over x}\right) + 2\\
&{}= \left(\sqrt{x} - {1 \over \sqrt{x}}\right)^2 + 2
\end{align}</math>
we show that the sum of a positive number x and its reciprocal is always greater than or equal to 2. The square of a real expression is always greater than or equal to zero, which gives the stated bound; and here we achieve 2 just when x is 1, causing the square to vanish.
[edit] Example: factoring a simple quartic polynomial
Consider the problem of factoring the polynomial
- <math>x^4 + 324 . \,\!</math>
This is
- <math>(x^2)^2 + (18)^2, \,\!</math>
so the middle term is 2(x2)(18) = 36x2. Thus we get
- <math>\begin{align} x^4 + 324 &{}= (x^4 + 36x^2 + 324 ) - 36x^2 \\
&{}= (x^2 + 18)^2 - (6x)^2 =\text{a difference of two squares} \\ &{}= (x^2 + 18 + 6x)(x^2 + 18 - 6x) \\ &{}= (x^2 + 6x + 18)(x^2 - 6x + 18) \end{align}</math>
(the last line being added merely to follow the convention of decreasing degrees of terms).
[edit] External link
de:Quadratische Ergänzung es:Completando el cuadrado eo:Plenigo de kvadrato he:השלמה לריבוע la:Perfectio quadri sv:Kvadratkomplettering

