Variables and Expressions

Evaluating Expressions by Substitution Without Sign Errors

A reliable routine for plugging numbers into expressions, with worked examples for negatives, powers and fractions.

Key takeaways

  • Put every substituted value inside parentheses, especially negative numbers and fractions.
  • Evaluate in order: grouping first, then exponents, then multiplication and division, then addition and subtraction.
  • An exponent applies only to what it touches, so -x² and (-x)² give different results.
  • Replace every copy of a variable with the same value.
  • Estimate the sign of each term before computing, then compare it with your result.

To evaluate an expression, replace each variable with its given number wrapped in parentheses, then carry out the operations in the standard order. The parentheses are what prevent most sign errors, because they keep a negative number together as a single value.

For example, to find x² - 3x when x = -4, write (-4)² - 3(-4). That gives 16 + 12 = 28. Without the parentheses, many students write -16 - 12 and get -28, which is wrong in both pieces.

The three-step routine

Use the same steps every time, even on easy problems, so that they are automatic on hard ones.

  1. Rewrite the expression with empty parentheses where each variable was.
  2. Fill the parentheses with the given values.
  3. Simplify one layer at a time, writing a new line for each layer.

Here it is for 5a - 2b + ab, with a = -3 and b = 4.

5( ) - 2( ) + ( )( )           (empty slots)
5(-3) - 2(4) + (-3)(4)         (fill them)
-15 - 8 + (-12)                (multiply)
-35                            (add from left to right)

The empty-slot line may feel fussy. It takes a few seconds and it stops you from changing a sign while you copy.

Substituting safely
1 Make empty slots Replace each letter with ( ) 2 Fill the slots Drop in values, signs and all 3 Work in order Powers, then products, then sums 4 Check the signs Is each term's sign sensible? Make empty slots Replace each letter with ( ) 1 Fill the slots Drop in values, signs and all 2 Work in order Powers, then products, then sums 3 Check the signs Is each term's sign sensible? 4

Why parentheses matter so much

A negative number is one value written with two symbols. When it moves into an expression, the minus sign has to travel with it.

Compare the following, all with x = -5.

Expression Substituted Value
x² (-5)² 25
-x² -(-5)² -25
-x -(-5) 5
10 - x 10 - (-5) 15
2x³ 2(-5)³ -250

In the second row, the square is done first, giving 25, and then the leading minus sign makes it negative. The difference between the first two rows is explored in why -3² and (-3)² give different answers.

In the last row, an odd power of a negative number stays negative: (-5)(-5)(-5) = -125. An even power of a negative number is positive.

Subtraction followed by a negative

The most error-prone moment is subtracting a negative value. In p - q with p = 2 and q = -9, you get 2 - (-9) = 2 + 9 = 11.

It helps to see why. Subtracting means finding the distance and direction from the second number to the first. Going from -9 to 2 on a number line is a move of 11 units to the right.

If signed arithmetic still feels shaky, review adding and subtracting negative numbers before tackling longer expressions. A single wrong sign early on will carry through every later line, no matter how careful the rest of the work is.

Keeping the order of operations

After substituting, you have a pure arithmetic problem. Apply the usual ranking: grouping symbols, exponents, multiplication and division from left to right, then addition and subtraction from left to right.

Evaluate 20 - 2(m + 1)² when m = -4.

20 - 2((-4) + 1)²       (substitute)
20 - 2(-3)²             (inside the parentheses)
20 - 2(9)               (exponent)
20 - 18                 (multiply)
2                       (subtract)

Two tempting shortcuts fail here. Computing 20 - 2 first gives 18 times something, which ignores that multiplication outranks subtraction. Squaring -6, from multiplying 2 by -3 first, ignores that exponents outrank multiplication. The ranking is explained further in order of operations beyond PEMDAS.

Fractions and fraction bars

A fraction bar groups everything above it and everything below it. Evaluate the top and bottom separately before dividing.

Take (3y - x)/(x + y) with x = 6 and y = -2.

(3(-2) - (6)) / ((6) + (-2))
(-6 - 6) / (4)
-12 / 4
-3

Before you start, check whether the denominator could be 0. Here it would be if x = -y, for instance x = 2 and y = -2. In that case the expression is undefined, and the correct answer is to say so.

When the substituted value is itself a fraction, parentheses matter again. For 6t² with t = -2/3:

6(-2/3)²
6(4/9)
24/9
8/3

Squaring applies to numerator, denominator and sign together.

Roots, absolute values and other groupers

Square roots and absolute value bars group their contents too.

For √(b² - 4ac) with a = 2, b = -5 and c = -3:

√((-5)² - 4(2)(-3))
√(25 - (-24))
√49
7

