Difference of two squares
Template:Short description 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:
<math display=block>a^2-b^2 = (a+b)(a-b).</math>
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:
<math display=block>xy = \left(\frac{x + y}{2}\right)^2 - \left(\frac{x - y}{2}\right)^2.</math>
ProofEdit
Algebraic proofEdit
The proof of the factorization identity is straightforward. Starting from the right-hand side, apply the distributive law to get <math display=block>(a+b)(a-b) = a^2+ba-ab-b^2.</math> By the commutative law, the middle two terms cancel: <math display=block>ba - ab = 0</math> leaving<ref name="bbc-bitesize">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> <math display=block>(a+b)(a-b) = a^2-b^2.</math> 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 Template:Mvar for all pairs of elements Template:Mvar and Template:Mvar, then Template:Mvar is commutative. To see this, apply the distributive law to the right-hand side of the equation and get <math display=block>a^2 + ba - ab - b^2.</math> For this to be equal to Template:Tmath, we must have <math display=block>ba - ab = 0</math> for all pairs Template:Mvar, Template:Mvar, so Template:Mvar is commutative.
Geometric proofEdit
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. <math>a^2 - b^2</math>. The area of the shaded part can be found by adding the areas of the two rectangles; <math>a(a-b) + b(a-b)</math>, which can be factorized to <math>(a+b)(a-b)</math>. Therefore, <math>a^2 - b^2 = (a+b)(a-b)</math>.
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; thus, the area of the shaded region is <math>a^2-b^2</math>. 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 <math>a+b</math> and whose height is <math>a-b</math>. This rectangle's area is <math>(a+b)(a-b)</math>. Since this rectangle came from rearranging the original figure, it must have the same area as the original figure. Therefore, <math>a^2-b^2 = (a+b)(a-b)</math>.<ref>Template:Cite journal</ref> File:Difference of two squares geometric proof.png
UsageEdit
Factorization of polynomials and simplification of expressionsEdit
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 <math>x^4 - 1</math> can be factored as follows:
<math display=block>x^4 - 1 = (x^2 + 1)(x^2 - 1) = (x^2 + 1)(x + 1)(x - 1).</math>
As a second example, the first two terms of <math>x^2 - y^2 + x - y</math> can be factored as <math>(x + y)(x - y)</math>, so we have: <math display=block> x^2 - y^2 + x - y = (x + y)(x - y) + x - y = (x - y)(x + y + 1). </math> Moreover, this formula can also be used for simplifying expressions: <math display=block> (a+b)^2-(a-b)^2=(a+b+a-b)(a+b-a+b)=(2a)(2b)=4ab. </math>
Complex number case: sum of two squaresEdit
The difference of two squares is used to find the linear factors of the sum of two squares, using complex number coefficients.
For example, the complex roots of <math>z^2 + 4</math> can be found using difference of two squares:
<math display=block>\begin{align} z^2 + 4 &= z^2 - 4i^2 \\ &= z^2 - (2 i)^2 \\ &= (z + 2 i)(z - 2 i). \\ \end{align}</math>
Therefore, the linear factors are <math>(z + 2 i)</math> and <math>(z - 2 i)</math>.
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.<ref>Complex or imaginary numbers TheMathPage.com, retrieved 22 December 2011</ref>
Rationalising denominatorsEdit
The difference of two squares can also be used, in reverse, in the rationalising of irrational denominators.<ref>Multiplying Radicals TheMathPage.com, retrieved 22 December 2011</ref> This is a method for removing surds from expressions (or at least moving them), applying to division by some combinations involving square roots.
For example, the denominator of <math>5 \big/ \bigl(4 + \sqrt{3}\bigr)</math> can be rationalised as follows:
<math display=block>\begin{align} \dfrac{5}{4 + \sqrt{3}} &= \dfrac{5}{4 + \sqrt{3}} \times \dfrac{4 - \sqrt{3}}{4 - \sqrt{3}} \\[10mu] &= \dfrac{5\bigl(4 - \sqrt{3}\bigr)}{4^2 - \sqrt{3}^2} = \dfrac{5\bigl(4 - \sqrt{3}\bigr)}{16 - 3} = \frac{5\bigl(4 - \sqrt{3}\bigr)}{13}. \end{align}</math>
Here, the irrational denominator <math>4 + \sqrt{3}</math> has been rationalised to <math>13</math>.
Mental arithmeticEdit
{{#invoke:Labelled list hatnote|labelledList|Main article|Main articles|Main page|Main pages}} The difference of two squares can also be used as an arithmetical shortcut. If two numbers have an easily squared average, their product can be rewritten as the difference of two squares. For example: <math display=block> 27 \times 33 = (30 - 3)(30 + 3) = 30^2 - 3^2 = 891.</math>
Difference of two consecutive perfect squaresEdit
The difference of two consecutive perfect squares is the sum of the two bases Template:Mvar and Template:Math. This can be seen as follows:
<math display=block>\begin{align} (n+1)^2 - n^2 &= ((n+1)+n)((n+1)-n) \\[5mu] &= 2n+1. \end{align}</math>
Therefore, the difference of two consecutive perfect squares is an odd number. Similarly, the difference of two arbitrary perfect squares is calculated as follows:
<math display=block>\begin{align} (n+k)^2 - n^2 &= ((n+k)+n)((n+k)-n) \\[5mu] &= k(2n+k). \end{align} </math>
Therefore, the difference of two even perfect squares is a multiple of Template:Math and the difference of two odd perfect squares is a multiple of Template:Math.
Galileo's law of odd numbersEdit
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 Template:Math, Template:Math, Template:Math, etc. times that distance in the subsequent time intervals of the same length.
From the equation for uniform linear acceleration, the distance covered <math display=block>s = u t + \tfrac{1}{2} a t^2</math> for initial speed <math>u = 0,</math> constant acceleration <math>a</math> (acceleration due to gravity without air resistance), and time elapsed <math>t,</math> it follows that the distance <math>s</math> is proportional to <math>t^2</math> (in symbols, <math>s \propto t^2</math>), thus the distance from the starting point are consecutive squares for integer values of time elapsed.<ref>RP Olenick et al., The Mechanical Universe: Introduction to Mechanics and Heat</ref>
Factorization of integersEdit
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 <math>x_i:=a_i^2-N</math>, for <math>a_i:=\left\lceil \sqrt{N}\right\rceil+i</math>. If one of the <math>x_i</math> equals a perfect square <math>b^2</math>, then <math>N=a_i^2-b^2=(a_i+b)(a_i-b)</math> is a (potentially non-trivial) factorization of <math>N</math>.
This trick can be generalized as follows. If <math>a^2\equiv b^2</math> mod <math>N</math> and <math>a\not\equiv \pm b</math> mod <math>N</math>, then <math>N</math> is composite with non-trivial factors <math>\gcd(a-b,N)</math> and <math>\gcd(a+b,N)</math>. 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.
GeneralizationsEdit
The identity also holds in inner product spaces over the field of real numbers, such as for dot product of Euclidean vectors:
- <math>{\mathbf a}\cdot{\mathbf a} - {\mathbf b}\cdot{\mathbf b} = ({\mathbf a}+{\mathbf b})\cdot({\mathbf a}-{\mathbf b})</math>
The proof is identical. For the special case that Template:Math and Template:Math 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 Template:Math (the long diagonal of the rhombus) dotted with the vector difference Template:Math (the short diagonal of the rhombus) must equal zero, which indicates the diagonals are perpendicular.
Difference of two nth powersEdit
If Template:Mvar and Template:Mvar are two elements of a commutative ring, then<ref>Template:Cite book</ref>
<math display=block>a^n-b^n=(a-b)\biggl(\sum_{k=0}^{n-1} a^{n-1-k}b^k\biggr).</math>
The second factor looks similar to the binomial expansion of <math>(a+b)^{n-1}</math>, except that it does not include the binomial coefficients Template:Tmath.
See alsoEdit
- Sum of two cubes
- Binomial number
- Sophie Germain's identity
- Aurifeuillean factorization
- Congruum, the shared difference of three squares in arithmetic progression
- Conjugate (algebra)
- Factorization
NotesEdit
Further readingEdit
External linksEdit
- difference of two squares at mathpages.com