Algebra
Difference of Two Squares Calculator
a² − b² always factors as (a+b)(a−b), since expanding that product cancels the cross terms.
Algebra
a² − b² always factors as (a+b)(a−b), since expanding that product cancels the cross terms.
The a²−b² = (a+b)(a−b) identity is one of the most useful factoring patterns in algebra, this calculator both factors it directly and works backward to find every way a given number can be expressed as a difference of two squares.
a² − b² always factors as (a+b)(a−b), since expanding that product cancels the cross terms. In Express mode, this calculator finds every pair of integers a and b whose squares differ by exactly your target number N.
Not every integer can be written as a difference of two squares, a number that’s exactly 2 more than a multiple of 4 (like N=6) cannot be expressed this way at all, because of how the factors (a+b) and (a−b) must both share the same parity (both even or both odd) for a and b to be integers. This calculator flags such cases as “impossible” rather than returning an incorrect result.
Expanding (a+b)(a−b) gives a² − ab + ab − b², the middle cross terms cancel out exactly, leaving a² − b², this is a standard algebraic identity, not a coincidence specific to certain numbers.
Numbers of the form 4k+2 (like 6, 10, 14) cannot be expressed as a difference of two squares, because the two factors (a+b) and (a−b) must share the same parity for a and b to both be integers, which rules out this specific class of numbers.