Algebraic Identities

Math mascot at the board with algebraic identities

Algebraic identities are ready-made mathematical equalities that allow you to expand brackets and factor expressions without long multiplication. On this page, you will find a table of all seven identities: square of a sum and difference, difference of squares, cube of a sum and difference, and the sum and difference of cubes. We break down each formula with derivations and examples, and at the end, there is an interactive tool where you can practice applying them immediately.

What are algebraic identities

Algebraic identities are equalities that are obtained by carefully multiplying polynomials once and remembering the result. After that, you no longer need to expand brackets every time: it is enough to recognize the "pattern" and substitute your numbers or letters.

In the 7th-grade algebra curriculum, these identities work in two directions:

  • left to right — to quickly expand brackets and square or cube an expression;
  • right to left — to factor a polynomial (this is necessary for simplifying fractions and solving equations).

In total, there are seven formulas to memorize. Below is a reference table, followed by a breakdown of each formula individually.

Table of algebraic identities

It is convenient to keep all seven algebraic identities in front of you in one table. The letters \(a\) and \(b\) here represent any expression: a number, a variable, or an entire monomial like \(2x\).

FormulaExpression
Square of a sum(a + b)2 = a2 + 2ab + b2
Square of a difference(a − b)2 = a2 − 2ab + b2
Difference of squaresa2 − b2 = (a − b)(a + b)
Cube of a sum(a + b)3 = a3 + 3a2b + 3ab2 + b3
Cube of a difference(a − b)3 = a3 − 3a2b + 3ab2 − b3
Sum of cubesa3 + b3 = (a + b)(a2 − ab + b2)
Difference of cubesa3 − b3 = (a − b)(a2 + ab + b2)

Square of a sum and square of a difference

The square of a sum is obtained by multiplying \((a+b)\) by itself:

\[(a+b)^2 = (a+b)(a+b) = a^2 + ab + ab + b^2 = a^2 + 2ab + b^2.\]

In words: the square of a sum equals the square of the first expression plus twice the product of the first and second plus the square of the second. The square of a difference is derived in exactly the same way — the sign of the middle term becomes a minus:

\[(a-b)^2 = a^2 - 2ab + b^2.\]

The main thing is not to lose the middle term \(2ab\): it is precisely because of it that \((a+b)^2 \neq a^2 + b^2\). The square of a sum and the square of a difference differ only in the sign before \(2ab\), while the outer terms \(a^2\) and \(b^2\) are always positive.

Example. \((x+3)^2 = x^2 + 2\cdot x\cdot 3 + 3^2 = x^2 + 6x + 9.\)

The square of a sum has a clear geometric meaning: it is the area of a large square with side \((a+b)\).

(a + b)² = a² + 2ab + b² — the area of a square with side (a + b) is composed of two squares (a² and b²) and two identical rectangles ab.

Difference of squares

If you multiply the sum and the difference of the same expressions, the middle terms cancel each other out:

\[(a-b)(a+b) = a^2 + ab - ab - b^2 = a^2 - b^2.\]

This results in the difference of squares formula: \(a^2 - b^2 = (a-b)(a+b)\). This is the most useful identity for factoring: as soon as you see the difference of two squares, factor it into a product immediately.

Example (expanding brackets). \((x-7)(x+7) = x^2 - 49.\)

Example (factoring). \(x^2 - 16 = x^2 - 4^2 = (x-4)(x+4).\)

Important: the sum of squares \(a^2 + b^2\) cannot be factored using this formula — only the difference works.

Cube of a sum, cube of a difference, sum and difference of cubes

The cube of a sum and the cube of a difference already contain four terms:

\[(a+b)^3 = a^3 + 3a^2b + 3ab^2 + b^3, \qquad (a-b)^3 = a^3 - 3a^2b + 3ab^2 - b^3.\]

In the cube of a difference, the signs alternate: \(+\,-\,+\,-\). And again, a common trap: \((a+b)^3 \neq a^3 + b^3\) — you cannot simply "distribute" the exponent; the middle terms \(3a^2b\) and \(3ab^2\) must not be lost.

Example. \((x+2)^3 = x^3 + 3x^2\cdot 2 + 3x\cdot 2^2 + 2^3 = x^3 + 6x^2 + 12x + 8.\)

The sum and difference of cubes stand apart — they, conversely, factor an expression into a product:

\[a^3 + b^3 = (a+b)(a^2 - ab + b^2), \qquad a^3 - b^3 = (a-b)(a^2 + ab + b^2).\]

The second factor is called an incomplete square of a sum or difference. The sign in its middle term is always opposite to the sign in the first bracket: for the sum of cubes, it is \(-ab\); for the difference of cubes, it is \(+ab\).

Example. \(x^3 - 8 = x^3 - 2^3 = (x-2)(x^2 + 2x + 4).\)

Examples of applying algebraic identities

Example 1. Expand the brackets: square of a sum

Task. Square \((2x+5)^2\).

Step 1. Identify the square of a sum formula: \((a+b)^2 = a^2 + 2ab + b^2\), where \(a = 2x\), \(b = 5\).

Step 2. Calculate each term:

  • \(a^2 = (2x)^2 = 4x^2\);
  • \(2ab = 2\cdot 2x\cdot 5 = 20x\);
  • \(b^2 = 5^2 = 25\).

Answer. \((2x+5)^2 = 4x^2 + 20x + 25.\)

Example 2. Simplify into the difference of squares formula

Task. Find the product \((3x-4)(3x+4)\).

