In
elementary algebra
Elementary algebra, also known as high school algebra or college algebra, encompasses the basic concepts of algebra. It is often contrasted with arithmetic: arithmetic deals with specified numbers, whilst algebra introduces variable (mathematics ...
, completing the square is a technique for converting a
quadratic polynomial
In mathematics, a quadratic function of a single variable is a function of the form
:f(x)=ax^2+bx+c,\quad a \ne 0,
where is its variable, and , , and are coefficients. The expression , especially when treated as an object in itself rather tha ...
of the form to the form for some values of and . In terms of a new quantity , this expression is a quadratic polynomial with no linear term. By subsequently isolating and taking the
square root
In mathematics, a square root of a number is a number such that y^2 = x; in other words, a number whose ''square'' (the result of multiplying the number by itself, or y \cdot y) is . For example, 4 and −4 are square roots of 16 because 4 ...
, a quadratic problem can be reduced to a linear problem.
The name ''completing the square'' comes from a geometrical picture in which represents an unknown length. Then the quantity represents the area of a
square
In geometry, a square is a regular polygon, regular quadrilateral. It has four straight sides of equal length and four equal angles. Squares are special cases of rectangles, which have four equal angles, and of rhombuses, which have four equal si ...
of side and the quantity represents the area of a pair of
congruent
Congruence may refer to:
Mathematics
* Congruence (geometry), being the same size and shape
* Congruence or congruence relation, in abstract algebra, an equivalence relation on an algebraic structure that is compatible with the structure
* In modu ...
rectangle
In Euclidean geometry, Euclidean plane geometry, a rectangle is a Rectilinear polygon, rectilinear convex polygon or a quadrilateral with four right angles. It can also be defined as: an equiangular quadrilateral, since equiangular means that a ...
s with sides and . To this square and pair of rectangles one more square is added, of side length . This crucial step ''completes'' a larger square of side length .
Completing the square is the oldest method of solving general
quadratic equation
In mathematics, a quadratic equation () is an equation that can be rearranged in standard form as
ax^2 + bx + c = 0\,,
where the variable (mathematics), variable represents an unknown number, and , , and represent known numbers, where . (If and ...
s, used in
Old Babylonian
Old Babylonian may refer to:
*the period of the First Babylonian dynasty (20th to 16th centuries BC)
*the historical stage of the Akkadian language
Akkadian ( ; )John Huehnergard & Christopher Woods, "Akkadian and Eblaite", ''The Cambridge Enc ...
clay tablets dating from 1800–1600 BCE, and is still taught in elementary algebra courses today. It is also used for graphing
quadratic function
In mathematics, a quadratic function of a single variable (mathematics), variable is a function (mathematics), function of the form
:f(x)=ax^2+bx+c,\quad a \ne 0,
where is its variable, and , , and are coefficients. The mathematical expression, e ...
s, deriving the
quadratic formula
In elementary algebra, the quadratic formula is a closed-form expression describing the solutions of a quadratic equation. Other ways of solving quadratic equations, such as completing the square, yield the same solutions.
Given a general quadr ...
, and more generally in computations involving quadratic polynomials, for example in
calculus
Calculus is the mathematics, mathematical study of continuous change, in the same way that geometry is the study of shape, and algebra is the study of generalizations of arithmetic operations.
Originally called infinitesimal calculus or "the ...
evaluating
Gaussian integral
The Gaussian integral, also known as the Euler–Poisson integral, is the integral of the Gaussian function f(x) = e^ over the entire real line. Named after the German mathematician Carl Friedrich Gauss, the integral is
\int_^\infty e^\,dx = \s ...
s with a linear term in the exponent, and finding
Laplace transform
In mathematics, the Laplace transform, named after Pierre-Simon Laplace (), is an integral transform that converts a Function (mathematics), function of a Real number, real Variable (mathematics), variable (usually t, in the ''time domain'') to a f ...
s.
History
The technique of completing the square was known in the
Old Babylonian Empire
The Old Babylonian Empire, or First Babylonian Empire, is dated to , and comes after the end of Sumerian power with the destruction of the Third Dynasty of Ur, and the subsequent Isin-Larsa period. The chronology of the first dynasty of Babylon ...
.
Muhammad ibn Musa Al-Khwarizmi
Muhammad ibn Musa al-Khwarizmi , or simply al-Khwarizmi, was a mathematician active during the Islamic Golden Age, who produced Arabic-language works in mathematics, astronomy, and geography. Around 820, he worked at the House of Wisdom in B ...
, a famous
polymath
A polymath or polyhistor is an individual whose knowledge spans many different subjects, known to draw on complex bodies of knowledge to solve specific problems. Polymaths often prefer a specific context in which to explain their knowledge, ...
who wrote the early
algebraic treatise
Al-Jabr
''The Concise Book of Calculation by Restoration and Balancing'' (, ;} or ), commonly abbreviated ''Al-Jabr'' or ''Algebra'' (Arabic: ), is an Arabic mathematical treatise on algebra written in Baghdad around 820 by the Persian polymath Al-Khw ...
, used the technique of completing the square to solve quadratic equations.
Overview
Background
The formula in
elementary algebra
Elementary algebra, also known as high school algebra or college algebra, encompasses the basic concepts of algebra. It is often contrasted with arithmetic: arithmetic deals with specified numbers, whilst algebra introduces variable (mathematics ...
for computing the
square
In geometry, a square is a regular polygon, regular quadrilateral. It has four straight sides of equal length and four equal angles. Squares are special cases of rectangles, which have four equal angles, and of rhombuses, which have four equal si ...
of a
binomial
Binomial may refer to:
In mathematics
*Binomial (polynomial), a polynomial with two terms
*Binomial coefficient, numbers appearing in the expansions of powers of binomials
*Binomial QMF, a perfect-reconstruction orthogonal wavelet decomposition
* ...
is:
For example:
In any perfect square, the
coefficient
In mathematics, a coefficient is a Factor (arithmetic), multiplicative factor involved in some Summand, term of a polynomial, a series (mathematics), series, or any other type of expression (mathematics), expression. It may be a Dimensionless qu ...
of ''x'' is twice the number ''p'', and the
constant term
In mathematics, a constant term (sometimes referred to as a free term) is a term in an algebraic expression that does not contain any variables and therefore is constant. For example, in the quadratic polynomial,
:x^2 + 2x + 3,\
The number 3 i ...
is equal to ''p''
2.
Basic example
Consider the following quadratic
polynomial
In mathematics, a polynomial is a Expression (mathematics), mathematical expression consisting of indeterminate (variable), indeterminates (also called variable (mathematics), variables) and coefficients, that involves only the operations of addit ...
:
This quadratic is not a perfect square, since 28 is not the square of 5:
However, it is possible to write the original quadratic as the sum of this square and a constant:
This is called completing the square.
General description
Given any
monic quadratic
it is possible to form a square that has the same first two terms:
This square differs from the original quadratic only in the value of the constant
term. Therefore, we can write
where
. This operation is known as completing the square.
For example:
Non-monic case
Given a quadratic polynomial of the form
it is possible to factor out the coefficient ''a'', and then complete the square for the resulting
monic polynomial
In algebra, a monic polynomial is a non-zero univariate polynomial (that is, a polynomial in a single variable) in which the leading coefficient (the nonzero coefficient of highest degree) is equal to 1. That is to say, a monic polynomial is one ...
.
Example:
This process of factoring out the coefficient ''a'' can further be simplified by only factorising it out of the first 2 terms. The integer at the end of the polynomial does not have to be included.
Example:
This allows the writing of any quadratic polynomial in the form
Formula
Scalar case
The result of completing the square may be written as a formula. In the general case, one has
with
In particular, when , one has
with
By solving the equation
in terms of
and reorganizing the resulting
expression, one gets the
quadratic formula
In elementary algebra, the quadratic formula is a closed-form expression describing the solutions of a quadratic equation. Other ways of solving quadratic equations, such as completing the square, yield the same solutions.
Given a general quadr ...
for the roots of the
quadratic equation
In mathematics, a quadratic equation () is an equation that can be rearranged in standard form as
ax^2 + bx + c = 0\,,
where the variable (mathematics), variable represents an unknown number, and , , and represent known numbers, where . (If and ...
:
Matrix case
The
matrix
Matrix (: matrices or matrixes) or MATRIX may refer to:
Science and mathematics
* Matrix (mathematics), a rectangular array of numbers, symbols or expressions
* Matrix (logic), part of a formula in prenex normal form
* Matrix (biology), the m ...
case looks very similar:
where
and
. Note that
has to be
symmetric
Symmetry () in everyday life refers to a sense of harmonious and beautiful proportion and balance. In mathematics, the term has a more precise definition and is usually used to refer to an object that is invariant under some transformations ...
.
If
is not symmetric the formulae for
and
have to be generalized to:
Relation to the graph
In
analytic geometry
In mathematics, analytic geometry, also known as coordinate geometry or Cartesian geometry, is the study of geometry using a coordinate system. This contrasts with synthetic geometry.
Analytic geometry is used in physics and engineering, and als ...
, the
graph
Graph may refer to:
Mathematics
*Graph (discrete mathematics), a structure made of vertices and edges
**Graph theory, the study of such graphs and their properties
*Graph (topology), a topological space resembling a graph in the sense of discret ...
of any
quadratic function
In mathematics, a quadratic function of a single variable (mathematics), variable is a function (mathematics), function of the form
:f(x)=ax^2+bx+c,\quad a \ne 0,
where is its variable, and , , and are coefficients. The mathematical expression, e ...
is a
parabola
In mathematics, a parabola is a plane curve which is Reflection symmetry, mirror-symmetrical and is approximately U-shaped. It fits several superficially different Mathematics, mathematical descriptions, which can all be proved to define exactl ...
in the ''xy''-plane. Given a quadratic polynomial of the form
the numbers ''h'' and ''k'' may be interpreted as the
Cartesian coordinates
In geometry, a Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of real numbers called ''coordinates'', which are the signed distances to the point from two fixed perpendicular o ...
of the
vertex (or
stationary point
In mathematics, particularly in calculus, a stationary point of a differentiable function of one variable is a point on the graph of a function, graph of the function where the function's derivative is zero. Informally, it is a point where the ...
) of the parabola. That is, ''h'' is the ''x''-coordinate of the axis of symmetry (i.e. the axis of symmetry has equation ''x = h''), and ''k'' is the
minimum value (or maximum value, if ''a'' < 0) of the quadratic function.
One way to see this is to note that the graph of the
function is a parabola whose vertex is at the origin (0, 0). Therefore, the graph of the function is a parabola shifted to the right by ''h'' whose vertex is at (''h'', 0), as shown in the top figure. In contrast, the graph of the function is a parabola shifted upward by whose vertex is at , as shown in the center figure. Combining both horizontal and vertical shifts yields is a parabola shifted to the right by and upward by whose vertex is at , as shown in the bottom figure.
Solving quadratic equations
Completing the square may be used to solve any
quadratic equation
In mathematics, a quadratic equation () is an equation that can be rearranged in standard form as
ax^2 + bx + c = 0\,,
where the variable (mathematics), variable represents an unknown number, and , , and represent known numbers, where . (If and ...
. For example:
The first step is to complete the square:
Next we solve for the squared term:
Then either
and therefore
This can be applied to any quadratic equation. When the ''x''
2 has a coefficient other than 1, the first step is to divide out the equation by this coefficient: for an example see the non-monic case below.
Irrational and complex roots
Unlike methods involving
factoring the equation, which is reliable only if the roots are
rational
Rationality is the quality of being guided by or based on reason. In this regard, a person acts rationally if they have a good reason for what they do, or a belief is rational if it is based on strong evidence. This quality can apply to an ...
, completing the square will find the roots of a quadratic equation even when those roots are
irrational
Irrationality is cognition, thinking, talking, or acting without rationality.
Irrationality often has a negative connotation, as thinking and actions that are less useful or more illogical than other more rational alternatives. The concept of ...
or
complex
Complex commonly refers to:
* Complexity, the behaviour of a system whose components interact in multiple ways so possible interactions are difficult to describe
** Complex system, a system composed of many components which may interact with each ...
. For example, consider the equation
Completing the square gives
so
Then either
In terser language:
so
Equations with complex roots can be handled in the same way. For example:
Non-monic case
For an equation involving a non-
monic quadratic, the first step to solving them is to divide through by the coefficient of ''x''
2. For example:
Applying this procedure to the general form of a quadratic equation leads to the
quadratic formula
In elementary algebra, the quadratic formula is a closed-form expression describing the solutions of a quadratic equation. Other ways of solving quadratic equations, such as completing the square, yield the same solutions.
Given a general quadr ...
.
Other applications
Integration
Completing the square may be used to evaluate any integral of the form
using the basic integrals
For example, consider the integral
Completing the square in the denominator gives:
This can now be evaluated by using the
substitution
''u'' = ''x'' + 3, which yields
Complex numbers
Consider the expression
where ''z'' and ''b'' are
complex number
In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the for ...
s, ''z''
* and ''b''
* are the
complex conjugate
In mathematics, the complex conjugate of a complex number is the number with an equal real part and an imaginary part equal in magnitude but opposite in sign. That is, if a and b are real numbers, then the complex conjugate of a + bi is a - ...
s of ''z'' and ''b'', respectively, and ''c'' is a
real number
In mathematics, a real number is a number that can be used to measure a continuous one- dimensional quantity such as a duration or temperature. Here, ''continuous'' means that pairs of values can have arbitrarily small differences. Every re ...
. Using the identity , ''u'',
2 = ''uu''
* we can rewrite this as
which is clearly a real quantity. This is because
As another example, the expression
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
In mathematics, the absolute value or modulus of a real number x, is the non-negative value without regard to its sign. Namely, , x, =x if x is a positive number, and , x, =-x if x is negative (in which case negating x makes -x positive), ...
of a complex number. Define
Then
so
Idempotent matrix
A
matrix
Matrix (: matrices or matrixes) or MATRIX may refer to:
Science and mathematics
* Matrix (mathematics), a rectangular array of numbers, symbols or expressions
* Matrix (logic), part of a formula in prenex normal form
* Matrix (biology), the m ...
''M'' is
idempotent
Idempotence (, ) is the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result beyond the initial application. The concept of idempotence arises in a number of pl ...
when ''M''
2 = ''M''. Idempotent matrices generalize the idempotent properties of 0 and 1. The completion of the square method of addressing the equation
shows that some idempotent 2×2 matrices are parametrized by a
circle
A circle is a shape consisting of all point (geometry), points in a plane (mathematics), plane that are at a given distance from a given point, the Centre (geometry), centre. The distance between any point of the circle and the centre is cal ...
in the (''a'',''b'')-plane:
The matrix
will be idempotent provided
which, upon completing the square, becomes
In the (''a'',''b'')-plane, this is the equation of a circle with center (1/2, 0) and radius 1/2.
Geometric perspective
Consider completing the square for the equation
Since ''x''
2 represents the area of a square with side of length ''x'', and ''bx'' represents the area of a rectangle with sides ''b'' and ''x'', the process of completing the square can be viewed as visual manipulation of rectangles.
Simple attempts to combine the ''x''
2 and the ''bx'' rectangles into a larger square result in a missing corner. The term (''b''/2)
2 added to each side of the above equation is precisely the area of the missing corner, whence derives the terminology "completing the square".
A variation on the technique
As conventionally taught, completing the square consists of adding the third term, ''v'' to
to get a square. There are also cases in which one can add the middle term, either 2''uv'' or −2''uv'', to
to get a square.
Example: the sum of a positive number and its reciprocal
By writing
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.
Example: factoring a simple quartic polynomial
Consider the problem of factoring the polynomial
This is
so the middle term is 2(''x''
2)(18) = 36''x''
2. Thus we get
(the last line being added merely to follow the convention of decreasing degrees of terms).
The same argument shows that
is always factorizable as
(Also known as
Sophie Germain's identity).
Completing the cube
"Completing the square" consists to remark that the two first terms of a
quadratic polynomial
In mathematics, a quadratic function of a single variable is a function of the form
:f(x)=ax^2+bx+c,\quad a \ne 0,
where is its variable, and , , and are coefficients. The expression , especially when treated as an object in itself rather tha ...
are also the first terms of the square of a
linear polynomial
In mathematics, a polynomial is a mathematical expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication and exponentiation to nonnegative integer ...
, and to use this for expressing the quadratic polynomial as the sum of a square and a constant.
Completing the cube is a similar technique that allows to transform a
cubic polynomial
In mathematics, a cubic function is a function (mathematics), function of the form f(x)=ax^3+bx^2+cx+d, that is, a polynomial function of degree three. In many texts, the ''coefficients'' , , , and are supposed to be real numbers, and the func ...
into a cubic polynomial without term of degree two.
More precisely, if
:
is a polynomial in such that
its two first terms are the two first terms of the expanded form of
:
So, the
change of variable
:
provides a cubic polynomial in
without term of
degree two, which is called the
depressed form of the original polynomial.
This transformation is generally the first step of the methods for solving the general cubic equation.
More generally, a similar transformation can be used for removing terms of degree
in polynomials of degree
, which is called
Tschirnhaus transformation
In mathematics, a Tschirnhaus transformation, also known as Tschirnhausen transformation, is a type of mapping on polynomials developed by Ehrenfried Walther von Tschirnhaus in 1683.
Simply, it is a method for transforming a polynomial equation ...
.
References
*Algebra 1, Glencoe, , pages 539–544
*Algebra 2, Saxon, , pages 214–214, 241–242, 256–257, 398–401
External links
*{{PlanetMath , urlname=completingthesquare , title=Completing the square
Elementary algebra
Articles containing proofs
Articles containing video clips