Algebra

Order of Operations with Variables

Last updated: March 2026 · Beginner
Real-world applications
⚑
Electrical

Voltage drop, wire sizing, load balancing

πŸ’Š
Nursing

Medication dosages, IV drip rates, vital monitoring

In arithmetic you learned PEMDAS β€” the order in which operations must be performed. In algebra, the same rules apply, but now expressions contain variables (letters that stand for unknown or changeable values). Being able to evaluate these expressions correctly β€” substituting numbers for variables and simplifying in the right order β€” is the gateway skill to every topic that follows.

Quick PEMDAS Review

The order of operations for any mathematical expression is:

  1. P β€” Parentheses (and other grouping symbols: brackets, braces, fraction bars)
  2. E β€” Exponents (and roots)
  3. MD β€” Multiplication and Division, left to right
  4. AS β€” Addition and Subtraction, left to right

Multiplication and division have equal priority β€” work left to right. The same is true for addition and subtraction.

Evaluating Expressions by Substitution

To evaluate an algebraic expression, replace every variable with its given value, then follow PEMDAS to simplify.

Example 1: Evaluate 3x+73x + 7 when x=4x = 4

Step 1 β€” Substitute:

3(4)+73(4) + 7

Step 2 β€” Multiply first (MD before AS):

12+712 + 7

Step 3 β€” Add:

1919

Answer: 1919

Example 2: Evaluate 5a2βˆ’2a+15a^2 - 2a + 1 when a=3a = 3

Step 1 β€” Substitute:

5(3)2βˆ’2(3)+15(3)^2 - 2(3) + 1

Step 2 β€” Exponent first:

5(9)βˆ’2(3)+15(9) - 2(3) + 1

Step 3 β€” Multiply:

45βˆ’6+145 - 6 + 1

Step 4 β€” Add and subtract left to right:

45βˆ’6+1=39+1=4045 - 6 + 1 = 39 + 1 = 40

Answer: 4040

Example 3: Evaluate x+yxβˆ’y\dfrac{x + y}{x - y} when x=10x = 10 and y=4y = 4

A fraction bar acts as a grouping symbol β€” evaluate the numerator and denominator separately before dividing.

Numerator: 10+4=1410 + 4 = 14

Denominator: 10βˆ’4=610 - 4 = 6

146=73\frac{14}{6} = \frac{7}{3}

Answer: 73\dfrac{7}{3}

Nested Grouping Symbols

When parentheses appear inside brackets or braces, work from the innermost grouping outward.

Example 4: Simplify 2[3(x+1)βˆ’4]2[3(x + 1) - 4] when x=5x = 5

Step 1 β€” Innermost parentheses first. Substitute x=5x = 5:

2[3(5+1)βˆ’4]2[3(5 + 1) - 4]

=2[3(6)βˆ’4]= 2[3(6) - 4]

Step 2 β€” Multiply inside the brackets:

=2[18βˆ’4]= 2[18 - 4]

Step 3 β€” Subtract inside the brackets:

=2[14]= 2[14]

Step 4 β€” Multiply:

=28= 28

Answer: 2828

Example 5: Evaluate βˆ’{2[x2βˆ’(3x+1)]}-\{2[x^2 - (3x + 1)]\} when x=4x = 4

Step 1 β€” Innermost parentheses:

3(4)+1=133(4) + 1 = 13

Step 2 β€” Brackets next:

x2βˆ’13=(4)2βˆ’13=16βˆ’13=3x^2 - 13 = (4)^2 - 13 = 16 - 13 = 3

Step 3 β€” Multiply inside braces:

2(3)=62(3) = 6

Step 4 β€” Apply the negative sign (braces):

βˆ’6-6

Answer: βˆ’6-6

The Exponent Trap: βˆ’x2-x^2 vs. (βˆ’x)2(-x)^2

This distinction causes more errors than almost anything else in algebra.

  • βˆ’x2-x^2 means β€œtake xx, square it, then negate.” The exponent applies to xx only.
  • (βˆ’x)2(-x)^2 means β€œnegate xx first, then square the result.” The exponent applies to βˆ’x-x.

Example 6: Evaluate both when x=3x = 3

βˆ’x2=βˆ’(3)2=βˆ’(9)=βˆ’9-x^2 = -(3)^2 = -(9) = -9

(βˆ’x)2=(βˆ’3)2=9(-x)^2 = (-3)^2 = 9

These give different answers. The parentheses make all the difference.

Expressions with Multiple Variables

Many real-world formulas involve two or more variables. The process is the same: substitute all values, then simplify with PEMDAS.

Example 7: Evaluate P=2l+2wP = 2l + 2w when l=15l = 15 and w=8w = 8

P=2(15)+2(8)=30+16=46P = 2(15) + 2(8) = 30 + 16 = 46

Answer: P=46P = 46

This is the perimeter formula for a rectangle β€” you will see it in geometry and in many trades.

Real-World Application: Electrician β€” Ohm’s Law

Electricians use Ohm’s Law constantly:

V=IRV = IR

where VV is voltage (volts), II is current (amps), and RR is resistance (ohms).

Scenario: A circuit has a current of I=3.5I = 3.5 amps flowing through a resistance of R=12R = 12 ohms. Find the voltage.

Step 1 β€” Substitute:

V=(3.5)(12)V = (3.5)(12)

Step 2 β€” Multiply:

V=42V = 42

Answer: The voltage is 4242 volts.

Now suppose two resistors are in series (R1=12R_1 = 12 ohms, R2=8R_2 = 8 ohms). The total voltage is:

V=I(R1+R2)=3.5(12+8)=3.5(20)=70Β voltsV = I(R_1 + R_2) = 3.5(12 + 8) = 3.5(20) = 70 \text{ volts}