Step 1. We have the product of the difference and the sum of the same expressions — this is the difference of squares \((a-b)(a+b) = a^2 - b^2\), where \(a = 3x\), \(b = 4\).

Step 2. Square each expression: \(a^2 = (3x)^2 = 9x^2\), \(b^2 = 4^2 = 16\).

Answer. \((3x-4)(3x+4) = 9x^2 - 16.\)

Example 3. Factor

Task. Factor \(x^2 - 36\) and \(x^3 + 27\).

Difference of squares. \(x^2 - 36 = x^2 - 6^2 = (x-6)(x+6).\)

Sum of cubes. Note that \(27 = 3^3\), so \(x^3 + 27 = x^3 + 3^3\). Apply the formula \(a^3 + b^3 = (a+b)(a^2 - ab + b^2)\) with \(a = x\), \(b = 3\):

\[x^3 + 27 = (x+3)(x^2 - 3x + 9).\]

Pay attention to the \(-3x\) sign in the incomplete square — for the sum of cubes, the middle term has a minus sign.

Example 4. Cube of a sum

Task. Expand the brackets \((x+2)^3\).

Step 1. Cube of a sum formula: \((a+b)^3 = a^3 + 3a^2b + 3ab^2 + b^3\), where \(a = x\), \(b = 2\).

Step 2. Calculate the terms in order:

  • \(a^3 = x^3\);
  • \(3a^2b = 3\cdot x^2\cdot 2 = 6x^2\);
  • \(3ab^2 = 3\cdot x\cdot 2^2 = 12x\);
  • \(b^3 = 2^3 = 8\).

Answer. \((x+2)^3 = x^3 + 6x^2 + 12x + 8.\)

Common mistakes when working with algebraic identities

  • Forgetting the twice the product term: writing $(a+b)^2 = a^2 + b^2$.

    In the square of a sum and difference, there is always a middle term \(2ab\): \((a+b)^2 = a^2 + 2ab + b^2\). It is easy to check — expand \((a+b)(a+b)\) manually, and the middle term will appear on its own.

  • Confusing signs in the square of a difference and the difference of squares.

    In the square of a difference, the minus is only on the middle term: \((a-b)^2 = a^2 - 2ab + b^2\) (the outer terms are positive). In the difference of squares, the minus is between the squares themselves: \(a^2 - b^2 = (a-b)(a+b)\). These are different formulas.

  • Distributing the exponent for a cube: $(a+b)^3 = a^3 + b^3$.

    You cannot do this. The cube of a sum contains four terms: \((a+b)^3 = a^3 + 3a^2b + 3ab^2 + b^3\). The formula \(a^3 + b^3 = (a+b)(a^2 - ab + b^2)\) is something else entirely (sum of cubes); it is for factoring.

  • Putting twice the product $2ab$ in the incomplete square of a sum/difference of cubes.

    An incomplete square is \(a^2 \pm ab + b^2\), without the two before \(ab\). The sign is opposite to the sign of the first bracket: sum of cubes \((a+b)(a^2 - ab + b^2)\), difference of cubes \((a-b)(a^2 + ab + b^2)\).

  • Trying to factor the sum of squares $a^2 + b^2$.

    Only the difference of squares \(a^2 - b^2 = (a-b)(a+b)\) can be factored. The sum of squares \(a^2 + b^2\) cannot be factored in the school curriculum.

Questions and answers

How many algebraic identities are there in total?

Seven: square of a sum, square of a difference, difference of squares, cube of a sum, cube of a difference, sum of cubes, and difference of cubes. They are all collected in the table above.

What is the square of a sum equal to?

The square of the first expression plus twice the product of the first and second plus the square of the second: \((a+b)^2 = a^2 + 2ab + b^2\). For the square of a difference, the middle term has a minus sign: \((a-b)^2 = a^2 - 2ab + b^2\).

How do you factor the difference of squares?

Using the formula \(a^2 - b^2 = (a-b)(a+b)\). For example, \(x^2 - 25 = x^2 - 5^2 = (x-5)(x+5)\). It is enough to see that both terms are perfect squares and there is a minus between them.

Why is $(a+b)^2$ not equal to $a^2 + b^2$?

Because when multiplying \((a+b)(a+b)\), two more identical terms \(ab\) appear, which give the middle term \(2ab\). It cannot be lost: correctly, \((a+b)^2 = a^2 + 2ab + b^2\).

How does the cube of a sum differ from the sum of cubes?

The cube of a sum \((a+b)^3 = a^3 + 3a^2b + 3ab^2 + b^3\) is for expanding brackets. The sum of cubes \(a^3 + b^3 = (a+b)(a^2 - ab + b^2)\) is, conversely, for factoring an expression. These are different formulas, do not confuse them.

In which grade are algebraic identities taught?

Usually in the 7th grade during algebra lessons: first the square of a sum and difference, difference of squares, then the formulas for cubes. They are actively used later for simplifying expressions, reducing fractions, and solving equations.

Still have questions? Continue in the chat

Other Subject Materials

4.92 18,437 ratings
User #4365351

I really liked the text-on-photo editor — the result turned out to be an absolute masterpiece.

Web · May 2026
User #4383661

Thank you, the work of the neural network really impressed me. Perfect!

Web · May 2026
User #4279467

I really like it — would be great to have a few more free tries.

Google Play · May 2026
User #4160129

A wonderful app with affordable prices.

Web · May 2026
Text copied
Done
Error