Read this as a study guide instead

Variables and expressions

Letters standing in for numbers, and how to build and simplify expressions.

Expression
as written3 + 4xparenthesesexponentsmult/divadd/subx = 2 y = 2

The same ideas, as prose

These are the exact fragments the model serves — also available as an ordered study guide.

A letter that stands in for a number

A variable is a letter that stands in for a number — not one fixed number, but any number that could go in that slot, whether it changes from one use to the next or is simply one you have not been told yet. Write x instead of 7 and you can describe a pattern or a relationship that holds no matter which number eventually fills it.

The letter itself carries no value on its own; it behaves like a labeled box that can hold different numbers at different times, without being a number itself. Swap in a different number and the variable is happy to hold it — the letter is a place to put a number, not a number.

An expression is what you build once you have variables to work with: any combination of variables, numbers, and operations, such as 3x + 7, written out as a single value-producing recipe. An expression makes no claim and asks no question; it just names a value, whatever that value turns out to be once the variables are filled in.

That is the whole trick behind algebra: treat a letter as if it already has a number in it, describe what should happen to that number, and the same expression works no matter which number shows up.

Terms, coefficients, and what a letter next to a number means

3 x + 7 coefficient variable one term (3x) constant term a term is a number, or numbers and variables multiplied together
The expression 3x + 7, labeled part by part: 3 is the coefficient, x is the variable, 3x together is one term, and 7 is a constant term.

An expression is built out of terms, and a term is either a single number on its own or a bundle of things multiplied together — a number times a variable, a variable times another variable, or a variable all by itself. In 3x + 7, 3x is one term and 7 is another; the plus sign is what joins separate terms into one expression.

Inside a term, the plain number is called the coefficient — it is the multiplier standing in front of the variable. In 3x, 3 is the coefficient and x is the variable. A term made of only a number, with no variable attached, such as 7, is called a constant, because its value never changes no matter what the variables do.

Writing a number directly next to a letter, with no symbol between them, is shorthand for multiplication: 3x means 3 times x, and xy means x times y. Any letter can serve as a variable, though x, y, and z have been the default choice for an unknown since the 1600s, when Rene Descartes's writing on algebraic geometry helped fix the habit of using letters from the end of the alphabet this way.

That naming convention is arbitrary, not mathematical; nothing stops an expression from using n for a count or t for time when the letter makes the meaning easier to hold onto, and choosing a meaningful letter is one of the few places an expression gets to be readable instead of just correct.

Turning a description into an expression

Building an expression starts with translating ordinary words into variables and operations. "Five more than a number" becomes n + 5; "twice the width" becomes 2w; "three less than double a number" becomes 2n - 3. Each phrase names a quantity, and the expression is just that quantity written in symbols instead of words.

The translation has traps worth knowing by name. "Sum," "more than," and "increased by" all mean addition. "Product," "times," and "of" (as in "half of a number") all mean multiplication. "Difference" and "less than" both mean subtraction, but they do not read in the same order: "a number decreased by five" is n - 5, read straight across, while "five less than a number" is also n - 5, not 5 - n — the quantity being reduced comes first in the expression even though it comes second in the sentence.

Order matters again once an expression nests one operation inside another. "Three times the sum of a number and two" needs the addition done first, so it is written 3(n + 2), with parentheses holding the sum together before the multiplication reaches it. Drop the parentheses and 3n + 2 describes a completely different quantity — only three times the number, plus two afterward.

Reading a real-world description and producing the right expression, in the right order, is the skill every later use of algebra depends on: nothing downstream works if the expression itself does not match what was actually being described.

The order every expression is evaluated in

3 + 4 * 2 1. parentheses first 2. exponents next 3. multiply and divide, left to right 4. add and subtract, left to right 11 one fixed order, so 3 + 4 * 2 is always 11
An expression is evaluated in one fixed order: parentheses first, then exponents, then multiplication and division left to right, then addition and subtraction left to right, funneling down to a single value.

An expression like 3 + 4 * 2 is ambiguous unless everyone agrees on the order to do its operations in — add first and you get 14; multiply first and you get 11. Mathematics settles it with one fixed order, often remembered by the acronym PEMDAS: parentheses first, then exponents, then multiplication and division, then addition and subtraction. The convention is the entire reason two people, or two calculators, working the same expression always land on the same value.

Multiplication and division sit at the same rank as each other, and so do addition and subtraction; within a rank, the operations run left to right across the expression rather than in some other order. 20 / 4 * 5 is not 20 / 20; division comes first because it is the leftmost operation at that rank, giving 5 * 5, or 25.

Parentheses exist to override the default order on purpose. Anything enclosed in them is fully evaluated first, as its own smaller expression, before the result rejoins the rest. That is what lets 3 * (4 + 2) force the addition to happen before the multiplication, even though addition would otherwise come last.

Skip the order, and the same expression stops having one value — every rule that follows, from combining terms to writing an equivalent version of an expression, assumes this order was already applied.

