Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

a² − b²
40
= (a + b)(a − b)
49
9
a + b 10
a − b 4

What Is the Difference of Two Squares?

The difference of two squares is one of the most important algebraic identities. For any two numbers a and b, the expression \(a^2 - b^2\) can always be factored into the product \((a + b)(a - b)\). This calculator evaluates both the numeric result and shows the factored form, making it useful for checking homework, factoring polynomials, and mental-math shortcuts.

Large square of side a with a smaller square of side b removed from a corner
The difference of two squares is the area left when a small b×b square is removed from a large a×a square.

How to Use the Calculator

Enter your first value a and your second value b. The tool computes \(a^2\), \(b^2\), their difference, and the two factors \((a + b)\) and \((a - b)\). Values can be whole numbers, decimals, or negatives.

The Formula Explained

The identity comes from expanding the product:

$$(a + b)(a - b) = a^2 - ab + ab - b^2 = a^2 - b^2$$

The two middle terms cancel, leaving only \(a^2 - b^2\). Because this works for every pair of numbers, it gives a quick way to factor any expression of the form \((\text{something})^2 - (\text{something else})^2\).

L-shaped region rearranged into a rectangle with sides a plus b and a minus b
Rearranging the L-shaped area forms a rectangle of dimensions (a + b) by (a − b), proving \(a^2 - b^2 = (a + b)(a - b)\).

Worked Example

Let \(a = 7\) and \(b = 3\). Then \(a^2 = 49\) and \(b^2 = 9\), so \(a^2 - b^2 = 40\). Using the factored form:

$$(7 + 3)(7 - 3) = 10 \times 4 = 40$$

Both methods agree, confirming the identity.

FAQ

Does it work with decimals and negatives? Yes. The identity holds for all real numbers, so \(5.5^2 - 2.5^2\) or \((-4)^2 - 2^2\) are handled correctly.

What if a equals b? Then \(a^2 - b^2 = 0\), because one of the factors \((a - b)\) becomes 0.

Why is this useful? It speeds up multiplication (e.g. \(53 \times 47 = 50^2 - 3^2 = 2500 - 9 = 2491\)) and is essential for factoring quadratic expressions.

Last updated: