Algebraic Expressions and Identities

Every algebra problem you have solved since Class 6 has been built from two moves: naming an unknown with a letter, and combining letters and numbers with addition, subtraction and multiplication. This chapter turns those familiar moves into a toolkit precise enough to survive an exam and powerful enough to make three-digit multiplication a mental trick. It has two halves. The first half is arithmetic of expressions — how to add, subtract and multiply expressions like 7x2−4x+57x^2 - 4x + 5, 3pq3pq, or (a+b)(a + b), term by term, using nothing but the distributive law you already trust for ordinary numbers. The second half is a set of four standard identities — equalities that hold for every value of the letters involved, not just some — which let you expand (a+b)2(a+b)^2, (a−b)2(a-b)^2, (a+b)(a−b)(a+b)(a-b) and (x+a)(x+b)(x+a)(x+b) on sight, without multiplying term by term each time. The chapter matters for two reasons. First, every later topic in algebra — factorisation, solving equations, coordinate geometry, even calculus much later — assumes you can expand and simplify expressions fluently and without sign errors; this chapter is where that fluency is built. Second, the identities are not just shortcuts for homework: they let you compute 105×95105 \times 95 or 97297^2 in your head faster than a calculator, because 105×95=(100+5)(100−5)=1002−52=9975105 \times 95 = (100+5)(100-5) = 100^2 - 5^2 = 9975 needs no long multiplication at all. We will ground every rule in the same idea NCERT starts with — area. A rectangle's area is length times breadth, so multiplying two expressions is exactly what happens when you stretch or shrink the sides of a rectangle, and this geometric picture is what makes the identities memorable rather than mysterious. By the end, you will be able to add and subtract any polynomial by matching like terms, multiply any monomial, binomial or trinomial by another using the distributive law, state and prove all four standard identities, and use them to simplify expressions and to multiply awkward-looking numbers quickly and correctly.

Key takeaways
  • An algebraic expression is built from variables and constants joined by ++, −-, ×\times, ÷\div; it is made of terms, and terms are products of factors.
  • Expressions are classified by their number of terms: monomial (1 term), binomial (2 terms), trinomial (3 terms); a polynomial is any expression with one or more terms with non-zero coefficients and non-negative integer powers.
  • Only like terms — same variables raised to the same powers — can be combined by addition or subtraction; unlike terms are simply carried forward unchanged.
  • Multiplying algebraic expressions always uses the distributive law: a(b+c)=ab+aca(b+c) = ab + ac, extended term by term for longer expressions.
  • A monomial times a monomial is always a monomial; multiplying pp terms by qq terms gives at most pqpq terms before combining like terms.
  • Identity I: (a+b)2=a2+2ab+b2(a+b)^2 = a^2 + 2ab + b^2, and Identity II: (a−b)2=a2−2ab+b2(a-b)^2 = a^2 - 2ab + b^2 — the square of a binomial always has a middle term.
  • Identity III: (a+b)(a−b)=a2−b2(a+b)(a-b) = a^2 - b^2, the difference of squares — the single most useful shortcut for mental multiplication.
  • Identity IV: (x+a)(x+b)=x2+(a+b)x+ab(x+a)(x+b) = x^2 + (a+b)x + ab, which generalises Identity I and II and underlies factorisation in the next chapter.
  • Key idea: every product of algebraic expressions expands term by term through the distributive law, and the four standard identities — (a+b)², (a-b)², (a+b)(a-b) and (x+a)(x+b) — package the most common expansions into instant, provably correct shortcuts.
The core insight

Algebraic expressions are added and subtracted by combining like terms, multiplied term by term using the distributive law, and the four standard identities — (a+b)2(a+b)^2, (a−b)2(a-b)^2, (a+b)(a−b)(a+b)(a-b), (x+a)(x+b)(x+a)(x+b) — are simply the most frequently needed products, pre-expanded so they can be applied instantly and used for fast, exact mental arithmetic.

What this chapter covers

The chapter builds in a straight line, and each stage leans on the one before it. It opens with the vocabulary of expressions — terms, factors, coefficients, monomials, binomials, trinomials and polynomials — so that "like terms" has a precise meaning. It then covers addition and subtraction, which is nothing more than collecting like terms carefully, row by row. The bulk of the chapter is multiplication, taken in careful stages: monomial times monomial, monomial times polynomial, and finally polynomial times polynomial, each stage using the distributive law you already know from ordinary arithmetic (like 7×106=7×100+7×67 \times 106 = 7\times100 + 7\times6). The chapter closes with the four standard identities, proved once and then applied to simplify expressions and to multiply numbers like 105×95105 \times 95 or 997×1003997 \times 1003 mentally. Worked examples below reuse NCERT's own numbering where the source text is quoted directly.

