What is the Square of a Binomial?
A binomial is an algebraic expression with two terms, such as a + b. "Squaring" it means multiplying the expression by itself: \((a + b)^2\). The two classic special products are $$(a + b)^2 = a^2 + 2ab + b^2$$ and $$(a - b)^2 = a^2 - 2ab + b^2.$$ This calculator expands either form numerically, showing each component so you can check your own work step by step.
How to Use the Calculator
Enter a value for the first term a, choose whether the binomial uses a plus or minus sign, and enter the second term b. The calculator returns the total expanded value along with the three building blocks: \(a^2\), the middle term \(2ab\) (positive for a sum, negative for a difference), and \(b^2\). Decimals and negative numbers are fully supported.
The Formula Explained
When you multiply \((a + b)(a + b)\) using the distributive property (FOIL), you get \(a\cdot a + a\cdot b + b\cdot a + b\cdot b = a^2 + 2ab + b^2\). The cross terms \(ab\) and \(ba\) combine into \(2ab\). For a difference, the sign of the middle term flips because \((a - b)(a - b)\) produces \(-ab - ba = -2ab\), leaving \(a^2 - 2ab + b^2\). Note the first and last terms are always positive squares.
Worked Example
Expand \((3 + 2)^2\). Here \(a = 3\) and \(b = 2\). Compute \(a^2 = 9\), the middle term \(2ab = 2 \times 3 \times 2 = 12\), and \(b^2 = 4\). Adding them gives $$9 + 12 + 4 = 25$$ — which matches \((3 + 2)^2 = 5^2 = 25\). For \((5 - 3)^2\): \(a^2 = 25\), \(-2ab = -30\), \(b^2 = 9\), so \(25 - 30 + 9 = 4 = 2^2\).
Common Perfect Squares and Binomial Expansions
The square of a binomial follows two identities: \((a+b)^2 = a^2 + 2ab + b^2\) and \((a-b)^2 = a^2 - 2ab + b^2\). The table lists both totals for small positive integer pairs. For the difference, the middle term is subtracted: \(a^2 - 2ab + b^2\).
| a | b | a² | 2ab | b² | (a+b)² | (a−b)² |
|---|---|---|---|---|---|---|
| 1 | 1 | 1 | 2 | 1 | 4 | 0 |
| 2 | 1 | 4 | 4 | 1 | 9 | 1 |
| 2 | 2 | 4 | 8 | 4 | 16 | 0 |
| 3 | 1 | 9 | 6 | 1 | 16 | 4 |
| 3 | 2 | 9 | 12 | 4 | 25 | 1 |
| 3 | 3 | 9 | 18 | 9 | 36 | 0 |
| 4 | 1 | 16 | 8 | 1 | 25 | 9 |
| 4 | 2 | 16 | 16 | 4 | 36 | 4 |
| 5 | 2 | 25 | 20 | 4 | 49 | 9 |
| 5 | 3 | 25 | 30 | 9 | 64 | 4 |
| 6 | 4 | 36 | 48 | 16 | 100 | 4 |
| 7 | 3 | 49 | 42 | 9 | 100 | 16 |
| 8 | 3 | 64 | 48 | 9 | 121 | 25 |
| 9 | 4 | 81 | 72 | 16 | 169 | 25 |
| 10 | 5 | 100 | 100 | 25 | 225 | 25 |
Related identity: the product of a sum and a difference has no middle term: \((a+b)(a-b) = a^2 - b^2\). For example, \((7+3)(7-3) = 10 \times 4 = 40 = 49 - 9\).
Cube forms (pointer): \((a+b)^3 = a^3 + 3a^2b + 3ab^2 + b^3\) and \((a-b)^3 = a^3 - 3a^2b + 3ab^2 - b^3\). These are a separate topic from squaring a binomial.
Key Terms and Definitions
- Binomial
- An algebraic expression with exactly two terms, such as \(a+b\) or \(3x-5\).
- Term
- A single part of an expression, separated from others by + or − signs. In \(3x-5\), the terms are \(3x\) and \(-5\).
- Coefficient
- The numerical factor multiplying a variable. In \(3x\), the coefficient is 3.
- Perfect square trinomial
- A three-term expression that is the square of a binomial, such as \(a^2 + 2ab + b^2 = (a+b)^2\) or \(a^2 - 2ab + b^2 = (a-b)^2\).
- Cross term (middle term)
- The term \(2ab\) (or \(-2ab\)) in the expansion. It is twice the product of the two original terms, and its sign matches the sign in the binomial.
- FOIL
- A mnemonic for multiplying two binomials: First, Outer, Inner, Last. For \((a+b)(a+b)\): \(a\cdot a + a\cdot b + b\cdot a + b\cdot b = a^2 + 2ab + b^2\).
- Distributive property
- The rule \(x(y+z) = xy + xz\). FOIL is this property applied twice, and it is why the expansion works for any real numbers.
Comparing Sum vs. Difference Across Inputs
Subtracting b is the same as adding −b, so \((a-b)^2 = (a+(-b))^2\). Only the sign of the cross term \(2ab\) changes, while \(a^2\) and \(b^2\) stay the same. Squares are never negative, but the cross term can be, if a and b have opposite signs.
| Inputs | a² | b² | 2ab | (a+b)² = a² + 2ab + b² | (a−b)² = a² − 2ab + b² |
|---|---|---|---|---|---|
| a = 4, b = 1 | 16 | 1 | 8 | 16 + 8 + 1 = 25 | 16 − 8 + 1 = 9 |
| a = 4, b = −1 | 16 | 1 | −8 | 16 − 8 + 1 = 9 | 16 + 8 + 1 = 25 |
| a = 0.5, b = 2 | 0.25 | 4 | 2 | 0.25 + 2 + 4 = 6.25 | 0.25 − 2 + 4 = 2.25 |
| a = −3, b = 2 | 9 | 4 | −12 | 9 − 12 + 4 = 1 | 9 + 12 + 4 = 25 |
Check of the second row: with \(b=-1\), \((4+(-1))^2 = 3^2 = 9\), and \((4-(-1))^2 = 5^2 = 25\). Notice that the (a+b)² result for b = −1 equals the (a−b)² result for b = 1, and vice versa.
FAQ
Does this work with negative numbers? Yes. You can enter negative values for a or b and the formula still applies correctly.
Why is the middle term sometimes negative? Because \((a - b)^2\) produces \(-2ab\). Choosing the "Minus" operation flips the sign of that middle term.
Can I use decimals? Yes, the calculator accepts any decimal value for both terms.