Foundations of Algebra

The Five Fundamental Laws of Algebra

Associativity, Commutativity, Identity, Inverse & Distributivity — with 50 worked examples

Every technique, shortcut, and rule you use in algebra — from combining like terms to solving equations to factoring polynomials — traces back to these five laws. They are the axioms upon which all of algebra is built. Everything else is a consequence.

When you connect the techniques of algebra back to these fundamental rules, you stop memorizing procedures and start understanding why things work. And when something goes wrong, you can trace the error back to which law was misapplied.

1. Associativity — Grouping Doesn't Matter
The Associative Law
$$a + (b + c) = (a + b) + c \qquad \text{and} \qquad a \cdot (b \cdot c) = (a \cdot b) \cdot c$$

What it means: When you add (or multiply) three or more numbers, it doesn't matter which pair you compute first. You can group them any way you like — the answer is the same.

Why it matters: Without associativity, you'd need to specify exactly which pair to compute at every step. An expression like $a + b + c + d$ would be ambiguous — do you mean $((a + b) + c) + d$ or $(a + (b + c)) + d$ or $a + (b + (c + d))$? Associativity says they're all equal, so we can just write $a + b + c + d$ without parentheses.

The intuition: If you're counting money and you have three piles of coins — 12, 8, and 5 — the total is 25 whether you count the first two piles together first ($20 + 5 = 25$) or the last two first ($12 + 13 = 25$).

10 Examples

Example 1 — Addition with integers
$$(2 + 5) + 3 = 7 + 3 = 10 \qquad \text{vs.} \qquad 2 + (5 + 3) = 2 + 8 = 10 \quad \checkmark$$
Example 2 — Multiplication with integers
$$(4 \cdot 3) \cdot 5 = 12 \cdot 5 = 60 \qquad \text{vs.} \qquad 4 \cdot (3 \cdot 5) = 4 \cdot 15 = 60 \quad \checkmark$$
Example 3 — Negative numbers
$$(-7 + 4) + 9 = -3 + 9 = 6 \qquad \text{vs.} \qquad -7 + (4 + 9) = -7 + 13 = 6 \quad \checkmark$$

Associativity holds even with negative numbers. The grouping doesn't affect the sign.

Example 4 — Fractions
$$\left(\frac{1}{2} + \frac{1}{3}\right) + \frac{1}{6} = \frac{5}{6} + \frac{1}{6} = 1 \qquad \text{vs.} \qquad \frac{1}{2} + \left(\frac{1}{3} + \frac{1}{6}\right) = \frac{1}{2} + \frac{1}{2} = 1 \quad \checkmark$$

Notice how the second grouping was actually easier to compute. Associativity lets you choose the most convenient grouping.

Example 5 — Variables (algebraic proof)
$$(x + 2x) + 3x = 3x + 3x = 6x \qquad \text{vs.} \qquad x + (2x + 3x) = x + 5x = 6x \quad \checkmark$$
Example 6 — Multiplication with decimals
$$(0.5 \cdot 4) \cdot 7 = 2 \cdot 7 = 14 \qquad \text{vs.} \qquad 0.5 \cdot (4 \cdot 7) = 0.5 \cdot 28 = 14 \quad \checkmark$$

Grouping $0.5 \cdot 4$ first gives a nice integer, making the second step easier. This is a strategy, not a rule violation.

Example 7 — Four terms chained
$$1 + 2 + 3 + 4 = ((1+2)+3)+4 = (1+(2+3))+4 = 1+(2+(3+4)) = 10$$

All groupings give 10. This is why we can write $1 + 2 + 3 + 4$ without parentheses at all.

Example 8 — Exponent bases
$$(2 \cdot 3) \cdot x = 6x \qquad \text{vs.} \qquad 2 \cdot (3 \cdot x) = 2 \cdot 3x = 6x \quad \checkmark$$

This is why we write $6x$ instead of $2 \cdot (3 \cdot x)$ — we simplify the coefficient using associativity.

Example 9 — Practical: Grocery shopping

Three items cost $3.50, $2.25, and $4.25. Does it matter which two you add first?

$$(3.50 + 2.25) + 4.25 = 5.75 + 4.25 = 10.00$$
$$3.50 + (2.25 + 4.25) = 3.50 + 6.50 = 10.00 \quad \checkmark$$

The clever shopper notices the second grouping is easier (2.25 + 4.25 = 6.50 is a nice number).

Example 10 — Complex numbers
$$((2+i) + (3-2i)) + (1+i) = (5-i) + (1+i) = 6$$
$$(2+i) + ((3-2i) + (1+i)) = (2+i) + (4-i) = 6 \quad \checkmark$$