Substituting a number for a variable

2 x + 5 x = 3 substitute 2 ( 3 ) + 5 now plain arithmetic
The variable x in the expression 2x + 5 is replaced by the value 3, producing 2(3) + 5, before the expression is reduced any further.

Evaluating an expression means giving every variable in it a specific number and reducing the whole thing to a single value. Given 2x + 5 and told x is 3, the variable's every appearance gets replaced by 3, turning the expression into 2 * 3 + 5 — now a plain arithmetic problem with no letters left in it.

Substitution happens first, all at once, before any arithmetic starts; only after every variable has been swapped for its number does the order of operations take over and reduce what remains. Skipping ahead and doing arithmetic before every variable is replaced is the most common way to evaluate an expression wrong.

An expression with more than one variable needs a value for each of them before it can be evaluated at all. xy - z, with x = 4, y = 2, and z = 3, becomes 4 * 2 - 3, which reduces to 5; leave any one of the three variables unassigned and the expression cannot be reduced past the point where that letter still appears.

The same expression, evaluated at different numbers, is what makes a variable useful in the first place: one recipe, 2x + 5, produces a different answer for every x you hand it, without ever being rewritten.

Combining like terms

4x + 3y + 2x - y 4x +3y +2x -y 4x + 2x 3y - y 6x 2y simplified: 6x + 2y
In the expression 4x + 3y + 2x - y, the x terms and the y terms are regrouped into two clusters before their coefficients are added, giving 6x + 2y.

Two terms are "like terms" only when they carry the exact same variable, raised to the exact same power — 3x and 5x are like terms, but 3x and 3y are not. Matching variables is what makes two terms the same kind of thing; the coefficients in front of them are free to differ.

Combining like terms means adding or subtracting their coefficients while leaving the shared variable part untouched: 3x + 5x becomes 8x, and 7y - 2y becomes 5y. It works like sorting a mixed pile into groups of the same kind of item before counting each group — only quantities of the same kind of thing combine into one count.

An expression with several terms mixed together, such as 4x + 3y + 2x - y, gets simplified by first regrouping so the like terms sit together — 4x + 2x and 3y - y — and only then combining each group: 6x + 2y. The order the terms were originally written in makes no difference to the result.

Combining like terms never changes what the expression is worth; 4x + 3y + 2x - y and 6x + 2y produce the identical number for any values of x and y, which is exactly what makes the shorter version worth writing.

Multiplying a sum by distributing

3 multiplies each term inside 3 ( x + 4 ) 3x + 12
In 3(x + 4), the factor 3 outside the parentheses multiplies each term inside separately, producing 3x + 12.

The distributive property says a factor multiplied by a sum inside parentheses can be multiplied into each term of that sum separately, and the two ways of writing it are worth the same: a(b + c) equals ab + ac. It holds for any numbers or variables in place of a, b, and c, which is what makes it a property of arithmetic itself rather than a rule specific to one expression.

Distributing works like handing an equal amount to everyone in a group, one by one, instead of handing the whole amount to the group as one lump: instead of handing the whole factor to the parenthesized group all at once, it gets applied to each term inside, one at a time. 3(x + 4) distributes to 3x + 12 — the 3 reaches both the x and the 4 separately, rather than only touching the sum as a single block.

The property runs the same way with subtraction inside the parentheses, and with a variable doing the multiplying instead of a plain number: x(y - 2) distributes to xy - 2x. Whatever sits outside the parentheses reaches every term inside, keeping the sign each term already carried.

Distributing is how a compact expression like 2(x + 5) gets turned into the expanded form 2x + 10 that combining like terms can then work with, and running the same property in reverse — pulling a shared factor back out of every term — is how an expanded expression gets folded back down to its compact form.

Why letters-for-numbers is the whole game

The word "algebra" itself comes from "al-jabr," part of the title of a mathematics book written in Baghdad around 820 CE — a reminder that treating an unknown quantity symbolically, rather than working every problem out fresh in words each time, is not a modern shortcut but the origin of the whole subject. Everything this concept covers — naming a variable, building an expression, evaluating it, simplifying it — is the toolkit that book's tradition eventually produced.

That toolkit is also the one every later use of mathematics assumes is already in hand. Solving for an unknown quantity, describing how one quantity changes as another one does, working with powers, comparing ratios — all of it is written in expressions built from variables, and none of it pauses to re-explain what a variable is or how order of operations works.

The habit reaches past mathematics classes entirely. A spreadsheet formula, a line of code that turns a few inputs into one output, a physical formula translated into a program — every one of them is, underneath its particular syntax, an expression: a fixed recipe applied to values that change from run to run. Learning to read and build expressions here is learning to read the shape of every one of those later.

There is no version of quantitative reasoning that skips this step. A letter that can stand in for a number, evaluated fresh each time a number is supplied, is the smallest unit every larger structure in mathematics and computing gets assembled from.