The core ideas

Expressions, terms and factors

An algebraic expression is formed by combining variables (letters standing for unknown numbers) and constants using the operations of addition, subtraction and multiplication (and, occasionally, division). Examples from the chapter include x+3x+3, 2y−52y-5, 3x23x^2 and 4xy+74xy+7. An expression is built from terms, separated by ++ or −- signs — so 7xy+5yz−3zx7xy + 5yz - 3zx has three terms: 7xy7xy, 5yz5yz and −3zx-3zx. Each term is itself a product of factors: the term 7xy7xy has factors 77, xx and yy, and the number 77 is called the coefficient of xyxy in that term. Two terms are like terms if they have exactly the same variables raised to exactly the same powers; their coefficients may differ. So 3p2q3p^2q and −7p2q-7p^2q are like terms, but 3p2q3p^2q and 3pq23pq^2 are not, because the powers of pp and qq are swapped. This single distinction — like versus unlike — governs every addition, subtraction and simplification in the chapter.

Monomials, binomials and polynomials

monomial (1 term)binomial (2 terms)trinomial (3 terms)polynomial (1 or more terms).\text{monomial (1 term)} \quad \text{binomial (2 terms)} \quad \text{trinomial (3 terms)} \quad \text{polynomial (1 or more terms)}.

where: a polynomial, in general, is any expression containing one or more terms with non-zero coefficients, where every variable appears with a non-negative integer exponent. So 4xy4xy, −15xy-15xy and 3x23x^2 are monomials; 2y−52y-5 and a+7a+7 are binomials; 4p2+5p+74p^2 + 5p + 7 is a trinomial; and all of these are also polynomials, since "polynomial" is the umbrella term. An expression like x+3\sqrt{x} + 3 is not a polynomial, because the exponent of xx is not a non-negative integer.

Adding and subtracting algebraic expressions

To add expressions, write them with like terms aligned and add the coefficients of each group of like terms; unlike terms carry over unchanged, because there is nothing to combine them with. To subtract one expression from another, add the additive inverse of every term in the expression being subtracted — in effect, flip every sign in the second expression and then add.

(7x2−4x+5)+(9x−10)=7x2+(−4+9)x+(5−10)=7x2+5x−5.(7x^2 - 4x + 5) + (9x - 10) = 7x^2 + (-4+9)x + (5-10) = 7x^2 + 5x - 5.

where: the coefficients of the like terms −4x-4x and 9x9x are added to give 5x5x, and the constants 55 and −10-10 are added to give −5-5; this is exactly NCERT's opening example. For subtraction, subtracting 5x2−4y2+6y−35x^2 - 4y^2 + 6y - 3 from 7x2−4xy+8y2+5x−3y7x^2 - 4xy + 8y^2 + 5x - 3y means adding −5x2+4y2−6y+3-5x^2 + 4y^2 - 6y + 3 to the first expression, giving 2x2−4xy+12y2+5x−9y+32x^2 - 4xy + 12y^2 + 5x - 9y + 3 — every sign in the subtrahend is reversed before the terms are combined.

Multiplying algebraic expressions as areas

Multiplication of algebraic expressions arises naturally from area: the area of a rectangle of length ll and breadth bb is l×bl \times b, so if the length is increased to (l+5)(l+5) and the breadth decreased to (b−3)(b-3), the new area is the product (l+5)(b−3)(l+5)(b-3). The simplest case is a monomial times a monomial: multiply the coefficients together, and multiply the variable parts together using the laws of exponents (add the powers of matching variables).

(5x)×(4x2)=(5×4)×(x×x2)=20x3,(5x)×(−4xyz)=−20x2yz.(5x)\times(4x^2) = (5\times4)\times(x\times x^2) = 20x^3, \qquad (5x)\times(-4xyz) = -20x^2yz.

where: the coefficient of the product is the product of the two coefficients, and the algebraic (variable) part of the product is the product of the two algebraic parts, with exponents of matching variables added — exactly as NCERT's boxed rule states. The same idea extends to three or more monomials, multiplying two at a time: 2x×5y×7z=(2x×5y)×7z=10xy×7z=70xyz2x \times 5y \times 7z = (2x\times5y)\times7z = 10xy\times7z = 70xyz.