Associativity holds for complex number addition too — each "channel" (real and imaginary) is associative independently.

What associativity does NOT apply to

Subtraction is NOT associative: $(10 - 3) - 2 = 5$, but $10 - (3 - 2) = 9$. Different answers! This is why we rewrite subtraction as adding a negative: $10 + (-3) + (-2) = 5$. Addition is associative, so this form is safe.

Division is NOT associative: $(12 \div 6) \div 2 = 1$, but $12 \div (6 \div 2) = 4$. Same fix: rewrite as multiplication by the reciprocal.

2. Commutativity — Order Doesn't Matter
The Commutative Law
$$a + b = b + a \qquad \text{and} \qquad a \cdot b = b \cdot a$$

What it means: You can swap the order of two numbers being added or multiplied and get the same result.

Why it matters: It lets you rearrange terms to make calculations easier. When solving equations, you freely move terms around — this is commutativity at work. When you write $3x$ instead of $x \cdot 3$, that's commutativity.

The intuition: A 3-by-5 grid of tiles and a 5-by-3 grid both contain 15 tiles. Three groups of five sheep and five groups of three sheep are the same total.

10 Examples

Example 1 — Addition, basic
$$7 + 3 = 10 \qquad \text{and} \qquad 3 + 7 = 10 \quad \checkmark$$
Example 2 — Multiplication, basic
$$6 \cdot 9 = 54 \qquad \text{and} \qquad 9 \cdot 6 = 54 \quad \checkmark$$
Example 3 — Reordering to simplify
$$17 + 38 + 83 + 62 = (17 + 83) + (38 + 62) = 100 + 100 = 200$$

Commutativity lets you reorder the terms to find pairs that add to round numbers.

Example 4 — Multiplication trick
$$25 \cdot 7 \cdot 4 = 25 \cdot 4 \cdot 7 = 100 \cdot 7 = 700$$

Swap the 7 and 4 (commutativity), then compute $25 \cdot 4 = 100$ first (associativity). Both laws work together.

Example 5 — Variables
$$x \cdot 5 = 5 \cdot x = 5x \quad \checkmark$$

By convention we write the number first ($5x$ not $x5$). This is a notational choice justified by commutativity.

Example 6 — Two variables
$$xy = yx$$

Commutativity means $xy$ and $yx$ are the same expression. By convention, we often alphabetize: $xy$ not $yx$.

Example 7 — Combining like terms
$$3x + 7y + 2x + 5y$$

Rearrange (commutativity): $3x + 2x + 7y + 5y = 5x + 12y$

You can move terms around freely in addition — this is why "combining like terms" works.

Example 8 — Negative numbers
$$-4 + 9 = 5 \qquad \text{and} \qquad 9 + (-4) = 5 \quad \checkmark$$
Example 9 — Fractions
$$\frac{2}{3} \cdot \frac{7}{5} = \frac{14}{15} \qquad \text{and} \qquad \frac{7}{5} \cdot \frac{2}{3} = \frac{14}{15} \quad \checkmark$$
Example 10 — Practical: Area of a rectangle

A room that is 12 feet by 15 feet has the same area as one that is 15 feet by 12 feet:

$$12 \times 15 = 180 \text{ ft}^2 = 15 \times 12 \quad \checkmark$$

Whether you measure length-first or width-first, the area is the same.

What commutativity does NOT apply to

Subtraction is NOT commutative: $5 - 3 = 2$, but $3 - 5 = -2$. Not the same!

Division is NOT commutative: $6 \div 2 = 3$, but $2 \div 6 = \frac{1}{3}$.

Matrix multiplication is NOT commutative: $AB \neq BA$ in general. This becomes important in linear algebra and physics, where order of operations (rotations, transformations) genuinely matters.

3. Identity — The "Do-Nothing" Elements
The Identity Law
$$a + 0 = a \qquad \text{(additive identity)} \qquad a \cdot 1 = a \qquad \text{(multiplicative identity)}$$

What it means: There exists a special element for each operation that, when combined with any number, leaves that number unchanged. For addition, it's $0$. For multiplication, it's $1$.

Why it matters: The identity elements are the "starting points" and "anchors" of algebra. Adding 0 or multiplying by 1 are not trivial — they are the foundation for solving equations. When you add the same thing to both sides of an equation, you're relying on the fact that the identity exists to "anchor" the balance.

The intuition: Zero means "no change" — if you add nothing to a pile, the pile stays the same. One means "keep it" — one group of seven is still seven.

10 Examples

