Skip to main content
Mathematics LibreTexts

4.4: Factoring Differences of Squares

  • Page ID
    173474
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \(\newcommand{\longvect}{\overrightarrow}\)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\ket}[1]{\left| #1 \right>}\)
    \(\newcommand{\bra}[1]{\left< #1 \right|}\)
    \(\newcommand{\braket}[2]{\left< #1 \vphantom{#2} \right| \left. #2 \vphantom{#1} \right>}\)
    \(\newcommand{\braopket}[3]{\left< #1 \vphantom{#2}\vphantom{#3} \right| #2 \vphantom{#1}\vphantom{#3} \left| #3 \vphantom{#1}\vphantom{#2} \right>}\)
    \(\newcommand{\qmvec}[1]{\mathbf{\vec{#1}}}\)
    \(\newcommand{\op}[1]{\hat{\mathbf{#1}}}\)
    \(\newcommand{\expect}[1]{\langle #1 \rangle}\)
    \(\newcommand{\dfn}[1]{\emph{\textbf{#1}}}\)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Videos

    Lecture: Factoring a Difference of Squares

    Example: Completely Factoring the Difference of Squares

    Example: Factoring a Difference of Squares Requiring Factoring Out the GCF First

    Lecture: Using Difference of Squares to Speed Up Integer Multiplication

    Example: Advanced Example of Factoring a Difference of the Squares of Two Trinomials

    Definitions and Theorems

    The difference of squares is one of the most frequently used factoring patterns. Recognizing it lets you factor certain binomials at sight, without trial and error.

    Definition: Perfect Square

    An expression is a perfect square if it is equal to the square of another expression. A number is a perfect square if it is the square of an integer.

    For example, \(25\) is a perfect square because \(25=5^2\), and \(9x^2\) is a perfect square because \(9x^2=(3x)^2\). Likewise, \(x^4\) is a perfect square because \(x^4=(x^2)^2\).

    Definition: Difference of Squares

    A difference of squares is a binomial of the form \(a^2-b^2\), in which one perfect square is subtracted from another perfect square.

    Theorem: Difference of Squares

    For any algebraic expressions \( F \) and \( L \), \[ F^2 - L^2 = \left( F - L \right)\left( F + L \right). \nonumber \]

    Proof
    \[ \begin{array}{rclcl}
    \left( F - L \right)\left( F + L \right) & = & F^2 + FL - FL - L^2 & \quad & \left( \text{distributing} \right) \\[6pt]
    & = & F^2 - L^2 & \quad & \left( \text{simplifying} \right) \\[6pt]
    \end{array} \nonumber \]
    Recognizing the Pattern

    A binomial is a difference of squares when all three of the following hold: it has exactly two terms, both terms are perfect squares, and the terms are separated by subtraction. When you spot this pattern, take the square root of each term to identify \(a\) and \(b\), then write the product \((a-b)(a+b)\).

    Caution: A Sum of Squares Does Not Factor

    The pattern applies only to a difference. A sum of squares, \(a^2+b^2\), does not factor over the real numbers. For instance, \(x^2+9\) is prime over the reals; it is not equal to \((x+3)(x-3)\), which expands to \(x^2-9\).

    Caution: Factor Out the GCF First

    Always remove any greatest common factor before checking for a difference of squares. An expression such as \(2x^2-8\) is not itself a difference of squares, but after factoring out \(2\) it becomes \(2(x^2-4)\), which is.

    Examples

    Example \(\PageIndex{1}\): A Basic Difference of Squares

    Factor \(x^2-16\).

    Answer
    Each term is a perfect square: \(x^2=(x)^2\) and \(16=(4)^2\). Writing the binomial in the form \(a^2-b^2\) with \(a=x\) and \(b=4\),\[x^2-16=(x)^2-(4)^2=(x-4)(x+4).\nonumber\]
    Example \(\PageIndex{2}\): A Squared Coefficient

    Factor \(9x^2-25\).

    Answer
    Both terms are perfect squares: \(9x^2=(3x)^2\) and \(25=(5)^2\). With \(a=3x\) and \(b=5\),\[9x^2-25=(3x)^2-(5)^2=(3x-5)(3x+5).\nonumber\]
    Example \(\PageIndex{3}\): Two Variables

    Factor \(49x^2-4y^2\).

    Answer
    Take the square root of each term: \(49x^2=(7x)^2\) and \(4y^2=(2y)^2\). With \(a=7x\) and \(b=2y\),\[49x^2-4y^2=(7x)^2-(2y)^2=(7x-2y)(7x+2y).\nonumber\]
    Example \(\PageIndex{4}\): Removing a Common Factor First

    Factor \(3x^2-27\) completely.

    Answer
    The terms share a common factor of \(3\), which we remove first:\[3x^2-27=3(x^2-9).\nonumber\]The remaining binomial is a difference of squares, since \(x^2=(x)^2\) and \(9=(3)^2\). Factoring it gives\[3(x^2-9)=3(x-3)(x+3).\nonumber\]
    Example \(\PageIndex{5}\): Applying the Pattern Twice

    Factor \(x^4-16\) completely.

    Answer
    Since \(x^4=(x^2)^2\) and \(16=(4)^2\), the expression is a difference of squares with \(a=x^2\) and \(b=4\):\[x^4-16=(x^2)^2-(4)^2=(x^2-4)(x^2+4).\nonumber\]The first factor, \(x^2-4\), is itself a difference of squares and factors as \((x-2)(x+2)\). The second factor, \(x^2+4\), is a sum of squares and does not factor over the reals. The complete factorization is\[x^4-16=(x-2)(x+2)(x^2+4).\nonumber\]
    Example \(\PageIndex{6}\): Recognizing When the Pattern Applies

    Determine whether each binomial is a difference of squares. If it is, factor it.

    1. \(x^2-49\)
    2. \(x^2+49\)
    3. \(x^2-7\)
    Answers
    1. Both terms are perfect squares and they are separated by subtraction, so this is a difference of squares. With \(a=x\) and \(b=7\),\[x^2-49=(x-7)(x+7).\nonumber\]
    2. The terms are separated by addition, so this is a sum of squares, not a difference. It does not factor over the reals.
    3. From an introductory frame of reference, the first term is a perfect square but \(7\) is not a perfect square. Therefore, this is not a difference of two perfect squares, so it cannot be factored using this pattern.
      Now, let's step into our college shoes. As long as you know how to deal with radicals, \(x^2 - 7\) can be rewritten as \(x^2 - (\sqrt{7})^2\). As such, it can be factored using the difference of squares formula (despite not being a true difference of squares) as \((x - \sqrt{7})(x + \sqrt{7})\).

    MyOpenMath Practice


    Sources

    Several parts of this text use modifications from the following source:

    This source is released under the Creative Commons Attribution-Share-Alike License 4.0.


    This page titled 4.4: Factoring Differences of Squares was last modified on Sat, 19 Sep 2026 14:53:25 GMT and is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Roy Simpson, Cosumnes River College.

    • Was this article helpful?