# Difference Of Squares

The **difference of two squares** identity is a squared number subtracted from another squared number to get factorized in the form of

\(\qquad \qquad \qquad \quad\boxed{a^2-b^2=(a+b)(a-b)}.\)

We will also prove this identity by multiplying polynomials on the left side and getting equal to the right side. This identity is often used in algebra where it is useful in applications to integer factorization, the quadratic sieve and the algebraic factorization etc.

## Identity

The difference of two squares identity is \((a+b)(a-b)=a^2-b^2\). We can prove this identity by multiplying the expressions on the left side and getting equal to the right side expression. Here is the proof of this identity.

Lets begin with the left side of the expression. We have \[ \begin{align} (a+b)(a-b) &= a(a-b) + b(a-b) \\ &= a^2 - ab + ab - b^2 \\ & = a^2 - b^2, \end{align} \] which is equal to the right side of the identity. Hence proved.

## Example Problems

This section contains examples and problems to boost understanding in the usage of the difference of squares identity: \(a^2-b^2=(a+b)(a-b)\).

Here are the examples to learn the usage of the identity.

Rewrite \(5^2-2^2\) as a product.

We have \[5^2-2^2 = (5-2) \times (5+2) = 3\times 7. \ _\square\]

## Calculate \(299\times 301\).

You can brute force the answer to this problem by using a calculator, but we have a sweeter way. We can apply the difference of two squares identity.

At first we may think about using the long multiplication method, but it wastes time and is, of course, boring. Notice that \(299=300-1\) and \(301=300+1\), so

\[\begin{align*}299\times 301&=(300-1)(300+1)\\&=300^2-1^2\\&=89999. \ _\square \end{align*}\]

Show that any odd number can be written as the difference of two squares.

Let the odd number be \( n = 2b + 1 \). Then, we have

\[ n = 2b+1 = [ (b+1) + b ] [ (b+1) - b ] = (b+1)^2 - b^2. \ _\square\]

## What is the result of \(234567^2-234557\times 234577\)?

Using the same method as the example above,

\[\begin{align*} 234567^2-234557\times 234577&=234567^2-(234567^2-10^2)\\ &=234567^2-234567^2+10^2\\ &=100.\ _\square \end{align*}\]

Solve the following problems.

## Further Extension

Also, since the two factors are different by \(2b\), the factors always have the same parity. That is, if \(a-b\) is even then \(a+b\) must also be even, and so the product is divisible by four. Or neither are divisible by 2, so the product is odd.

The product of two differences of two squares is itself a difference of two squares in two different ways:

- \[\begin{align} (a^2-b^2)(c^2-d^2) &= (ac)^2-(ad)^2-(bc)^2+(bd)^2 \\ &= (ac+bd)^2 - (ad+bc)^2 \\ &= (ac-bd)^2 - (ad-bc)^2. \end{align}\]
So if we have \( n = a^2 - b^2 = c^2-d^2 ,\) then assuming that \(n\) is odd and \(a=b+1,\) \[ n = (w^2-x^2)(y^2-z^2)\]

\[(wy+xz)^2-(wz+xy)^2 =a^2-b^2\] \[(wy-xz)^2 - (wz-xy)^2 = c^2-d^2\]So, \(wy+xz =a\) \(wz+xy =b\) \(wy-xz = c\) \(wz-xy = d\) \[ (w-x)(y-z) = a-b = 1\] so \(w-x = 1\) and \(y-z=1\)

\[ (x+1)(z+1) +xz = a = 2xz+x+z+1 \] \[ (x+1)(z) + x(z+1) =b = 2xz + x + z\] \[ (x+1)(z+1) - xz = c = x + z + 1\] \[ (x+1)z - x(z+1) = d = z- x\]

Therefore \[ \begin{array}{} n & = ( (x+1)^2-x^2 ) ( (z+1)^2 - z^2) \\ & = ( 2x+1 )( 2z+1 ) , \end{array} \] which is accurate since n is odd, it cannot have even factors.

This also tells us that \[ a^2 - c^2 = (a-c)(a+c) = (2xz)(2wy) = 4(x+1)(z+1)xz = b^2 - d^2\] \[ a^2+d^2 = b^2+c^2 = (w^2+x^2)(y^2+z^2) \] ( Because the product of two sums of two squares is the sum of two squares in two different ways ) \[ a^2+d^2 = (2x^2+2x+1)(2z^2+2z+1) \]

## Problem Solving

The examples and problems in this sections are a bit harder for enhancing the problem solving skills. Lets give them a try.

Here are the examples to go through.

Simplify \[\left(1-\frac{1}{2^2}\right)\left(1-\frac{1}{3^2}\right)\left(1-\frac{1}{4^2}\right)\cdots\left(1-\frac{1}{n^2}\right).\]

This is a very direct application of the identity mentioned in this text. We have

\[\begin{align*} & \left(1-\frac{1}{2^2}\right)\left(1-\frac{1}{3^2}\right)\cdots\left(1-\frac{1}{n^2}\right) \\ &=\left(1-\frac{1}{2}\right)\left(1+\frac{1}{2}\right)\left(1-\frac{1}{3}\right)\left(1+\frac{1}{3}\right)\cdots\left(1-\frac{1}{n}\right)\left(1+\frac{1}{n}\right)\\ &=\frac{1}{2}\cdot\frac{3}{2}\cdot\frac{2}{3}\cdot\frac{4}{3}\cdots\frac{n-1}{n}\cdot\frac{n+1}{n}. \end{align*}\]

Notice that the product from the second term to the \((n-1)^\text{th}\) term is equal to 1, and therefore the final product is \(\frac{n+1}{2n}\). \(_\square\)

Simplify \(\left(\sqrt5+\sqrt6+\sqrt7\right)\left(\sqrt5+\sqrt6-\sqrt7\right)\left(\sqrt5-\sqrt6+\sqrt7\right)\left(-\sqrt5+\sqrt6+\sqrt7\right).\)

We may choose to expand it out, but that is time intensive and very error prone. Let's have the identity tackle this problem. We have

\[\begin{align*}(\sqrt5+\sqrt6+\sqrt7)(\sqrt5+\sqrt6-\sqrt7)&=(\sqrt5+\sqrt6)^2-(\sqrt7)^2\\&=5+6+2\sqrt{30}-7\\&=4+2\sqrt{30}.\end{align*}\]

Likewise, the product of the last two terms is

\[ \begin{align} (\sqrt5-\sqrt6+\sqrt7)(-\sqrt5+\sqrt6+\sqrt7) &= \left(\sqrt7+\left(\sqrt5-\sqrt6\right)\right)\left(\sqrt7-\left(\sqrt5-\sqrt6\right)\right) \\ &=-4+2\sqrt{30}. \end{align} \]

The final product is \(\left(4+2\sqrt30\right)\left(-4+2\sqrt30\right)=4(30)-16=104.\) \(_\square\)

Try the following problems at your own.

\[ \begin{eqnarray} \large \color{blue}2^{\color{brown}x} - \color{blue}2^{\color{brown}y} & = & \large 1 \\ \\ \large \color{green}4^{\color{brown}x}- \color{green}4^{\color{brown}y} & = & \large { \frac 5 3} \\ \\ \\ \large {\color{brown}x} - {\color{brown}y} & = & \large \ \color{grey}? \end{eqnarray} \]

**Details and Assumptions**:

\(x\) and \(y\) are real numbers.

## See Also

**Cite as:**Difference Of Squares.

*Brilliant.org*. Retrieved from https://brilliant.org/wiki/applying-the-difference-of-two-squares-identity/