Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Difference of two squares
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Usage== ===Factorization of polynomials and simplification of expressions=== The formula for the difference of two squares can be used for factoring [[polynomial]]s 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 squares=== 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 conjugate]]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.<ref>[http://www.themathpage.com/alg/complex-numbers.htm#conjugates Complex or imaginary numbers] TheMathPage.com, retrieved 22 December 2011</ref> ===Rationalising denominators=== The difference of two squares can also be used, in reverse, in the [[Rationalisation (mathematics)|rationalising]] of [[irrational number|irrational]] [[denominator]]s.<ref>[http://www.themathpage.com/alg/multiply-radicals.htm Multiplying Radicals] TheMathPage.com, retrieved 22 December 2011</ref> This is a method for removing [[Nth root|surds]] from expressions (or at least moving them), applying to division by some combinations involving [[square root]]s. 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 arithmetic=== {{Main|Multiplication algorithm#Quarter square multiplication}} 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 squares=== The difference of two consecutive [[square number|perfect square]]s is the sum of the two [[base (exponentiation)|base]]s {{mvar|n}} and {{math|''n'' + 1}}. 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 {{math|4}} and the difference of two odd perfect squares is a multiple of {{math|8}}. ===Galileo's law of odd numbers=== [[File:Galileo's_law_of_odd_numbers.svg|thumb|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 {{math|3}}, {{math|5}}, {{math|7}}, 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., [https://books.google.com/books?id=xMWwTpn53KsC&pg=PA18 ''The Mechanical Universe: Introduction to Mechanics and Heat'']</ref> ===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 <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]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)