There is a habit that separates a fast algebra student from a slow one, and it has nothing to do with being "good at maths." It is pattern recognition. Three shapes appear over and over in polynomial algebra, and if you recognise them on sight you can write the answer in one line. If you do not, you will FOIL four terms every time, collect, double-check signs, and burn thirty to sixty seconds per problem.
The three shapes are the classic identities: (a+b)(a-b), (a+b)^2, and (a-b)^2. The moment you see one of them, your pen should skip the expansion and go straight to the answer.
The three identities
Memorise these. They are the three most-used algebraic identities of your school life.
- Difference of squares: (a+b)(a-b) = a^2 - b^2.
- Square of a sum: (a+b)^2 = a^2 + 2ab + b^2.
- Square of a difference: (a-b)^2 = a^2 - 2ab + b^2.
The first collapses to two terms because the cross terms cancel. The other two keep three terms because the cross terms add. (For the full story, see (a+b)(a-b) collapses but not the squared version.) These are not a list to learn and forget — they are eyes you install permanently.
Pattern-matching flow
Here is the mental checklist. Run through it every time you see two brackets multiplied.
- Look at the expression.
- Two binomials with opposite signs between the same two terms? Difference of squares — a^2 - b^2.
- A binomial squared, sign inside is +? (a+b)^2 = a^2 + 2ab + b^2.
- A binomial squared, sign inside is -? (a-b)^2 = a^2 - 2ab + b^2.
- None of these? Fall back to FOIL.
The check takes two seconds once it is automatic. For every match, you skip the expansion.
Worked examples — skip the expansion
Watch what direct pattern-matching looks like in practice.
- (x+5)(x-5): opposite signs, same two terms — difference of squares. Answer: x^2 - 25. Done.
- (2x+3)^2: square of a sum with a = 2x, b = 3. Plug in: (2x)^2 + 2(2x)(3) + 3^2 = 4x^2 + 12x + 9. Done.
- (x-7)^2: square of a difference with a = x, b = 7. Plug in: x^2 - 2(x)(7) + 7^2 = x^2 - 14x + 49. Done.
- (3x + 2y)(3x - 2y): opposite signs around a shared pair 3x, 2y — difference of squares. Answer: (3x)^2 - (2y)^2 = 9x^2 - 4y^2. Done.
No FOIL, no four-piece expansion, no collecting like terms. You look, identify the shape, plug a and b into the memorised formula, and write the answer.
When the patterns DON'T match — FOIL
Not every binomial product fits one of the three moulds. If the shape is unfamiliar, you FOIL like always.
- (x+2)(x+3): both signs positive, but the terms (2 and 3) differ, so not a square. FOIL: x^2 + 5x + 6.
- (2x-1)(3x+4): unrelated binomials, no structural match. FOIL: 6x^2 + 5x - 4.
- (x+1)(x^2+2): different degrees, no identity applies. Distribute: x^3 + x^2 + 2x + 2.
Pattern recognition is a shortcut, not a law. The discipline is knowing when to apply it.
Variations to recognise
The identities do not always arrive in textbook arrangement. Train your eye for the disguises.
- (a-b)(a+b) = a^2 - b^2: same as the difference of squares, brackets in reversed order. Multiplication is commutative.
- (-a+b)(-a-b) = (-a)^2 - b^2 = a^2 - b^2, using the identity with "a" = -a. Same pattern.
- \left(\dfrac{x}{2} + 1\right)\!\left(\dfrac{x}{2} - 1\right) = \dfrac{x^2}{4} - 1. Fractions, different coefficients — still the same pattern. The identity cares only about the structural arrangement of signs.
Extend to higher powers
The cubed identities show up less often but are worth memorising for JEE-level problems.
(Alternating signs in the second: +, -, +, -.) There is a memorisation tradeoff — cube formulas are longer and appear less often, so some students prefer to multiply out (a+b)(a+b)^2 each time. Either is fine. For the square identities there is no tradeoff; those three you must know cold.
Extend to product of three
A useful relative of (a+b)^2 is the three-variable version.
Three squared terms, plus three cross terms each with a factor of 2. Appears in coordinate geometry (distance formulas) and anywhere you square a sum of three things. The pattern: "squares on the diagonal, doubled cross terms off the diagonal."
Common confusions
Three mistakes show up in student notebooks year after year. Name them so you can dodge them.
- "(a+b)^2 = a^2 + b^2" — wrong. The famous freshman's dream drops the entire 2ab cross term. For a = 3, b = 2, true answer is 25, wrong answer is 13. See the algebra tiles widget for a picture of the missing rectangles.
- "(a+b)(a-b) has a 2ab in it" — wrong. The cross terms +ab and -ab cancel, so there is no middle term.
- "(a-b)^2 is negative" — wrong. Squaring any real gives a non-negative result. The middle term -2ab can be negative, but the total a^2 - 2ab + b^2 \geq 0 always.
Recognition drill
Cover the right side. Read each left side, identify the pattern, write the answer. Check. Repeat until it is automatic.
- (x+4)(x-4) = x^2 - 16.
- (2a-1)^2 = 4a^2 - 4a + 1.
- (3 + y)^2 = 9 + 6y + y^2.
- (2x - 3y)(2x + 3y) = 4x^2 - 9y^2.
- (p+q)^2 + (p-q)^2 = (p^2 + 2pq + q^2) + (p^2 - 2pq + q^2) = 2p^2 + 2q^2 = 2(p^2 + q^2).
The last one is a lovely little identity: the sum of the twin squares kills off the cross terms, leaving twice the sum of squares. You will meet it again in the parallelogram law.
Why this matters in factoring
The identities work in two directions. Left to right, they expand products. Right to left, they factor expressions.
- x^2 - 16: two perfect squares with a minus — difference of squares. Factor as (x-4)(x+4).
- x^2 + 10x + 25: first and last are squares (x^2, 5^2), middle is 2 \cdot x \cdot 5 — perfect square. Factor as (x+5)^2.
- x^2 - 6x + 9: squares with a minus middle — factor as (x-3)^2.
Fast factoring is the same skill running in reverse.
Why direct expansion is SO much faster
(2x+3)^2 the slow way: FOIL needs four multiplications (2x \cdot 2x, 2x \cdot 3, 3 \cdot 2x, 3 \cdot 3), then combine middle terms (6x + 6x), then write the answer. Six small operations, six places to slip.
(2x+3)^2 the fast way: recognise (a+b)^2 with a = 2x, b = 3. Write (2x)^2 + 2(2x)(3) + 3^2 = 4x^2 + 12x + 9 in one pass. Three operations, no middle-term collision.
Saving per problem: thirty to sixty seconds. Across a paper where half the questions hit one of these identities, five to ten minutes reclaimed — a whole extra question attempted. Factor-of-two speedup with fewer errors. No downside.
Closing
Pattern recognition is the single most productive habit in polynomial algebra. Memorise the three identities so deeply that you cannot look at (x+5)^2 without your pen twitching toward x^2 + 10x + 25. Scan every binomial product you meet for the three shapes. If one matches, write the answer directly. If none does, fall back to FOIL. The scan takes two seconds; the reward is faster, cleaner algebra for the rest of your school life.