Example 1 — Additive identity, basic
$$42 + 0 = 42 \qquad 0 + 42 = 42 \quad \checkmark$$
Example 2 — Multiplicative identity, basic
$$42 \cdot 1 = 42 \qquad 1 \cdot 42 = 42 \quad \checkmark$$
Example 3 — With negatives
$$-15 + 0 = -15 \qquad -15 \cdot 1 = -15 \quad \checkmark$$

The identity doesn't care about the sign of the number. Zero added to anything — positive, negative, or zero — returns that number.

Example 4 — Why multiplying by $\frac{3}{3}$ is legal
$$\frac{3}{3} = 1 \qquad \text{so} \qquad x \cdot \frac{3}{3} = x \cdot 1 = x$$

When you "multiply top and bottom by the same number" to get a common denominator, you're actually multiplying by 1 — the multiplicative identity. The value doesn't change.

Example 5 — Adding 0 in disguise: $+5 - 5$
$$x + 5 - 5 = x + 0 = x$$

$+5 - 5 = 0$, which is the additive identity. When you "add and subtract the same thing" (used in completing the square), you're adding 0.

Example 6 — Completing the square uses both disguises
$$x^2 + 6x = x^2 + 6x + 9 - 9 = (x+3)^2 - 9$$

Adding $+9 - 9$ is adding $0$ (identity). This is why the technique is valid — you haven't changed the value.

Example 7 — Zero with variables
$$3x^2 + 0 \cdot x + 5 = 3x^2 + 5$$

The $0 \cdot x$ term vanishes. When a polynomial is "missing" a term, the coefficient is $0$ (the additive identity makes the term disappear).

Example 8 — Multiplying by 1 to rationalize
$$\frac{5}{3-\sqrt{2}} \cdot \frac{3+\sqrt{2}}{3+\sqrt{2}} = \frac{5}{3-\sqrt{2}} \cdot 1 = \frac{5(3+\sqrt{2})}{7}$$

$\frac{3+\sqrt{2}}{3+\sqrt{2}} = 1$. Rationalizing the denominator is multiplying by a clever form of 1.

Example 9 — Exponent identity: $a^0 = 1$
$$5^3 \cdot 5^0 = 5^{3+0} = 5^3 = 125$$

$5^0 = 1$ acts as the multiplicative identity within the exponent system. Multiplying by $a^0$ adds nothing to the exponent.

Example 10 — Practical: Unit conversion
$$5 \text{ km} \times \frac{1000 \text{ m}}{1 \text{ km}} = 5000 \text{ m}$$

The conversion factor $\frac{1000 \text{ m}}{1 \text{ km}} = 1$ because numerator and denominator are the same distance. Unit conversion is multiplying by the multiplicative identity in disguise.

The deep idea

Many algebra techniques are just "adding 0" or "multiplying by 1" in a clever disguise. Completing the square adds $0$. Rationalizing multiplies by $1$. Getting a common denominator multiplies by $1$. Unit conversion multiplies by $1$. Recognizing this pattern is "connecting techniques back to fundamental rules."

4. Inverse — Undoing Operations
The Inverse Law
$$a + (-a) = 0 \qquad \text{(additive inverse)} \qquad a \cdot \frac{1}{a} = 1 \;\text{ for } a \neq 0 \qquad \text{(multiplicative inverse)}$$

What it means: Every number has a partner that "cancels" it back to the identity. For addition, the inverse of $a$ is $-a$ (adding them gives $0$, the additive identity). For multiplication, the inverse of $a$ is $\frac{1}{a}$ (multiplying them gives $1$, the multiplicative identity).

Why it matters: This is the law that lets you solve equations. When you "subtract 5 from both sides," you're adding the additive inverse of 5. When you "divide both sides by 3," you're multiplying by the multiplicative inverse of 3. Without inverses, you could never undo an operation — equations would be unsolvable.

The intuition: If you walk 5 steps forward and then 5 steps back, you're at the starting point ($5 + (-5) = 0$). If you triple something and then take a third, you're back to the original ($3 \cdot \frac{1}{3} = 1$).

10 Examples

Example 1 — Additive inverse, basic
$$7 + (-7) = 0 \qquad (-7) + 7 = 0 \quad \checkmark$$
Example 2 — Multiplicative inverse, basic
$$5 \cdot \frac{1}{5} = 1 \qquad \frac{1}{5} \cdot 5 = 1 \quad \checkmark$$
Example 3 — Solving a linear equation (additive inverse)
$$x + 5 = 12$$

Add $-5$ (the additive inverse of $5$) to both sides:

$$x + 5 + (-5) = 12 + (-5) \quad \Rightarrow \quad x + 0 = 7 \quad \Rightarrow \quad x = 7$$