Figure
A grid of dots arranged in rows and columns illustrating that the total count equals rows times columns, shown first as a small m by n grid and then as an enlarged m plus 2 by n plus 3 grid to motivate multiplying algebraic expressions as areas
Multiplying expressions is counting area — rows times columns m rows by n columns 3 rows (m) x 6 columns (n) area = m x n grow by 2 rows, 3 cols (m+2) rows by (n+3) columns 5 rows (m+2) x 9 columns (n+3) area = (m+2)(n+3) Every product of two expressions can be read as an area with those side lengths. This is exactly why (l+5) x (b-3), price x quantity, and speed x time all expand the same way.

Multiplying a monomial by a polynomial, and a polynomial by a polynomial

When a monomial multiplies a binomial or trinomial, the distributive law is applied once for every term of the polynomial:

3x×(5y+2)=(3x×5y)+(3x×2)=15xy+6x,3p×(4p2+5p+7)=12p3+15p2+21p.3x\times(5y+2) = (3x\times5y)+(3x\times2) = 15xy+6x, \qquad 3p\times(4p^2+5p+7) = 12p^3+15p^2+21p.

where: each term of the polynomial in the bracket is multiplied by the monomial outside, and the resulting terms are added. When two polynomials multiply — a binomial by a binomial, or a binomial by a trinomial — every term of the first must multiply every term of the second, after which like terms are combined:

(3a+4b)(2a+3b)=6a2+9ab+8ab+12b2=6a2+17ab+12b2.(3a+4b)(2a+3b) = 6a^2 + 9ab + 8ab + 12b^2 = 6a^2 + 17ab + 12b^2.

where: term-by-term multiplication of a binomial by a binomial produces 2×2=42\times2=4 terms before combining; here 9ab9ab and 8ab8ab are like terms and merge into 17ab17ab, leaving 33 terms in the final answer. A binomial times a trinomial produces up to 2×3=62\times3=6 terms before combining, and it is normal — even expected — for some of those terms to collapse into fewer once like terms are added.

Standard identities

An identity is an equality between two expressions that holds for every value of the variables involved, unlike an equation such as 2x+1=52x+1=5, which is true only for the single value x=2x=2. The four standard identities of this chapter are the most useful binomial products, expanded once and for all:

I. (a+b)2=a2+2ab+b2II. (a−b)2=a2−2ab+b2\text{I. } (a+b)^2 = a^2+2ab+b^2 \qquad \text{II. } (a-b)^2 = a^2-2ab+b^2
III. (a+b)(a−b)=a2−b2IV. (x+a)(x+b)=x2+(a+b)x+ab\text{III. } (a+b)(a-b) = a^2-b^2 \qquad \text{IV. } (x+a)(x+b) = x^2+(a+b)x+ab

where: in Identities I and II, aa and bb are the two terms being squared, and the middle term 2ab2ab (with its sign) is the part students most often forget. In Identity III, the product of a sum and a difference of the same two terms collapses to a difference of two squares, with no middle term at all. In Identity IV, xx is the term common to both binomials, while aa and bb are the terms that differ; setting a=ba=b recovers Identity I, and setting b=−ab=-a recovers Identity III, so Identity IV is the most general of the four.

Figure
A large square of side a plus b split into four regions to prove the square of a sum identity, showing a square of side a in one corner, a square of side b in the opposite corner, and two equal rectangles of sides a and b filling the remaining space
Geometric proof of (a+b) squared = a squared + 2ab + b squared a squared ab ab b squared a b side length = a + b Total area = a squared + ab + ab + b squared = a squared + 2ab + b squared The whole square has side (a+b), so its area is (a+b) squared — both readings must agree.

Adding and subtracting expressions carefully

Derivation AAdding three expressions by collecting like terms

The goal here is to show, with full working, exactly how NCERT's own three-expression addition is carried out so that no like term is missed and no unlike term is wrongly merged — the single most common source of careless error in this chapter is combining terms that only look similar, such as treating xzxz and zxzx as different when they are identical, or accidentally adding x2x^2 to xx. Add the three expressions 7xy+5yz−3zx7xy+5yz-3zx, 4yz+9zx−4y4yz+9zx-4y and −3xz+5x−2xy-3xz+5x-2xy.

