Mathematics · Foundation article
Variables, expressions and substitution
Use symbols to name numbers or quantities, describe their allowed values, and evaluate expressions by replacing every occurrence consistently. Preserve grouping, signs, fractions and units, and distinguish a calculated value from solving an equation or proving two rules equivalent.
Useful background article: Estimation and checking reasonable answers
Back to MathematicsAfter reading, you can
- Identify a variable’s role and allowed inputs, and recognize elementary constants, coefficients, terms and implicit multiplication.
- Substitute a supplied value at every occurrence, use parentheses for signed and fractional inputs, and follow the expression’s operation order.
- Distinguish expressions from equations and evaluation from solving, check units and undefined inputs, and interpret sample comparisons without claiming a universal proof.
Give a number or quantity a name
A variable is a symbol used to name a number or quantity in a mathematical description. In 2x + 3, x names the input number. If the input is x = 2, evaluating the expression means using two wherever x occurs. A variable need not change during one calculation; its name allows the same rule to be used with different permitted inputs.
The symbol’s role comes from the description. It may name a supplied input, an unknown value to be found, or a quantity in a model. State what it represents rather than expecting the letter to explain itself. If L names a length, include its unit and geometric conditions; if n counts groups, state which counts are possible.
State which inputs the rule allows
The domain is the set of allowed inputs. The scalar expression 2x + 3 can be evaluated for positive, negative, zero and fractional real inputs. The explorer uses the five exact samples −2, −1, 0, 1/2 and 2. Those samples illustrate the rule; they do not exhaust all real inputs it permits.
A context can impose further restrictions. If n counts complete groups of beads, n must be a nonnegative integer. If L is a rectangle’s side length, L must be positive. A mathematical operation can also exclude an input: 1/x requires x ≠ 0. Check both the expression’s operations and the stated context before calculating.
| Role | Example | Allowed inputs in that description |
|---|---|---|
| Scalar input | x in 2x + 3 | All real numbers; the explorer selects five samples |
| Complete-group count | n groups, each adding two beads | Nonnegative integers |
| Geometric length quantity | L as a rectangle’s side | Positive lengths with compatible units |
| Reciprocal input | x in 1/x | Nonzero real numbers |
Read the parts of a simple expression
In 2x + 3, the two additive terms are 2x and 3. The number two is the coefficient multiplying x; three is the constant term, which stays fixed as x varies. The whole expression describes a result obtained from the input. Knowing these names helps you explain which part of the rule you are changing or evaluating.
A constant is fixed in the stated rule or situation. A variable assigned x = 2 for one evaluation still has the input role; that assignment does not turn every later input into two. Also read grouping before naming parts: 2(x + 3) tells you to multiply the entire grouped sum by two. Do not interpret it as the ungrouped expression 2x + 3.
Read adjoining symbols as multiplication when defined that way
Algebra often omits the multiplication sign between a numerical coefficient and a variable, or before a parenthesized group. Thus 2x means 2 × x, and 2(x + 3) means 2 × (x + 3). For x = 12, 2x has value 24. Writing the digit two beside the digits twelve to make 212 is digit concatenation, a different operation.
A power is another distinct instruction: x² means x × x, not x × 2. A clear written expression must make its operations and symbol names identifiable. During substitution, write the multiplication sign and parentheses explicitly if they help prevent a sign or grouping mistake.
Separate a calculation rule from an equality statement
An expression such as 2x + 3 describes a value once an allowed input is supplied. An equation such as 2x + 3 = 7 states that two expressions have equal values. The equality is true for x = 2, but it is not true for every input. The equals sign expresses a relationship; it is not an instruction to replace it with any next calculation step.
Evaluating answers: what value does the expression have at this given input? Solving answers: which allowed input values make this equation true? Here we mainly evaluate supplied inputs and check statements. The next lesson develops equality and one-step equations; do not treat an expression without an equation as a request to find a unique unknown.
Replace every occurrence with the same supplied value
Substitution replaces a variable with its supplied value everywhere it appears. For x² + x at x = −2, write (−2)² + (−2) = 4 − 2 = 2. Both occurrences of x use the same input. Replacing only one occurrence leaves an expression partly unevaluated; using different values for the same x changes the stated question.
Keep the original structure while replacing symbols, then calculate. For x = 1/2, x² + x becomes (1/2)² + (1/2) = 1/4 + 1/2 = 3/4. These fractions are exact values. A decimal approximation is optional only when the requested report needs it; it is not necessary for the substitution.
Protect the input’s sign and fraction with parentheses
When x = −2, substituting into x² gives (−2)² = 4. By the usual operation order, −x² means −(x²); at the same input it becomes −((−2)²) = −4. The grouped expression (−x)² instead squares the negated input and gives 4. Parentheses tell you what is being squared and keep a negative input distinct from a minus sign outside the square.
For a fractional input, keep the fraction together as one operand: 2x at x = 1/2 becomes 2 × (1/2) = 1, and x² becomes (1/2)² = 1/4. In the reciprocal 1/x, the entire supplied value is the denominator: 1 ÷ (1/2) = 2. This grouping prevents a sequence of ungrouped division signs from silently changing the expression.
Evaluate the grouping before comparing the rules
Follow parentheses first, then powers, then multiplication and division, and finally addition and subtraction. At x = 2, 2x + 3 becomes 2 × 2 + 3 = 4 + 3 = 7. In 2(x + 3), first evaluate the parenthesized sum: 2 × (2 + 3) = 2 × 5 = 10. The input is the same, but the instructions differ.
The grouping still matters for signed and fractional values. At x = −2 the two results are −1 and 2; at x = 1/2 they are 4 and 7. Write the substitution before doing mental arithmetic. Within the multiplication-and-division level, or the addition-and-subtraction level, follow the expression from left to right when grouping does not specify otherwise.
| Expression | Substitution | Value |
|---|---|---|
| 2x + 3 | 2 × (2) + 3 = 4 + 3 | 7 |
| 2(x + 3) | 2 × ((2) + 3) = 2 × 5 | 10 |
Keep quantity names and units connected
The explorer’s x is a scalar number, so its four rules do not carry physical units. In a separate rectangle model, let L name a length quantity and fix the other side at 3 m. Its perimeter expression is 2L + 6 m. For L = 2.5 m, substitution gives 2 × (2.5 m) + 6 m = 11 m. The coefficient two is dimensionless; both added terms are lengths.
For that rectangle, L must be positive. A negative input might still produce an arithmetic result, but it would not describe a valid rectangle side. Count models can have different domains: three fixed beads plus two beads per complete group gives a total count 3 + 2n for nonnegative integer n; at n = 4 the count is eleven. Name the context before transferring a scalar rule to quantities or counts.
Check a denominator before claiming an output
The reciprocal 1/x is undefined at x = 0. If 1/0 were an ordinary real-number value q, it would need 0 × q = 1, but zero times every real number is zero. Thus no real value satisfies that requirement. Undefined is not an output of zero, an exceptionally large finite number or a point to place on the output number axis.
At allowed inputs the reciprocal can be positive, negative or fractional: 1 ÷ (−2) = −1/2, 1 ÷ (1/2) = 2, and 1 ÷ (2) = 1/2. An excluded input is useful to inspect because it reveals the rule’s domain restriction. Check the domain before evaluating rather than inventing a numerical answer afterward.
Substitute an input while keeping the expression fixed
Start with 2x + 3 and exact input x = 2. The explorer shows 2 × (2) + 3 = 7. Keep that input and choose 2(x + 3), x² or 1/x: their values are 10, 4 and 1/2. One fixed scalar number axis has separate marker rows for the supplied input and the evaluated output. The markers locate those two number values.
Choose any of the five exact inputs −2, −1, 0, 1/2 and 2. Four expressions and five inputs give 4 × 5 = 20 states, including the reciprocal’s excluded zero input. At that state the result is undefined and no output point is plotted. Signed and fractional operands retain parentheses, and fractional results remain exact rather than being rounded for display.
Compare the sample values to notice grouping, repeated multiplication and reciprocal behavior. Agreement at selected inputs describes only those comparisons. As a separate written comparison, evaluate x² and x at zero, one and two: they agree at zero and one but disagree at two, where they give four and two. A finite set of agreeing samples does not by itself prove that two expressions are equivalent for every common allowed input.
| x | 2x + 3 | 2(x + 3) | x² | 1/x |
|---|---|---|---|---|
| −2 | −1 | 2 | 4 | −1/2 |
| −1 | 1 | 4 | 1 | −1 |
| 0 | 3 | 6 | 0 | Undefined |
| 1/2 | 4 | 7 | 1/4 | 2 |
| 2 | 7 | 10 | 4 | 1/2 |
Substitute a value; keep the grouping
Choose an expression and one value for x. Replace x with that whole value, then follow the grouping and operation order. The two choices are independent. If an expression repeats x, every occurrence receives the same selected value.
x = 2; 2x + 3; Evaluated value: 7.
Check the allowed values
These first three expressions are defined for every real scalar value of x. The five buttons are curated samples, not a restriction to integers or a complete variable domain.
Substitute the whole operand
2 × (2) + 3.
In 2x + 3, multiply 2 by x before adding 3.
Follow the operation steps
- 2 × (2) = 4.
- 4 + 3 = 7.
Compare the input and evaluated value on one scalar axis
Blue circle: the selected input value. Violet diamond: the evaluated value, when defined. Separate rows keep coinciding values visible.
| Input x | Expression | Evaluated value |
|---|---|---|
| −2 | 2x + 3 | −1 |
| −1 | 2x + 3 | 1 |
| 0 | 2x + 3 | 3 |
| 1/2 | 2x + 3 | 4 |
| 2 | 2x + 3 | 7 |
The table checks these samples exactly. Matching results at some inputs do not by themselves prove two expressions equivalent for every permitted input.
All displayed fractions and results are exact. Negative and fractional substituted operands are bracketed so their signs and grouping remain visible.
Check the task before interpreting the result
Identify the symbol’s role, the supplied value, the allowed inputs and any units. Decide whether the task asks for evaluation, checks an equation at a given input, or asks you to solve for an unknown. Replace every occurrence consistently, preserve parentheses, follow operation order and explain the result in its context.
A correct evaluation establishes the expression’s value at that allowed input. It does not establish that every input works, that the model suits a real situation, or that two rules agreeing on a few examples are universally equivalent. The next lesson, Equality and one-step equations, develops the equality relationship and simple ways to find inputs that satisfy it.
Worked examples
Use one signed input in two differently grouped expressions
Evaluate 2x + 3 and 2(x + 3) at exact input x = −2. Then compare them at x = 1/2. Keep the grouping and show what the coefficient multiplies.
- For x = −2, substitute into the first expression: 2 × (−2) + 3 = −4 + 3 = −1. The coefficient multiplies x only.
- Substitute into the grouped expression: 2 × ((−2) + 3) = 2 × 1 = 2. The coefficient multiplies the entire parenthesized sum.
- For x = 1/2, the first gives 2 × (1/2) + 3 = 1 + 3 = 4. The grouped expression gives 2 × ((1/2) + 3) = 2 × (7/2) = 7.
- The results differ at both supplied inputs. Matching symbols and numbers do not make two expressions identical when their grouping differs.
At x = −2, the values are −1 and 2. At x = 1/2, they are 4 and 7. In 2(x + 3), two multiplies the whole sum.
Replace both occurrences and preserve the sign of a square
Evaluate x² + x at exact inputs −2 and 1/2. Separately compare x² and −x² at x = −2. Why must the negative input be parenthesized?
- At x = −2, replace both occurrences: (−2)² + (−2) = 4 − 2 = 2. The square applies to the whole negative input.
- At x = 1/2, write (1/2)² + (1/2) = 1/4 + 1/2 = 3/4. Both occurrences use the same fraction.
- For x² at x = −2, the result is (−2)² = 4. For −x², the minus sign remains outside the square: −((−2)²) = −4.
- Writing the replacement with parentheses preserves which value is squared. A negative input and an external minus sign are separate parts of the calculation.
x² + x gives 2 at x = −2 and 3/4 at x = 1/2. At x = −2, x² gives 4 while −x² gives −4.
Substitute a length quantity into a rectangle model
A rectangle has one exact side L and another exact side 3 m. Its perimeter expression is 2L + 6 m. Evaluate it at L = 2.5 m and state the permitted geometric inputs. Does a negative length become valid merely because the expression can be calculated?
- L names a length quantity, so substitute its value with its unit: 2 × (2.5 m) + 6 m.
- Multiply first to obtain 5 m + 6 m = 11 m. Both terms are lengths and the result has a length unit.
- Check the boundary directly: 2.5 m + 3 m + 2.5 m + 3 m = 11 m, matching the expression.
- A rectangle side must have positive length. For L = −2 m the arithmetic expression would give 2 m, but the input is inadmissible for this rectangle model.
The perimeter is 11 m at L = 2.5 m. The model permits positive length quantities L with compatible units; an arithmetic output does not make a negative side length admissible.
Try it yourself
In the scalar expression 2x + 3, identify the variable, coefficient of x, constant term and two additive terms. Does using x = 2 for one evaluation mean every later input must be two?
Show the answer and reasoning
The variable is x, its coefficient is two, the constant term is three, and the additive terms are 2x and 3. One supplied input does not restrict every later evaluation to two.
The input role of x differs from the fixed parts of the rule. State its allowed values and use one supplied value consistently during each evaluation. Grouping would change the instructions in 2(x + 3).
For x = 12, evaluate 2x and x². Why are 212 and 24 not both valid interpretations of 2x? Does x² mean x times two?
Show the answer and reasoning
2x = 2 × 12 = 24 and x² = 12 × 12 = 144. The numeral 212 concatenates digits; it is not the indicated multiplication. x² squares x rather than multiplying it by two.
Read the expression’s notation before replacing its symbols. A coefficient and an exponent give different instructions, and adjoining a coefficient to a variable denotes multiplication here.
Evaluate 2x + x² first at x = −2 and then at x = 1/2. Show both replacements before calculating. What goes wrong if only the x in the square is replaced?
Show the answer and reasoning
At −2, 2 × (−2) + (−2)² = −4 + 4 = 0. At 1/2, 2 × (1/2) + (1/2)² = 1 + 1/4 = 5/4. Replacing only one occurrence leaves the expression partly unevaluated.
Both occurrences name the same supplied input. Parentheses preserve the signed or fractional operand and the power’s base. The resulting fraction is exact.
At exact input x = −1, evaluate 2x + 3 and 2(x + 3). Which sum is completed before multiplying by two?
Show the answer and reasoning
2x + 3 gives 2 × (−1) + 3 = 1. The grouped expression gives 2 × ((−1) + 3) = 2 × 2 = 4. In the second expression, x + 3 is evaluated before that multiplication.
Use the written grouping rather than the order in which the symbols look familiar. The same input can give different results under different rules.
At x = −1, compare x², −x² and (−x)². Write the signed replacement with parentheses and identify where the minus sign is applied.
Show the answer and reasoning
x² = (−1)² = 1; −x² = −((−1)²) = −1; (−x)² = (−(−1))² = 1. The external minus in −x² is applied after squaring.
A power is evaluated before an ungrouped leading minus. Parentheses around the negated expression in (−x)² place that negation inside the base of the square.
Evaluate 1/x at x = 1/2 and inspect x = 0. Separately, can L = −2 m be used in the rectangle expression 2L + 6 m if L names a side length? Explain whether an output number alone settles admissibility.
Show the answer and reasoning
At 1/2 the reciprocal is two; at zero it is undefined. L = −2 m is excluded from the rectangle’s positive-length domain, even though the arithmetic expression would give 2 m.
Operation restrictions and context restrictions both matter. Undefined is not zero, and a calculable expression at an invalid geometric input does not establish a valid rectangle.
How does evaluating 2x + 3 at x = 2 differ from finding inputs that satisfy 2x + 3 = 7? The expressions x² and x agree at zero and one: does that prove universal equivalence? Check x = 2.
Show the answer and reasoning
Evaluation uses the supplied input and returns seven. Solving seeks allowed inputs making the equality true. Agreement at zero and one does not prove universal equivalence: at two, x² gives four and x gives two.
Keep the task and the claim distinct. Exact evaluation settles the supplied case; a finite set of agreeing samples alone does not settle every input. One differing allowed input rules out a claim that the two expressions always agree.
What to carry forward
- Name what a variable represents and which inputs are allowed; its role may be a supplied number, an unknown or a quantity with units.
- Read coefficients, constants, terms, implicit multiplication and powers before calculating; grouping is part of the expression’s instruction.
- Replace every occurrence with the same input, bracket signed and fractional operands, and follow the stated operation order.
- Keep units and context restrictions, and exclude a zero denominator rather than assigning it a numerical output.
- Evaluation uses a supplied input, solving seeks inputs satisfying an equation, and finite sample agreement alone does not prove universal equivalence.
References
Sources for the concepts and teaching approaches in this article.
- TIMES · Algebraic expressionsAustralian Mathematical Sciences InstituteTeaching resource
- Ganita Prakash · Grade 7 · Expressions Using Letter-NumbersNational Council of Educational Research and Training (NCERT), IndiaTextbook chapter · PDF
- Mastery Professional Development · 1.4 Simplifying and manipulating expressions, equations and formulaeNational Centre for Excellence in the Teaching of Mathematics (NCETM)Teaching resource · PDF