Notice the parentheses β€” you must add the resistances before multiplying. Without them, 3.5Γ—12+8=42+8=503.5 \times 12 + 8 = 42 + 8 = 50, which is wrong.

Real-World Application: Nursing β€” Dosage by Weight

Nurses calculate medication dosages using body weight formulas. A common pattern is:

D=WΓ—RCD = \frac{W \times R}{C}

where DD is the dose to administer, WW is the patient’s weight in kilograms, RR is the recommended dose rate (mg per kg), and CC is the concentration of the medication (mg per mL).

Scenario: A patient weighs W=70W = 70 kg. The physician orders R=5R = 5 mg/kg. The medication comes in a concentration of C=50C = 50 mg/mL. Find the volume to administer.

Step 1 β€” Substitute:

D=70Γ—550D = \frac{70 \times 5}{50}

Step 2 β€” Multiply the numerator (grouping symbol β€” fraction bar):

D=35050D = \frac{350}{50}

Step 3 β€” Divide:

D=7Β mLD = 7 \text{ mL}

Answer: Administer 77 mL. The fraction bar acts as a grouping symbol β€” it tells you to evaluate the entire numerator (70Γ—5=35070 \times 5 = 350) before dividing by the denominator. Treating the fraction bar correctly is essential in clinical dosage calculations.

Common Mistakes to Avoid

  1. Forgetting to square before negating. βˆ’42=βˆ’16-4^2 = -16, not 1616. If you want a positive result, write (βˆ’4)2=16(-4)^2 = 16.

  2. Not treating the fraction bar as a grouping symbol. In 8+43\frac{8 + 4}{3}, you must add first: 123=4\frac{12}{3} = 4. Computing 8+438 + \frac{4}{3} is incorrect.

  3. Multiplying before handling inner parentheses. In 2(3+x)2(3 + x), you cannot write 6+x6 + x. Evaluate or simplify inside the parentheses first β€” if xx is known, add it to 3; if xx is unknown, distribute: 6+2x6 + 2x.

  4. Substituting incorrectly for negative values. When x=βˆ’2x = -2 and the expression is x2x^2, write (βˆ’2)2=4(-2)^2 = 4. Dropping the parentheses gives βˆ’22=βˆ’4-2^2 = -4, which is wrong.

  5. Working right to left instead of left to right for equal-priority operations. In 24Γ·4Γ—224 \div 4 \times 2, divide first (left to right): 6Γ—2=126 \times 2 = 12. Working right to left gives 24Γ·8=324 \div 8 = 3, which is incorrect.

Practice Problems

Problem 1: Evaluate 2x+92x + 9 when x=6x = 6

2(6)+9=12+9=212(6) + 9 = 12 + 9 = 21

Answer: 2121

Problem 2: Evaluate 4a2βˆ’3a4a^2 - 3a when a=βˆ’2a = -2

4(βˆ’2)2βˆ’3(βˆ’2)4(-2)^2 - 3(-2)

=4(4)βˆ’(βˆ’6)= 4(4) - (-6)

=16+6=22= 16 + 6 = 22

Answer: 2222

Problem 3: Evaluate 3mβˆ’nm+2n\dfrac{3m - n}{m + 2n} when m=8m = 8 and n=2n = 2

Numerator: 3(8)βˆ’2=24βˆ’2=223(8) - 2 = 24 - 2 = 22

Denominator: 8+2(2)=8+4=128 + 2(2) = 8 + 4 = 12

2212=116\frac{22}{12} = \frac{11}{6}

Answer: 116\dfrac{11}{6}

Problem 4: Evaluate 3[2(xβˆ’4)+5]3[2(x - 4) + 5] when x=7x = 7

Innermost first: 7βˆ’4=37 - 4 = 3

3[2(3)+5]=3[6+5]=3[11]=333[2(3) + 5] = 3[6 + 5] = 3[11] = 33

Answer: 3333

Problem 5: An electrician calculates power with P=I2RP = I^2 R. Find PP when I=4I = 4 amps and R=15R = 15 ohms.

P=(4)2Γ—15=16Γ—15=240P = (4)^2 \times 15 = 16 \times 15 = 240

Answer: P=240P = 240 watts.

Problem 6: Evaluate βˆ’(x+3)2-(x + 3)^2 when x=2x = 2

Step 1 β€” Parentheses: 2+3=52 + 3 = 5

Step 2 β€” Exponent: 52=255^2 = 25

Step 3 β€” Negate: βˆ’25-25

Answer: βˆ’25-25

Problem 7: A nurse uses the formula D=WΓ—RCD = \dfrac{W \times R}{C} with W=55W = 55 kg, R=8R = 8 mg/kg, and C=40C = 40 mg/mL. Find DD.

D=55Γ—840=44040=11D = \frac{55 \times 8}{40} = \frac{440}{40} = 11

Answer: Administer 1111 mL.

Key Takeaways

  • PEMDAS applies to algebraic expressions exactly the same way it applies to numeric ones
  • To evaluate an expression, substitute the given values for every variable, then simplify step by step
  • A fraction bar is a grouping symbol β€” evaluate the top and bottom separately before dividing
  • Work innermost grouping symbols first when parentheses are nested inside brackets or braces
  • Watch the critical difference between βˆ’x2-x^2 (negative) and (βˆ’x)2(-x)^2 (positive when xx is positive)
  • Always wrap negative substitutions in parentheses to avoid sign errors
  • Getting the order of operations right in real-world formulas (Ohm’s Law, dosage calculations) is not just a math skill β€” it is a safety issue

Return to Algebra for more topics in this section.

Last updated: March 29, 2026