,

A variable is a symbol that represents a value. It can stand for an unknown number, a quantity that changes, or an arbitrary number in a general rule. Letters such as xx, nn and tt let us describe a relationship without writing a separate calculation for every possible value.

For example, n+3n+3 means three more than nn. If n=8n=8, the expression has the value 1111. If n=20n=20, it has the value 2323. The value changes; the relationship stays the same.

On this page (7 sections)

What a variable represents

A letter gets its meaning from the problem, not from its place in the alphabet. In a measurement problem, tt might represent time. In another problem, it could represent temperature. Define the quantity before using the symbol, and include its unit when one is needed.

A variable represents a value, not the name of an object. Writing “nn is the number of notebooks” is clearer than “nn means notebooks.” This distinction tells us that n=6n=6 means six notebooks, not that a notebook somehow equals six.

OpenStax introduces variables and constants through relationships between quantities. The useful question is not simply “Which letters can I see?” It is “What does each symbol represent here?”

An unknown value

In the equation below, xx represents a number we need to find.

x+7=19x+7=19

Subtracting 77 from both sides gives x=12x=12. The variable does not keep changing within this solution. We are identifying the value that makes the equation true.

A changing quantity

Suppose an example order costs 44 per notebook plus a fixed 33 delivery charge. Let nn be the number of notebooks and CC the total cost in dollars.

C=4n+3C=4n+3

The same rule works for different order sizes. For two notebooks, C=11C=11; for five, C=23C=23. Within this model, nn is the input and CC depends on it. The numbers 44 and 33 stay fixed.

Notebook costs for three order sizes

The rule is fixed even when the input changes.

Diagram explained

With C=4n+3C=4n+3, an input of 11 gives 77, an input of 22 gives 1111, and an input of 55 gives 2323. The arrows connect inputs to outputs; they are not equals signs.

Reading expressions with variables

In ordinary algebra, writing a number next to a variable means multiplication. Thus 4n4n means 4×n4\times n, not the two-digit numeral “4n.” Similarly, abab means the product of aa and bb when those letters have been defined as separate variables.

The expression 4n+34n+3 contains two terms: 4n4n and 33. Its coefficient is 44, and its constant term is 33. A coefficient is the numerical factor multiplying the variable part; the Coefficient article explains this distinction in detail.

An expression represents a value. An equation states that two expressions are equal. You can evaluate 4n+34n+3 once nn is given. To solve for an unknown nn, you need a condition such as 4n+3=234n+3=23. A letter on its own is not an instruction to “solve.”

Substituting a value

To evaluate an expression, replace every occurrence of a variable with its assigned value, then follow the order of operations. Parentheses make a substitution especially clear when the replacement is negative.

For x=−2x=-2:

3x2+2x=3(−2)2+2(−2)3x^2+2x=3(-2)^2+2(-2)
=3(4)−4=8=3(4)-4=8

Both occurrences of xx receive the same value. The square applies to the whole substituted number −2-2, so (−2)2=4(-2)^2=4. It does not mean −22-2^2, which equals −4-4.

Also distinguish multiplication from a power. When x=4x=4, 2x=82x=8, whereas x2=16x^2=16. In the first expression, the coefficient multiplies the value. In the second, the exponent tells us to multiply two factors of that value.

Which values are allowed?

The domain is the set of permitted values. Context may restrict it: a count of notebooks in an order must be a positive whole number, while a measured length may include fractions or decimals. A formula can impose its own restrictions too.

12xrequires x≠0\frac{12}{x}\quad\text{requires }x\ne0

Division by zero is undefined. Substituting x=0x=0 does not produce an unusually large answer; it makes this expression undefined. Check restrictions before calculating rather than discovering them after an invalid step.

A letter is not automatically a variable in every setting. The symbol π\pi conventionally names a fixed number. In a family of rules such as y=axy=ax, aa can be a parameter: a value chosen and then held fixed while xx varies. Its role depends on how the problem defines it.

Turning words into algebra

Start by naming the quantity, then describe what happens to it. “Three less than twice a number” becomes 2n−32n-3. “Twice the difference between a number and three” becomes 2(n−3)2(n-3). The parentheses preserve a different relationship.

For n=10n=10, the first expression gives 1717 and the second gives 1414. Trying a value can expose a translation mistake, but the words and grouping determine the expression.

Before moving on, ask whether each letter has a clear meaning, whether repeated letters received the same value, and whether the result fits the context. From here, polynomials show how variable terms combine into more structured expressions.

Practice questions

  1. Evaluate 5n−25n-2 when n=4n=4.
  2. Solve x+9=16x+9=16.
  3. Write an expression for “half a number, then add five.”
Check your answers
  1. 5(4)−2=20−2=185(4)-2=20-2=18.
  2. Subtract 99 from both sides: x=7x=7. Check: 7+9=167+9=16.
  3. n2+5\frac{n}{2}+5. The expression n+52\frac{n+5}{2} would mean adding five before taking half.

Sources and further reading

OpenStax, Elementary Algebra 2e, §1.2: Use the Language of Algebra. Reference for variables, expressions, equations and substitution. The examples and diagram in this article were developed for CTS.