In
mathematics, the difference of two squares is a
squared (multiplied by itself) number subtracted from another squared number. Every difference of squares may be factored according to the
identity
Identity may refer to:
* Identity document
* Identity (philosophy)
* Identity (social science)
* Identity (mathematics)
Arts and entertainment Film and television
* ''Identity'' (1987 film), an Iranian film
* ''Identity'' (2003 film), ...
:
in
elementary algebra
Elementary algebra encompasses the basic concepts of algebra. It is often contrasted with arithmetic: arithmetic deals with specified numbers, whilst algebra introduces variables (quantities without fixed values).
This use of variables entail ...
.
Proof
The
proof of the factorization identity is straightforward. Starting from the
left-hand side, apply the
distributive law
In mathematics, the distributive property of binary operations generalizes the distributive law, which asserts that the equality
x \cdot (y + z) = x \cdot y + x \cdot z
is always true in elementary algebra.
For example, in elementary arithmetic, ...
to get
:
By the
commutative law
In mathematics, a binary operation is commutative if changing the order of the operands does not change the result. It is a fundamental property of many binary operations, and many mathematical proofs depend on it. Most familiar as the name of ...
, 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 mathematics, the inequality of arithmetic and geometric means, or more briefly the AM–GM inequality, states that the arithmetic mean of a list of non-negative real numbers is greater than or equal to the geometric mean of the same list; a ...
in two variables.
The proof holds in any
commutative ring.
Conversely, if this identity holds in a
ring
Ring may refer to:
* Ring (jewellery), a round band, usually made of metal, worn as ornamental jewelry
* To make a sound with a bell, and the sound made by a bell
:(hence) to initiate a telephone connection
Arts, entertainment and media Film and ...
''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
Plane(s) most often refers to:
* Aero- or airplane, a powered, fixed-wing aircraft
* Plane (geometry), a flat, 2-dimensional surface
Plane or planes may also refer to:
Biology
* Plane (tree) or ''Platanus'', wetland native plant
* ''Planes' ...
. 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
polynomial
In mathematics, a polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables. An example ...
s 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 fo ...
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. T ...
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 squares 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
Fermat's factorization method, named after Pierre de Fermat, is based on the representation of an odd integer as the difference of two squares:
:N = a^2 - b^2.
That difference is algebraically factorable as (a+b)(a-b); if neither factor equals one, ...
, 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 The quadratic sieve algorithm (QS) is an integer factorization algorithm and, in practice, the second fastest method known (after the general number field sieve). It is still the fastest for integers under 100 decimal digits or so, and is consider ...
) and can be combined with the
Fermat primality test
The Fermat primality test is a probabilistic test to determine whether a number is a probable prime.
Concept
Fermat's little theorem states that if ''p'' is prime and ''a'' is not divisible by ''p'', then
:a^ \equiv 1 \pmod.
If one wants to tes ...
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 prim ...
.
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 ...
s over the
field
Field may refer to:
Expanses of open ground
* Field (agriculture), an area of land used for agricultural purposes
* Airfield, an aerodrome that lacks the infrastructure of an airport
* Battlefield
* Lawn, an area of mowed grass
* Meadow, a grass ...
of
real numbers, 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 alge ...
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. The ...
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 ca ...
. 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
![Difference_of_squares_and_cubes_visual_proof](https://upload.wikimedia.org/wikipedia/commons/0/03/Difference_of_squares_and_cubes_visual_proof.svg)
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
See also
*
Congruum
In number theory, a congruum (plural ''congrua'') is the difference between successive square numbers in an arithmetic progression of three squares.
That is, if x^2, y^2, and z^2 (for integers x, y, and z) are three square numbers that are equally ...
, the shared difference of three squares in arithmetic progression
*
Conjugate (algebra)
In mathematics, in particular field theory, the conjugate elements or algebraic conjugates of an algebraic element , over a field extension , are the roots of the minimal polynomial of over . Conjugate elements are commonly called conjuga ...
*
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
External links
difference of two squaresat mathpages.com
Elementary algebra
Commutative algebra
Mathematical identities
Articles containing proofs
Subtraction