The $5$ and $-5$ cancel to $0$ (inverse law), and $x + 0 = x$ (identity law).

Example 4 — Solving a linear equation (multiplicative inverse)
$$3x = 21$$

Multiply both sides by $\frac{1}{3}$ (the multiplicative inverse of $3$):

$$\frac{1}{3} \cdot 3x = \frac{1}{3} \cdot 21 \quad \Rightarrow \quad 1 \cdot x = 7 \quad \Rightarrow \quad x = 7$$
Example 5 — Inverse of a fraction
$$\frac{2}{3} \cdot \frac{3}{2} = \frac{6}{6} = 1 \quad \checkmark$$

The multiplicative inverse of $\frac{2}{3}$ is $\frac{3}{2}$ — just flip the fraction. This is why "dividing by a fraction" becomes "multiplying by its reciprocal."

Example 6 — Inverse of a negative
$$(-4) + 4 = 0 \qquad \text{and} \qquad (-4) \cdot \left(-\frac{1}{4}\right) = 1$$

The additive inverse of $-4$ is $4$ (flip the sign). The multiplicative inverse of $-4$ is $-\frac{1}{4}$ (reciprocal, keeping the sign).

Example 7 — Why $\frac{a}{a} = 1$
$$\frac{a}{a} = a \cdot \frac{1}{a} = 1 \qquad \text{(for } a \neq 0\text{)}$$

This is the inverse law in fraction form. It's why any nonzero number divided by itself equals 1. And it's why $\frac{x-3}{x-3} = 1$ when we cancel common factors.

Example 8 — Negative exponents are multiplicative inverses
$$a^{-n} = \frac{1}{a^n} \qquad \text{because} \qquad a^n \cdot a^{-n} = a^{n+(-n)} = a^0 = 1$$

The entire concept of negative exponents comes from the inverse law applied to multiplication.

Example 9 — Inverse functions

If $f(x) = 2x + 3$, then $f^{-1}(x) = \frac{x-3}{2}$, because:

$$f(f^{-1}(x)) = 2\left(\frac{x-3}{2}\right) + 3 = (x - 3) + 3 = x$$

The inverse function "undoes" the original — the same concept as inverse elements, but for functions.

Example 10 — Why you can't divide by zero

What would $\frac{1}{0}$ be? It would need to satisfy $0 \cdot \frac{1}{0} = 1$. But $0$ times anything is $0$ — never $1$. So $0$ has no multiplicative inverse. This is why division by zero is undefined: the inverse simply doesn't exist.

Solving equations = applying inverses

Every step of "solving for $x$" is using an inverse to peel away one layer:

$3x + 5 = 20$

→ Add $-5$ (additive inverse): $3x = 15$

→ Multiply by $\frac{1}{3}$ (multiplicative inverse): $x = 5$

Every equation you'll ever solve in algebra uses this same two-move pattern: additive inverse, then multiplicative inverse.

5. Distributivity — The Bridge Between Addition and Multiplication
The Distributive Law
$$a \cdot (b + c) = a \cdot b + a \cdot c$$

What it means: Multiplication distributes over addition. You can either add first then multiply, or multiply each term separately then add — same result.

Why it matters: This is the single most-used law in algebra. It's behind expanding expressions, factoring, FOIL, combining like terms, and the GCF. It's the only law that connects multiplication and addition — the other four laws deal with each operation separately. Without distributivity, the two operations would be entirely independent and algebra as we know it couldn't exist.

The intuition: If you buy 3 bags, each containing 4 apples and 2 oranges, you have $3 \times 4 = 12$ apples and $3 \times 2 = 6$ oranges. That's $3(4 + 2) = 3 \cdot 4 + 3 \cdot 2 = 18$ fruits total.

10 Examples

Example 1 — Basic distribution
$$5(x + 3) = 5 \cdot x + 5 \cdot 3 = 5x + 15$$
Example 2 — Distributing a negative
$$-2(3x - 4) = (-2)(3x) + (-2)(-4) = -6x + 8$$

The negative sign distributes to both terms. Forgetting this is one of the most common algebra errors.

Example 3 — Factoring is distributivity in reverse
$$6x + 15 = 3(2x + 5)$$

Expanding: $3(2x + 5) = 6x + 15$ ✓. Factoring is just reading the distributive law from right to left.

Example 4 — FOIL is double distribution
$$(x + 2)(x + 3)$$

Distribute the first term, then the second term:

$$= x(x + 3) + 2(x + 3) = x^2 + 3x + 2x + 6 = x^2 + 5x + 6$$

FOIL (First, Outer, Inner, Last) is not a separate rule — it's just distributivity applied twice.