Step 1. List every term that appears across all three expressions and identify the like-term groups. Scanning the three expressions gives terms in xyxy (namely 7xy7xy and −2xy-2xy), terms in yzyz (namely 5yz5yz and 4yz4yz), terms in zxzx (namely −3zx-3zx, 9zx9zx and −3xz-3xz, all the same since xz=zxxz=zx), a term in xx (namely 5x5x) and a term in yy (namely −4y-4y).

Step 2. Combine the xyxy terms: 7xy+(−2xy)=5xy7xy + (-2xy) = 5xy. Combine the yzyz terms: 5yz+4yz=9yz5yz + 4yz = 9yz. Combine the zxzx terms, remembering −3xz-3xz is the same as −3zx-3zx: −3zx+9zx+(−3zx)=3zx-3zx + 9zx + (-3zx) = 3zx.

Step 3. Carry forward every term that has no partner unchanged: 5x5x appears only in the third expression and −4y-4y appears only in the second, so both pass straight into the answer with their original sign.

Step 4. Assemble the sum from the combined and carried-forward terms: 5xy+9yz+3zx+5x−4y5xy + 9yz + 3zx + 5x - 4y. This matches NCERT's own worked Example 1 exactly, and the method — group by matching variable-and-power pattern, add coefficients, carry over anything unmatched — works for any number of expressions, not just three.

Go deeper · Derivation B · 1 minThe square of a sum identity, proved algebraically and geometrically
Derivation BThe square of a sum identity, proved algebraically and geometrically

The goal is to establish Identity I, (a+b)2=a2+2ab+b2(a+b)^2 = a^2+2ab+b^2, in two independent ways — first by pure distributive-law algebra, so the result is provably correct for every number aa and bb, and then by an area argument, so the same result can be seen rather than only calculated. Having two independent proofs is exactly how you should treat a claim that must hold for every possible value of the letters, not just a few checked cases.

Step 1. Write (a+b)2(a+b)^2 as (a+b)×(a+b)(a+b)\times(a+b) and apply the distributive law once, treating the first bracket as a single quantity multiplying the second: (a+b)(a+b)=a×(a+b)+b×(a+b)(a+b)(a+b) = a\times(a+b) + b\times(a+b).

Step 2. Expand each of the two products from Step 1 using the distributive law again: a×(a+b)=a2+aba\times(a+b) = a^2+ab and b×(a+b)=ab+b2b\times(a+b) = ab+b^2.

Step 3. Add the two results from Step 2: (a+b)2=a2+ab+ab+b2(a+b)^2 = a^2+ab+ab+b^2. The two middle terms abab and abab are like terms, so they combine into 2ab2ab, giving (a+b)2=a2+2ab+b2(a+b)^2 = a^2+2ab+b^2, which is Identity I.

Step 4. Confirm the same result geometrically using the split square in the figure above. A square of side (a+b)(a+b) has area (a+b)2(a+b)^2 by the definition of area as side squared. But the same square, cut along lines a distance aa from two adjacent sides, splits into a square of side aa (area a2a^2), a square of side bb (area b2b^2), and two rectangles of sides aa and bb (area abab each). Adding the four pieces gives a2+ab+ab+b2=a2+2ab+b2a^2+ab+ab+b^2 = a^2+2ab+b^2, matching Step 3 exactly and confirming that the algebraic middle term 2ab2ab genuinely corresponds to real area, not a symbolic accident.

Step 5. Check with numbers, as a final sanity test: for a=7a=7, b=3b=3, the left side is (7+3)2=102=100(7+3)^2 = 10^2 = 100, and the right side is 72+2(7)(3)+32=49+42+9=1007^2+2(7)(3)+3^2 = 49+42+9 = 100. Both sides agree, and the same check works for any aa and bb, which is exactly what "identity" means.

Worked examples

Board level - Simplify and evaluate an algebraic expression

