Quarry School

Evaluate formulas one number at a time

Subject: MathematicsLeans on: Order of operationsLeans on: Signed arithmeticLeans on: SubstitutionLeans on: Composition orderLeans on: Input-slot names
Level 1 · FoundationsAbout 10 min read6 new terms
How this was estimated

Programmatic estimate. Rung levels, worked steps, prerequisites, terms and sentence length contribute to this level. It describes the lesson, not your ability.

Reading counts the whole lesson, including folded explanations, at 180 words a minute. Practice allows two minutes per item. These are planning assumptions; take the time you need.

AI estimate unavailable.

Path to here

Open the unit’s lesson list to follow the lesson order.

    Quick review (2 minutes)

    In plain words

    Keep two recipe cards on a counter.

    Rule

    For f(h(a)), calculate h(a) first; then substitute that entire numerical answer into every input slot of f.
    The input-variable letter does not change the instructions.

    Step

    1. 1. Expand circle notation into parentheses if needed.

    2. 2. Copy the inner formula and replace every input letter with the original number, using parentheses for negative numbers.

    3. 3. Complete that arithmetic and write the intermediate output.

    4. 4. Copy the outer formula and replace every input letter with that output.

    5. 5. Complete the arithmetic and check by substituting into a combined formula.

    Question

    Let f(t) = t2 − t and h(x) = 3x + 2. Find f(h(1)) and h(f(1)). You start at 1 and want the final output in each order. Plan: finish the inner arithmetic, then insert its answer into every outer slot. The input letters t and x are slot names; their difference does not change the method.

    Answer

    f(h(1)) = 20.
    h(f(1)) = 2.

    Trap

    Replacing only the squared input in t2 − t. The same input goes into both positions, so f(5) is 52 − 5.

    Strategy

    1. 1. Expand circle notation into parentheses if needed.

    2. 2. Copy the inner formula and replace every input letter with the original number, using parentheses for negative numbers.

    3. 3. Complete that arithmetic and write the intermediate output.

    4. 4. Copy the outer formula and replace every input letter with that output.

    5. 5. Complete the arithmetic and check by substituting into a combined formula.

    Term

    Function

    Definition

    A rule that gives exactly one output for each input it accepts.

    Term

    Input

    Definition

    The starting value you give a function. It goes inside the parentheses in function notation.

    Term

    Output

    Definition

    The answer a function produces from an accepted input.

    Term

    Evaluate

    Definition

    Find the output of a function or the value of an expression for a given input.

    Term

    Undefined

    Definition

    Having no permitted output under the rule being used, as with division by zero or a negative real square-root radicand.

    Term

    Inner function

    Definition

    The function evaluated first in a composition. Its output becomes the next function's input.

    Term

    Substitution

    Definition

    Replacing a variable with a number or expression everywhere that variable appears. Parentheses hold a multi-term replacement together.

    Term

    Formula

    Definition

    A written rule using numbers, symbols, and operations to describe how a quantity is calculated.

    Term

    Variable

    Definition

    A symbol that stands for a number or quantity. Its value may change or may be the unknown you need to find.

    Term

    Denominator

    Definition

    The bottom of a fraction. It names the divisor and cannot be zero.

    Term

    Order of operations

    Definition

    The agreed calculation order: parentheses, exponents, multiplication and division left to right, then addition and subtraction left to right.

    Term

    Fraction

    Definition

    One number divided by another nonzero number. The top is divided by the bottom; equal pieces give a picture of its size.

    Term

    Intermediate answer

    Definition

    The in-between output of the first function, which becomes the next function’s input.

    Term

    Linear

    Definition

    A formula built from a constant times the input plus a constant. Its graph is a straight line.

    1 In plain words

    Keep two recipe cards on a counter. For a composition, follow the inner recipe first, write its answer, and then use that answer in the outer recipe. A formula is a recipe written with letters. Each input letter labels a place to insert a value. The names x, t, and u can label the same place. For example, f(u) = u and f(x) = x describe the same root recipe. Using u for an outer input helps you keep it separate from the x inside another formula. The function name tells you which recipe to use; the letter inside the parentheses tells you where its input belongs.

    2 Picture it

    ahffirstsecondh(a)f(h(a))
    Each stage uses the result of the preceding stage.

    Reminder

    Reminder: Order of operations, Signed arithmetic, Substitution, Composition order, Input-slot names
    • Order of operations. Square before subtracting: 52 − 5 = 25 − 5 = 20.
    • Signed arithmetic. (−4)2 = 16 and 16 − (−4) = 20.
    • Substitution. Both slots in t2 − t receive the same number: f(5) = 52 − 5.
    • Composition order. f(h(1)) starts with h(1), not f(1).
    • Input-slot names. h(x) = 3x + 2 and h(t) = 3t + 2 both say multiply the input by 3 and add 2. They define the same function.

    3 Why

    A variable in a function formula marks where an input will be inserted. Its name can change without changing the function's instructions. For example, t2 − t and u2 − u both say to square the input and subtract that same input. A composition specifies two substitutions: the original number fills the inner slots, and its resulting output fills every outer slot. Doing the arithmetic after each substitution follows exactly the function-machine definition and makes mistakes easier to locate.

    4 The rule

    For f(h(a)), calculate h(a) first; then substitute that entire numerical answer into every input slot of f.

    The input-variable letter does not change the instructions.

    The same idea, five ways

    Say it

    f of h of one

    Write it

    Put 1 into h’s formula, then put its resulting number into f’s formula.

    In math
    • h(x) = 3x + 2
    • f(t)=t2−t
    • f(h(1)) = f(5) = 20
    Like

    The first recipe makes the ingredient measured into the second recipe.

    See it
    1h: 3x + 2f: t² − tfirstsecond520
    The input letters differ, but the same number still fills every input place at each stage.

    The same idea, other ways

    As two recipe cards

    Finish the first recipe before beginning the second. A finished intermediate value becomes the ingredient measured into the second recipe.

    1triple, add 2f: t² − tfirstsecond520
    The second recipe receives 5 rather than the original 1.
    As labeled blanks

    f(t) = t2 − t has two blanks holding the same input. At input 5 the blanks become 52 − 5. Calling the blanks u would not change either operation.

    f(t)=t2−t

    f(u)=u2−u

    f(5)=52−5=20

    Part 1: Number into the inner formula

    First evaluate the formula closest to the starting number. A zero intermediate answer is allowed unless the next function rejects zero.

    • h(1) = 5 for h(x) = 3x + 2.
    • The intermediate answer is a complete input for the next function.
    1h: 3x + 2inputoutput5
    The inner formula completes its arithmetic before the handoff.

    Worked example

    A first-stage negative input

    With h(x) = 3x + 2, evaluate h(−2). The input is −2; find the first-stage output. Plan: substitute the entire signed number in parentheses, then multiply before adding.

    Show the steps and the answer
    −23x + 2inputoutput−4
    The minus sign stays with the input.
    1. h(−2)=3(−2)+2.Replace the input letter with −2 and keep its sign inside parentheses.
    2. =−6+2=−4.A positive times a negative is negative, and adding 2 moves two steps toward zero.
    Answer
    h(−2)=−4.
    Double-check Undo the recipe: (−4 − 2) ÷ 3 = −6 ÷ 3 = −2, the starting input.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: h(−2)=3−2+2=3.
    The 3 beside x means multiplication by the whole input, rather than adding 3 to it.
    ✓ Instead: h(−2)=3(−2)+2=−6+2=−4.

    Tips and tricks

    • Keep a negative input inside parentheses until multiplication is complete.

    Part 2: Intermediate answer into the outer formula

    The outer recipe receives a new input. Insert that input in every position, even when it is negative. Parentheses show that the square acts on the negative number itself.

    • f(−4)=(−4)2−(−4).
    • The square happens before the subtraction.
    −4f: t² − tinputoutput20
    Subtracting the negative input adds 4 after the square.

    Worked example

    Finish a negative intermediate path

    For f(t) = t2 − t and h(x) = 3x + 2, find f(h(−2)). You want both stages completed. Plan: compute h(−2) = −4, then replace both t slots in f with that entire signed answer.

    Show the steps and the answer
    −2hffirstsecond−420
    −2 goes into h, then −4 into f: 20.
    1. h(−2)=−4, so f(h(−2))=f(−4).The inner output becomes the outer input.
    2. f(−4)=(−4)2−(−4)=16+4=20.A negative squared is positive, and subtracting a negative adds its opposite.
    Answer
    f(h(−2))=20.
    Double-check The combined expression at −2 is (3(−2) + 2)2 − (3(−2) + 2) = (−4)2 − (−4) = 20.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: f(−4)=(−4)2−4=12.
    The second input slot also receives −4. Writing +4 in that slot changes the input.
    ✓ Instead: f(−4)=(−4)2−(−4)=16+4=20.

    Tips and tricks

    • Circle every occurrence of the outer input letter before substituting.

    5 How

    1. Expand circle notation into parentheses if needed.
    2. Copy the inner formula and replace every input letter with the original number, using parentheses for negative numbers.
    3. Complete that arithmetic and write the intermediate output.
    4. Copy the outer formula and replace every input letter with that output.
    5. Complete the arithmetic and check by substituting into a combined formula.

    Evaluate formulas at a numerical input

    1
    Is the inserted number negative?
    YesUse parentheses around the entire number, including its minus sign.
    NoInsert the whole number in every input place.
    ↓
    2
    Does the outer formula have more than one input place?
    YesReplace every occurrence with the same in-between answer.
    NoReplace its one input place, then carry out the arithmetic.
    ↓
    3
    Is a denominator zero or an even-root inside negative after substitution?
    YesThat stage is undefined, so the composition has no value at this start.
    NoComplete the arithmetic and continue to the next stage.
    1. Expand circle notation into parentheses if needed.
    2. Copy the inner formula and replace every input letter with the original number, using parentheses for negative numbers.
    3. Complete that arithmetic and write the intermediate output.
    4. Copy the outer formula and replace every input letter with that output.
    5. Complete the arithmetic and check by substituting into a combined formula.

    6 Worked example

    Worked example

    Both orders at input 1

    OpenStax problem

    Let f(t) = t2 − t and h(x) = 3x + 2. Find f(h(1)) and h(f(1)). You start at 1 and want the final output in each order. Plan: finish the inner arithmetic, then insert its answer into every outer slot. The input letters t and x are slot names; their difference does not change the method.

    Show the steps and the answer
    1h: 3x + 2f(t) = t² − tfirstsecond520
    1 goes into h: 3x + 2, then 5 into f(t) = t2 − t: 20.
    1f(t) = t² − th: 3x + 2firstsecond02
    1 goes into f(t) = t2 − t, then 0 into h: 3x + 2: 2.
    1. For f(h(1)), start with h(1)=3×1+2=5.h is the inner function for this order.
    2. f(h(1))=f(5)=52−5=25−5=20.The output 5 replaces both occurrences of t in f.
    3. For h(f(1)), start with f(1)=12−1=1−1=0.f is the inner function for the reversed order.
    4. h(f(1))=h(0)=3×0+2=2.The intermediate output 0 is a valid numerical input to h.
    Answer
    • f(h(1)) = 20.
    • h(f(1)) = 2.
    Double-check Using the combined formulas with one starting letter gives f(h(x)) = (3x + 2)2 − (3x + 2), which gives 25 − 5 = 20 at x = 1. The reversed formula h(f(t)) = 3(t2 − t) + 2 gives 0 + 2 = 2 at t = 1. Different input-slot letters describe the same instructions.

    Ladder: from easy to exam-hard

    Try each rung before you open its steps.

    Rung 1 of 4

    One slot in each formula

    Let g(x) = x + 1 and f(x) = 2x. Find (f ∘ g)(2). The input is 2; add 1 first, then use that answer as the input to the doubling function. Plan: finish g first, then carry its whole answer into f.

    Show the steps and the answer
    2g: add 1f: doublefirstsecond36
    The 3 coming out of g goes into f.
    1. (f∘g)(2)=f(g(2)).The circle means composition, so g is the inner function.
    2. g(2)=2+1=3.The original input goes into g first.
    3. f(g(2))=f(3)=2×3=6.The output 3 from g is the input to f.
    Answer
    (f ∘ g)(2) = 6.
    Double-check Combining the rules gives f(g(x)) = 2(x + 1); at 2 this is 2(2 + 1) = 6. The separate product at 2 is f(2)g(2) = 4 × 3 = 12, confirming that the two operations differ.

    Rung 2 of 4

    Fill every outer slot and reverse the order

    Let f(t) = t2 − t and h(x) = 3x + 2. Find f(h(1)) and h(f(1)). You start at 1 and want the final output in each order. Plan: finish the inner arithmetic, then insert its answer into every outer slot. The input letters t and x are slot names; their difference does not change the method.

    Show the steps and the answer
    1h: 3x + 2f(t) = t² − tfirstsecond520
    The same picture again: 1 goes into h: 3x + 2, then 5 into f(t) = t2 − t: 20.
    1f(t) = t² − th: 3x + 2firstsecond02
    The same picture again: 1 goes into f(t) = t2 − t, then 0 into h: 3x + 2: 2.
    1. For f(h(1)), start with h(1)=3×1+2=5.h is the inner function for this order.
    2. f(h(1))=f(5)=52−5=25−5=20.The output 5 replaces both occurrences of t in f.
    3. For h(f(1)), start with f(1)=12−1=1−1=0.f is the inner function for the reversed order.
    4. h(f(1))=h(0)=3×0+2=2.The intermediate output 0 is a valid numerical input to h.
    Answer
    • f(h(1)) = 20.
    • h(f(1)) = 2.
    Double-check Using the combined formulas with one starting letter gives f(h(x)) = (3x + 2)2 − (3x + 2), which gives 25 − 5 = 20 at x = 1. The reversed formula h(f(t)) = 3(t2 − t) + 2 gives 0 + 2 = 2 at t = 1. Different input-slot letters describe the same instructions.

    Rung 3 of 4

    Carry a negative output

    For f(t) = t2 − t and h(x) = 3x + 2, find f(h(−2)). You want both stages completed. Plan: compute h(−2) = −4, then replace both t slots in f with that entire signed answer.

    Show the steps and the answer
    −2hffirstsecond−420
    The same picture again: −2 goes into h, then −4 into f: 20.
    1. h(−2)=3(−2)+2=−6+2=−4, so f(h(−2))=f(−4).The inner output becomes the outer input.
    2. f(−4)=(−4)2−(−4)=16+4=20.A negative squared is positive, and subtracting a negative adds its opposite.
    Answer
    f(h(−2))=20.
    Double-check The combined expression at −2 is (3(−2) + 2)2 − (3(−2) + 2) = (−4)2 − (−4) = 20.

    Rung 4 of 4

    A fractional final answer

    Let q(x) = 2x + 3 and p(u) = u+2u−2. Find p(q(1)). You start with 1 and want the output after the linear rule and then the fraction rule. Plan: compute q(1), replace both outer u slots with that answer, and divide only after computing the whole top and bottom.

    Show the steps and the answer
    1q: 2x + 3p: (u + 2)/(u− 2)firstsecond57/3
    The first answer 5 fills both input places of the outer fraction.
    1. q(1)=2×1+3=5.The inner formula acts first, with multiplication before addition.
    2. p(q(1))=p(5)=5+25−2.Both u slots receive the same whole inner answer 5.
    3. 5+2=7 and 5−2=3, so p(q(1))=73.The top and bottom must each be completed before division; the bottom 3 is nonzero.
    Answer
    p(q(1))=73.
    Double-check Substitute directly into the combined expression: (2×1+3)+2(2×1+3)−2 = 73. Multiplying the answer by the bottom gives 73 × 3 = 7, the original top.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: f(−4)=−42−4=−20.
    This drops the input's parentheses and also changes the second input's sign. −42 means the opposite of 42, while (−4)2 squares the whole input.
    ✓ Instead: f(−4)=(−4)2−(−4)=16+4=20.

    Tips and tricks

    • Write the intermediate output on its own line before the outer substitution.
    • Name the function before reading its formula. The letters inside formulas can be different and still represent input slots.
    • Know cold: one line per function, inner first. The output of the first line is the input of the second.

    7 The trap

    Replacing only the squared input in t2 − t. The same input goes into both positions, so f(5) is 52 − 5.

    Problems marked OpenStax come from Precalculus 2e by Jay Abramson, published by OpenStax, under the CC BY-NC-SA 4.0 licence. Access for free at https://openstax.org/books/precalculus-2e/pages/1-introduction-to-functions.