↑ arvau

Wikipedia / Difference of two squares

In elementary algebra, a difference of two squares is one squared number (the number multiplied by itself) subtracted from another squared number. Every difference of squares may be factored as the product of the sum of the two numbers and the difference of the two numbers:

:

In the reverse direction, the product of any two numbers can be expressed as the difference between the square of their average and the square of half their difference:

Proof

Algebraic proof

The proof of the factorization identity is straightforward. Starting from the right-hand side, apply the distributive law By the commutative law 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 not only for numbers, but for elements of any commutative ring. Conversely, if this identity holds in a ring for all pairs of elements and , then For this to be equal to for all pairs , , so is commutative.

Geometric proof

The difference of two squares can also be illustrated geometrically as the difference of two square areas in a plane.

.

Usage

Factorization of polynomials and simplification of expressions

The formula for the difference of two squares can be used for factoring polynomials can be factored as follows:

Complex number case: sum of two squares

The difference of two squares can be used to find the linear factors of the sum of two squares, using complex number coefficients.

, and using the difference of two squares:

.

Since the two factors found by this method are complex conjugates, 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 reverse, in the rationalising of irrational denominators. This is a method for removing surds from expressions (or at least moving them), applying to division by some combinations involving square roots.

can be rationalised as follows:

.

Mental arithmetic

Difference of two consecutive perfect squares

The difference of two consecutive perfect squaress is the sum of the two basess and . 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 and the difference of two odd perfect squares is a multiple of .

Galileo's law of odd numbers

A ramification of the difference of consecutive squares, Galileo's law of odd numbers states that the distance covered by an object falling without resistance in uniform gravity in successive equal time intervals is linearly proportional to the odd numbers. That is, if a body falling from rest covers a certain distance during an arbitrary time interval, it will cover , , , etc. times that distance in the subsequent time intervals of the same length.

), thus the distance from the starting point are consecutive squares for integer values of time elapsed.

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.

. 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.

Generalizations

The identity also holds in inner product spaces over the field of real numbers, such as for dot product of Euclidean vectors:

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 are perpendicular. 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 and are two elements of a commutative ring, then

The second factor looks similar to the binomial expansion, except that it does not include the binomial coefficients .

Difference of two nth powers of matrices

In the case of two square matrices and , the upper identity does generally not hold true since the multiplication of matrices is not commutative. A similar result still holds:

Proof via induction, then the induction step is

and the result follows by the principle of induction.

See also

Notes

Further reading