Simplify 3y(2y−7)−3(y−4)−633y(2y-7) - 3(y-4) - 63 and then find its value for y=−2y=-2 (this reuses NCERT's own Example 5, part (ii)).

Step 1. Expand the first product using the distributive law: 3y(2y−7)=6y2−21y3y(2y-7) = 6y^2 - 21y.

Step 2. Expand the second product, keeping track of the sign in front of it: −3(y−4)=−3y+12-3(y-4) = -3y+12.

Step 3. Combine everything, including the standalone −63-63, and collect like terms: 6y2−21y−3y+12−63=6y2−24y−516y^2 - 21y - 3y + 12 - 63 = 6y^2 - 24y - 51.

Step 4. Substitute y=−2y=-2 into the simplified expression: 6(−2)2−24(−2)−51=6(4)+48−51=24+48−516(-2)^2 - 24(-2) - 51 = 6(4) + 48 - 51 = 24+48-51.

Step 5. Finish the arithmetic: 24+48−51=72−5124+48-51 = 72-51, so the value is 21\mathbf{21}.

Board level - Multiply numbers instantly with the standard identities

Use the standard identities to evaluate (i) 105×95105 \times 95 and (ii) 97297^2 without long multiplication.

Step 1. For part (i), write 105105 and 9595 as (100+5)(100+5) and (100−5)(100-5), a sum and a difference of the same two numbers, which is exactly the pattern of Identity III.

Step 2. Apply Identity III, (a+b)(a−b)=a2−b2(a+b)(a-b)=a^2-b^2, with a=100a=100 and b=5b=5: 105×95=1002−52=10000−25105\times95 = 100^2 - 5^2 = 10000-25, so the product is 9975\mathbf{9975}.

Step 3. For part (ii), write 9797 as (100−3)(100-3), so 972=(100−3)297^2 = (100-3)^2 matches the pattern of Identity II.

Step 4. Apply Identity II, (a−b)2=a2−2ab+b2(a-b)^2=a^2-2ab+b^2, with a=100a=100 and b=3b=3: 972=1002−2(100)(3)+32=10000−600+997^2 = 100^2 - 2(100)(3) + 3^2 = 10000-600+9, so 972=940997^2 = \mathbf{9409}.

Higher-order thinking (HOTS / olympiad-style) - Extending the identity to three terms

Given a+b+c=9a+b+c=9 and ab+bc+ca=26ab+bc+ca=26, find the value of a2+b2+c2a^2+b^2+c^2 without finding aa, bb and cc individually.

Step 1. Recognise that squaring the sum a+b+ca+b+c will produce every one of a2a^2, b2b^2, c2c^2 and every cross term, which is exactly what the question needs; treat (a+b)(a+b) as a single block and apply Identity I to ((a+b)+c)2\big((a+b)+c\big)^2.

Step 2. Expand: (a+b+c)2=(a+b)2+2(a+b)c+c2=a2+2ab+b2+2ac+2bc+c2=a2+b2+c2+2(ab+bc+ca)(a+b+c)^2 = (a+b)^2 + 2(a+b)c + c^2 = a^2+2ab+b^2+2ac+2bc+c^2 = a^2+b^2+c^2+2(ab+bc+ca). This is the natural three-term extension of Identity I, built from Identity I applied twice.

Step 3. Substitute the given values: (9)2=a2+b2+c2+2(26)(9)^2 = a^2+b^2+c^2 + 2(26), so 81=a2+b2+c2+5281 = a^2+b^2+c^2+52.

Step 4. Solve for the required quantity: a2+b2+c2=81−52=29a^2+b^2+c^2 = 81-52 = \mathbf{29}. Timing note: this should take about two to three minutes in an exam. The trick is spotting that squaring the given sum is the fast route to a sum of squares — trying to solve for aa, bb, cc individually from just two equations is a dead end, since there are infinitely many solutions but only one value of a2+b2+c2a^2+b^2+c^2.

Common traps

Sign errors dominate this chapter. When subtracting one expression from another, every single term of the expression being subtracted must have its sign flipped before adding — students frequently flip only the first term and leave the rest unchanged. When multiplying a binomial by a binomial, every term of the first bracket must multiply every term of the second, giving four products before combining; a common shortcut error multiplies only the first terms and the last terms, skipping the two cross products entirely (this is sometimes called "smiley-face" or FOIL multiplication done incorrectly by omitting the O and I products). Students also routinely confuse (a+b)2(a+b)^2 with a2+b2a^2+b^2, silently dropping the middle term 2ab2ab — this single error is common enough to be flagged separately below. A related trap is applying Identity III, (a+b)(a−b)=a2−b2(a+b)(a-b)=a^2-b^2, to expressions that are not actually a sum and difference of the same two terms — for instance, (2x+3)(2x−5)(2x+3)(2x-5) is not of that form (the second terms differ, 3≠53 \ne 5) and must be expanded using Identity IV or the full distributive law instead. Finally, treating xyxy and x+yx+y as interchangeable, or forgetting that xzxz and zxzx are the same term (multiplication is commutative but the two spellings must still be recognised as like terms), causes otherwise-correct working to arrive at the wrong count of terms.

You should be able to…

  • Identify the terms, factors and coefficients of any algebraic expression, and classify it as a monomial, binomial, trinomial or general polynomial.
  • Decide whether two given terms are like terms or unlike terms by comparing their variables and powers, not just their appearance.
  • Add and subtract two or more algebraic expressions by collecting like terms and carrying unlike terms forward unchanged.
  • Subtract one expression from another correctly by flipping the sign of every term in the expression being subtracted before adding.
  • Multiply a monomial by a monomial, collecting coefficients and adding exponents of matching variables.
  • Multiply a monomial by a binomial or trinomial, and a binomial by a binomial or trinomial, using the distributive law term by term, then combining any like terms that result.
  • State all four standard identities from memory and reproduce at least one full proof, algebraic or geometric, for the square-of-a-sum identity.
  • Recognise when an expression matches the pattern of a standard identity and apply the identity directly instead of expanding from scratch.
  • Use the identities to compute products of large or awkward numbers mentally, such as 105×95105\times95 or 97297^2.
  • Simplify an algebraic expression fully and then substitute a given numerical value to evaluate it, without arithmetic slips.

Ask the tutor: Want to work through why (a+b+c)2(a+b+c)^2 expands to five terms including 2ab+2bc+2ca2ab+2bc+2ca, or practice spotting which identity fits a tricky-looking product?

Why do we even need identities if I can already multiply expressions term by term?

Term-by-term multiplication always works and is never wrong, but it is slow and error-prone for the four specific patterns covered by the identities, especially under exam time pressure. Once you recognise that an expression matches the shape (a+b)2(a+b)^2, (a−b)2(a-b)^2, (a+b)(a−b)(a+b)(a-b) or (x+a)(x+b)(x+a)(x+b), applying the memorised identity is faster and less likely to drop a sign than expanding from scratch every time. Identities are not a different kind of mathematics from the distributive law — they are the distributive law's most common results, pre-computed once so you never have to redo that specific piece of algebra by hand again. You should still be able to derive each identity from the distributive law if asked, since that is exactly what proves it is always true.

Is a single number like 7, with no variable at all, considered a monomial?

Yes. A monomial is an expression with exactly one term, and a constant term like 77 counts as one term just as much as 3x3x does — its "variable part" is simply absent, which is perfectly allowed. The number 00 is a slightly special case: by convention it is usually not assigned a definite classification as monomial, binomial and so on, because it has no non-zero coefficient to examine, but for every other constant, treating it as a one-term monomial is standard and correct. This matters when you are asked to classify expressions like 3x2+03x^2+0, which simplifies to the monomial 3x23x^2.

Why does subtracting an expression mean I have to change every single sign, not just the first one?

Subtraction is addition of the additive inverse, and the additive inverse of a sum is the sum of the additive inverses of each term — this is why every sign must flip, not only the leading one. Concretely, subtracting (5x2−4y2+6y−3)(5x^2-4y^2+6y-3) is the same as adding (−5x2+4y2−6y+3)(-5x^2+4y^2-6y+3): each of the four terms gets its own sign reversed, independently, because each term was independently added or subtracted inside the bracket to begin with. If you only flip the first sign, you have actually computed a different, incorrect expression, and this single mistake is the most common reason a subtraction question in this chapter goes wrong even when every other step is done correctly.

Why is xy exactly the same term as yx, but x plus y is not the same as y plus x written differently — wait, aren't those the same too?

Multiplication and addition of ordinary numbers are both commutative, so xy=yxxy=yx and x+y=y+xx+y=y+x are both true for every value of xx and yy — you are right that both pairs are equal, and the chapter uses exactly this fact, for instance treating xzxz and zxzx as the identical like term. The distinction that trips students up is different: x+yx+y (a binomial, two terms) is not the same expression as xyxy (a monomial, one term), even though within each of those expressions the order of the pieces does not matter. So xz=zxxz=zx (same term, reordered) but x+z≠xzx+z \ne xz (genuinely different expressions, one a sum and one a product) — commutativity lets you reorder within an operation, it never lets you swap which operation is being used.

Before this

Where this leads