Notice that -4ac became +24, since two negative factors are involved: -4 and -3. Writing each in parentheses makes that easy to see.

The symbol √ means the principal, nonnegative root. So √(x²) with x = -8 is √64 = 8, not -8. In general √(x²) = |x|.

For |a - b| with a = 3 and b = 10, compute inside first: |-7| = 7. Taking absolute values of 3 and 10 separately and then subtracting would give -7, which is incorrect.

A longer worked example

An object thrown upward from a platform might be modeled by h = -16t² + 32t + 48, with height h in feet and time t in seconds, ignoring air resistance. Find the height at t = 2 and t = 3.

t = 2:  -16(2)² + 32(2) + 48 = -64 + 64 + 48 = 48
t = 3:  -16(3)² + 32(3) + 48 = -144 + 96 + 48 = 0

At 2 seconds the object is 48 feet up, level with the platform. At 3 seconds the height is 0, so it has reached the ground. A negative result for a later time would signal that the model no longer applies, because the object cannot keep falling through the ground.

Substituting an expression for a variable

The same routine works when the thing you plug in is not a number. Suppose a problem asks for the value of x² - 2x when x = a - 3. Parentheses do exactly the job they did before: they keep the whole replacement together.

(a - 3)² - 2(a - 3)             (substitute into both slots)
a² - 6a + 9 - 2a + 6            (expand the square; distribute -2)
a² - 8a + 15                    (combine like terms)

Two spots deserve attention. The square of a - 3 is a² - 6a + 9, with a middle term, and not a² - 9 or a² + 9. The product of -2 and -3 is +6.

You can test the result with a number. Let a = 5, so that x = 2. The original expression gives 4 - 4 = 0. The simplified version gives 25 - 40 + 15 = 0. The two agree.

This skill returns constantly with function notation, where an input such as a + h replaces x. The article on evaluating f(a + h) carefully works through that case.

Substituting several values that depend on each other

Some problems give one value and ask you to find another before evaluating. Say y = 3 - x and you need x² + y² when x = -1.

First find y. Substituting gives y = 3 - (-1) = 4. Then evaluate: (-1)² + (4)² = 1 + 16 = 17.

Doing the work in two clear stages is safer than trying to substitute everything into one long line. If you prefer one line, replace y by (3 - x) first, giving x² + (3 - x)², and then put (-1) into both places: 1 + (4)² = 17.

Either route must give the same number. When they differ, one of them contains a copying or sign error.

How to catch mistakes

A few quick checks find most errors.

Sign forecast. Before calculating, note the sign of each term. In -16t², with any nonzero t, the term must be negative. If your line shows a positive value there, stop.

Every copy replaced. Scan for leftover letters. If x appears three times, all three get the same value.

Order of letters. When several values are given, confirm that a received a's value. Swapping two values is easy to do in a hurry.

Calculator entry. On many calculators, typing -5² returns -25. Type (-5)² when you mean the square of negative five.

Size check. Round the values and estimate. If x is about 100, then x² should be about 10,000. The habit is part of checking whether an answer is reasonable.

Diagnosing a wrong answer

When your result disagrees with an answer key, the size and sign of the gap often point to the cause.

  • Right size, wrong sign. Look for a subtraction of a negative, or a leading minus sign in front of a power.
  • Off by exactly twice one term. That term's sign was probably flipped. If the correct value is 23 and you found -7, the difference of 30 suggests a term worth 15 changed sign.
  • Far too large. Check whether an exponent was applied to a coefficient, as in treating 2x² like (2x)².
  • A fraction where a whole number was expected. Check whether the entire numerator was divided, or only its last piece.

Suppose you evaluate 4 - x² at x = -6 and get 40. The correct value is 4 - 36 = -32. Getting 40 means the line read 4 + 36, so the minus sign in the expression was lost when the square of a negative produced a positive. The square is positive, and the subtraction in front of it still applies.

Practice set

Evaluate each with x = -2 and y = 5.

  1. x² + y
  2. -x² + y
  3. 3y - 4x
  4. xy - x³
  5. (y - x)/(x + 3)

Answers.

  1. 4 + 5 = 9.
  2. -4 + 5 = 1.
  3. 15 - (-8) = 23.
  4. (-10) - (-8) = -2.
  5. 7/1 = 7.

If one of yours differs, find the first line where your work and the substitution with parentheses part ways. That line usually reveals a habit worth fixing, such as dropping a sign while copying or squaring before the minus sign was inside the parentheses. The same method will serve you when you check solutions to equations and when you test whether two expressions are equivalent.

Written for 4Algebra with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 35 articles in Variables and Expressions →

Latest news on this topic