Example 5 — Why combining like terms works
$$3x + 5x = (3 + 5) \cdot x = 8x$$

This is distributivity in reverse (factoring out $x$). The reason $3x + 5x = 8x$ is not a separate rule — it's a direct consequence of the distributive law.

Example 6 — Difference of squares comes from distributivity
$$(a + b)(a - b) = a \cdot a + a(-b) + b \cdot a + b(-b) = a^2 - ab + ab - b^2 = a^2 - b^2$$

The middle terms cancel because $-ab + ab = 0$ (inverse law). But the expansion itself is distributivity.

Example 7 — Mental math trick
$$7 \times 98 = 7 \times (100 - 2) = 700 - 14 = 686$$

Instead of multiplying $7 \times 98$ directly, distribute over a friendlier decomposition.

Example 8 — Distributing a fraction
$$\frac{1}{2}(4x + 10) = \frac{1}{2} \cdot 4x + \frac{1}{2} \cdot 10 = 2x + 5$$

"Dividing both sides by 2" is really multiplying by $\frac{1}{2}$ and distributing.

Example 9 — Distributing across three terms
$$3(x^2 + 2x - 5) = 3x^2 + 6x - 15$$

Distribution works over any number of terms — it's not limited to two.

Example 10 — Practical: Sales tax calculation

Three items cost $a$, $b$, and $c$. With 8% tax:

$$1.08(a + b + c) = 1.08a + 1.08b + 1.08c$$

You can either add the prices first then compute tax, or compute tax on each item separately — same total. This is why stores can compute tax on the subtotal rather than item by item.

The master list of things that are secretly distributivity

Expanding: $a(b + c) = ab + ac$ → distributivity read left to right.

Factoring out GCF: $ab + ac = a(b+c)$ → distributivity read right to left.

FOIL: two applications of distributivity.

Combining like terms: $3x + 5x = (3+5)x$ → reverse distributivity.

Difference of squares, perfect square trinomial, sum/difference of cubes: all derived from distributivity.

Every factoring technique you learned is the distributive law in one form or another.

6. When These Laws Break

One reason we name these laws is so we can study what happens when they don't hold. Here are some important examples you'll encounter later:

LawHolds ForBreaks For
CommutativityReal numbers, complex numbersMatrix multiplication ($AB \neq BA$), vector cross product ($\vec{u} \times \vec{v} = -\vec{v} \times \vec{u}$), quaternion multiplication
AssociativityReal numbers, complex numbers, matrix multiplicationFloating-point arithmetic on computers (due to rounding), vector cross product
DistributivityReal numbers, complex numbers, matricesSome abstract algebraic structures
InverseNonzero reals and complex numbersZero has no multiplicative inverse. Singular matrices have no inverse.
Matrix multiplication is NOT commutative
$$\begin{bmatrix} 1 & 2 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} = \begin{bmatrix} 2 & 1 \\ 1 & 0 \end{bmatrix}$$
$$\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} \begin{bmatrix} 1 & 2 \\ 0 & 1 \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ 1 & 2 \end{bmatrix}$$

Different results! This matters in your Kalman filter work — the order of matrix operations is critical.

Subtraction and division are NOT associative or commutative
$$(10 - 3) - 2 = 5 \qquad \text{but} \qquad 10 - (3 - 2) = 9$$
$$(24 \div 6) \div 2 = 2 \qquad \text{but} \qquad 24 \div (6 \div 2) = 8$$

This is why we rewrite subtraction as adding a negative ($10 + (-3) + (-2)$) and division as multiplying by a reciprocal ($24 \cdot \frac{1}{6} \cdot \frac{1}{2}$). Addition and multiplication do have these properties.

Summary Table
LawFor AdditionFor MultiplicationOne-Line Meaning
Associativity$(a+b)+c = a+(b+c)$$(ab)c = a(bc)$Grouping doesn't matter
Commutativity$a+b = b+a$$ab = ba$Order doesn't matter
Identity$a + 0 = a$$a \cdot 1 = a$There's a "do-nothing" element
Inverse$a + (-a) = 0$$a \cdot \frac{1}{a} = 1$Every element can be undone
Distributivity$a(b + c) = ab + ac$Multiplication distributes over addition
The big picture

These five laws are the complete foundation. A system that satisfies all five is called a field in abstract algebra. The real numbers $\mathbb{R}$ and the complex numbers $\mathbb{C}$ are both fields. The integers $\mathbb{Z}$ are not a field (no multiplicative inverse for most integers — $\frac{1}{3}$ is not an integer).

Every rule, technique, and shortcut in algebra is a consequence of these five laws. When you understand them deeply, you stop memorizing procedures and start seeing the structure underneath.