mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, the difference of two squares is a
squared
A square is a regular quadrilateral with four equal sides and four right angles.
Square or Squares may also refer to:
Mathematics and science
*Square (algebra), multiplying a number or expression by itself
*Square (cipher), a cryptographic block ...
(multiplied by itself) number subtracted from another squared number. Every difference of squares may be factored according to the identity
:
in elementary algebra.
Proof
The
proof
Proof most often refers to:
* Proof (truth), argument or sufficient evidence for the truth of a proposition
* Alcohol proof, a measure of an alcoholic drink's strength
Proof may also refer to:
Mathematics and formal logic
* Formal proof, a con ...
of the factorization identity is straightforward. Starting from the
left-hand side
In mathematics, LHS is informal shorthand for the left-hand side of an equation. Similarly, RHS is the right-hand side. The two sides have the same value, expressed differently, since equality is symmetric.distributive law to get
:
By the commutative law, the middle two terms cancel:
:
leaving
:
The resulting identity is one of the most commonly used in mathematics. Among many uses, it gives a simple proof of the AM–GM inequality in two variables.
The proof holds in any
commutative ring
In mathematics, a commutative ring is a ring in which the multiplication operation is commutative. The study of commutative rings is called commutative algebra. Complementarily, noncommutative algebra is the study of ring properties that are not sp ...
.
Conversely, if this identity holds in a ring ''R'' for all pairs of elements ''a'' and ''b'', then ''R'' is commutative. To see this, apply the distributive law to the right-hand side of the equation and get
:.
For this to be equal to , we must have
:
for all pairs ''a'', ''b'', so ''R'' is commutative.
Geometrical demonstrations
The difference of two squares can also be illustrated geometrically as the difference of two square areas in a plane. In the diagram, the shaded part represents the difference between the areas of the two squares, i.e. . The area of the shaded part can be found by adding the areas of the two rectangles; , which can be factorized to . Therefore, .
Another geometric proof proceeds as follows: We start with the figure shown in the first diagram below, a large square with a smaller square removed from it. The side of the entire square is a, and the side of the small removed square is b. The area of the shaded region is . A cut is made, splitting the region into two rectangular pieces, as shown in the second diagram. The larger piece, at the top, has width a and height a-b. The smaller piece, at the bottom, has width a-b and height b. Now the smaller piece can be detached, rotated, and placed to the right of the larger piece. In this new arrangement, shown in the last diagram below, the two pieces together form a rectangle, whose width is and whose height is . This rectangle's area is . Since this rectangle came from rearranging the original figure, it must have the same area as the original figure. Therefore, .
Uses
Factorization of polynomials and simplification of expressions
The formula for the difference of two squares can be used for factoring polynomials that contain the square of a first quantity minus the square of a second quantity. For example, the polynomial can be factored as follows:
:
As a second example, the first two terms of can be factored as , so we have:
:
Moreover, this formula can also be used for simplifying expressions:
:
Complex number case: sum of two squares
The difference of two squares is used to find the linear factors of the ''sum'' of two squares, using
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 ...
coefficients.
For example, the complex roots of can be found using difference of two squares:
:
: (since )
:
:
Therefore, the linear factors are and .
Since the two factors found by this method are
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, then) the complex conjugate of a + bi is equal to a - ...
s, we can use this in reverse as a method of multiplying a complex number to get a real number. This is used to get real denominators in complex fractions.
Rationalising denominators
The difference of two squares can also be used in the rationalising of
irrational
Irrationality is cognition, thinking, talking, or acting without inclusion of rationality. It is more specifically described as an action or opinion given through inadequate use of reason, or through emotional distress or cognitive deficiency. ...
denominator
A fraction (from la, fractus, "broken") represents a part of a whole or, more generally, any number of equal parts. When spoken in everyday English, a fraction describes how many parts of a certain size there are, for example, one-half, eight ...
s. This is a method for removing surds from expressions (or at least moving them), applying to division by some combinations involving
square root
In mathematics, a square root of a number is a number such that ; in other words, a number whose ''square'' (the result of multiplying the number by itself, or ⋅ ) is . For example, 4 and −4 are square roots of 16, because .
...
s.
For example:
The denominator of can be rationalised as follows:
:
:
:
:
:
:
Here, the irrational denominator has been rationalised to .
Mental arithmetic
The difference of two squares can also be used as an arithmetical short cut. If two numbers (whose average is a number which is easily squared) are multiplied, the difference of two squares can be used to give you the product of the original two numbers.
For example:
:
Using the difference of two squares, can be restated as
: which is .
Difference of two consecutive perfect squares
The difference of two consecutive
perfect square
''Perfect Square'' is a 2004 concert film of the alternative rock Musical ensemble, band R.E.M. (band), R.E.M., filmed on July 19, 2003, at the bowling green, Bowling Green in Wiesbaden, Germany. It was released by Warner Reprise Video on March 9, ...
s is the sum of the two bases ''n'' and ''n''+1. This can be seen as follows:
:
Therefore, the difference of two consecutive perfect squares is an odd number. Similarly, the difference of two arbitrary perfect squares is calculated as follows:
:
Therefore, the difference of two even perfect squares is a multiple of 4 and the difference of two odd perfect squares is a multiple of 8.
Factorization of integers
Several algorithms in number theory and cryptography use differences of squares to find factors of integers and detect composite numbers. A simple example is the Fermat factorization method, which considers the sequence of numbers , for . If one of the equals a perfect square , then is a (potentially non-trivial) factorization of .
This trick can be generalized as follows. If mod and mod , then is composite with non-trivial factors and . This forms the basis of several factorization algorithms (such as the quadratic sieve) and can be combined with the Fermat primality test to give the stronger
Miller–Rabin primality test
The Miller–Rabin primality test or Rabin–Miller primality test is a probabilistic primality test: an algorithm which determines whether a given number is likely to be prime, similar to the Fermat primality test and the Solovay–Strassen pri ...
.
Generalizations
The identity also holds in
inner product space
In mathematics, an inner product space (or, rarely, a Hausdorff pre-Hilbert space) is a real vector space or a complex vector space with an operation called an inner product. The inner product of two vectors in the space is a scalar, often ...
real numbers
In mathematics, a real number is a number that can be used to measure a ''continuous'' one-dimensional quantity such as a distance, duration or temperature. Here, ''continuous'' means that values can have arbitrarily small variations. Every ...
, such as for
dot product
In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a scalar as a result". It is also used sometimes for other symmetric bilinear forms, for example in a pseudo-Euclidean space. is an alg ...
of
Euclidean vector
In mathematics, physics, and engineering, a Euclidean vector or simply a vector (sometimes called a geometric vector or spatial vector) is a geometric object that has magnitude (or length) and direction. Vectors can be added to other vectors ...
s:
:
The proof is identical. For the special case that and have equal norms (which means that their dot squares are equal), this demonstrates analytically the fact that two diagonals of a
rhombus
In plane Euclidean geometry, a rhombus (plural rhombi or rhombuses) is a quadrilateral whose four sides all have the same length. Another name is equilateral quadrilateral, since equilateral means that all of its sides are equal in length. Th ...
are
perpendicular
In elementary geometry, two geometric objects are perpendicular if they intersect at a right angle (90 degrees or π/2 radians). The condition of perpendicularity may be represented graphically using the ''perpendicular symbol'', ⟂. It can ...
. This follows from the left side of the equation being equal to zero, requiring the right side to equal zero as well, and so the vector sum of (the long diagonal of the rhombus) dotted with the vector difference (the short diagonal of the rhombus) must equal zero, which indicates the diagonals are perpendicular.
Difference of two nth powers
If ''a'' and ''b'' are two elements of a commutative ring ''R'', then .
History
Historically, the Babylonians used the difference of two squares to calculate multiplications.
For example:
93 x 87 = 90² - 3² = 8091
64 x 56 = 60² - 4² = 3584
Factorization
In mathematics, factorization (or factorisation, see English spelling differences) or factoring consists of writing a number or another mathematical object as a product of several ''factors'', usually smaller or simpler objects of the same kind ...
Notes
References
*
*{{cite book , first1=Alan S. , last1=Tussy , first2=Roy David , last2=Gustafson , title=Elementary Algebra , edition=5th , publisher=Cengage Learning , year=2011 , isbn=978-1-111-56766-8 , pages=467–469 , url=https://books.google.com/books?id=xwOrtVKSVpoC&pg=PA467