Substitute the whole inside expression
Quick review (2 minutes)
Before filling a form with letters, run the two machines with numbers.
To form f(g(x)), replace every input-variable occurrence in f with the whole parenthesized expression g(x).
(a + b = + 2ab + , because (a + b)(a + b) has two cross products ab.
1. Copy the outer formula and identify every input slot.
2. Write the complete inner formula in parentheses in every slot.
3. Keep powers outside those parentheses so they act on the entire input.
4. Expand with distribution. For a square, multiply the two identical parentheses and keep both cross products.
5. Combine like terms, preserve any domain restrictions, and check a small allowed input by the two-stage route.
Let f(x) = − 6 and g(x) = 3x + 2. Find (f ∘ g)(x) and (g ∘ f)(x). You want one formula for each order. Plan: put the complete inner formula into the outer input place, multiply out any square using four products, and collect matching terms.
(f ∘ g)(x) = 9 + 12x − 2.
(g ∘ f)(x) = 3 − 16.
Both domains are all real numbers.
Writing (2x + 1 = 4 + 1. The square multiplies two whole sums, so the two cross products must appear.
1. Copy the outer formula and identify every input slot.
2. Write the complete inner formula in parentheses in every slot.
3. Keep powers outside those parentheses so they act on the entire input.
4. Expand with distribution. For a square, multiply the two identical parentheses and keep both cross products.
5. Combine like terms, preserve any domain restrictions, and check a small allowed input by the two-stage route.
Function
A rule that gives exactly one output for each input it accepts.
Input
The starting value you give a function. It goes inside the parentheses in function notation.
Output
The answer a function produces from an accepted input.
Domain
All inputs for which a function is defined.
Outer function
The function evaluated second in a two-function composition. It receives the inner function's output.
Substitution
Replacing a variable with a number or expression everywhere that variable appears. Parentheses hold a multi-term replacement together.
Reciprocal
One divided by a nonzero number. A fraction's reciprocal swaps its top and bottom, and their product is 1.
Formula
A written rule using numbers, symbols, and operations to describe how a quantity is calculated.
Variable
A symbol that stands for a number or quantity. Its value may change or may be the unknown you need to find.
Denominator
The bottom of a fraction. It names the divisor and cannot be zero.
Factor
One of the quantities multiplied together in a product.
Fraction
One number divided by another nonzero number. The top is divided by the bottom; equal pieces give a picture of its size.
Exponent
A raised number indicating a power. A positive whole-number exponent counts how many copies of the input are multiplied together.
Linear
A formula built from a constant times the input plus a constant. Its graph is a straight line.
Solve
Find every input that makes a stated equality or inequality true. This differs from evaluating at a given input.
Like terms
Terms with the same variable part and powers. Their number factors can be added or subtracted.
Distribute
Multiply each term inside parentheses by the outside factor.
Equation
A statement that two expressions have equal values.
1 In plain words
Before filling a form with letters, run the two machines with numbers. Let g multiply by 3 and add 2, and let f square its input and subtract 6. Input 0 goes to 2 and then −2. Input 1 goes to 5 and then 19. Input 2 goes to 8 and then 58. A formula records all these trips at once. Each input letter in the outer rule is a blank on the form. Put the whole inner expression into every blank. Parentheses hold its pieces together until you multiply and combine them. This replacement is substitution. You can run the same rule twice or connect three rules with the same method.
2 Picture it
Reminder
Reminder: Distribution, Expanding a square, Subtracting a package, Like terms, Nonzero denominator, Composition order, Multiplying powers
- Distribution. 2(x − 4) = 2x − 8, because the factor multiplies both terms.
- Expanding a square.
- Subtracting a package.
- Like terms. 2x + 2x = 4x, while and x are different kinds of terms.
- Nonzero denominator. 2x − 1 ≠ 0 means x ≠ .
- Composition order. f(g(x)) replaces the input slots in f with g(x), not the other way around.
- Multiplying powers. x × = x × (x × x) = . The exponent counts three multiplied copies of x.
3 Why
A formula describes what to do to its input, regardless of whether the input is a number or an expression. If f squares its input, then f(g(x)) must square all of g(x). Squaring a sum multiplies the sum by itself, creating middle terms as well as squares. Those terms come from distributing each part across the other package. Parentheses preserve the intended input until this multiplication is finished, so they prevent lost signs and missing terms.
4 The rule
To form f(g(x)), replace every input-variable occurrence in f with the whole parenthesized expression g(x).
, because has two cross products ab.
The same idea, five ways
f of g of x; replace every outer input with the whole inner expression
The outer formula acts on the entire expression produced by the inner formula.
- f(u) = − 6: u is the outer input place
Put the same wrapped package into every blank on a form.
The same idea, other ways
The outer formula − x has two boxes. If the inner output is x + 2, fill both boxes with that package: (x + 2 − (x + 2).
f(input) = (input − (input)
Input = x + 2
Parentheses are the wrapper. A square outside the wrapper applies to every part of the input. A minus outside the wrapper subtracts every part.
Square the package: (x + 2
Subtract the package: −(x + 2)
Squaring 3x + 2 places that same group along both rectangle sides. Four products fill it: 9, 6x, 6x, and 4. Both middle rectangles contribute, so their total is 12x.
At x = 1, the inner expression 3x + 2 gives 5, whose square is 25. The expansion gives 9 + 12 + 4 = 25. Dropping the middle term gives 13, so this test catches that mistake.
Part 1: A linear outside formula
If the outer function multiplies its input by a number, that number multiplies the whole inner expression. Put in the package first, then distribute.
- For f(x) = 3x and g(x) = x − 4, f(g(x)) = 3(x − 4).
Worked example
Triple the whole inside
Let f(x) = 3x and g(x) = x − 4. Find f(g(x)). You want to triple the entire g output. Plan: wrap the inner expression in parentheses in every outer input place, then distribute and collect matching terms.
Show the steps and the answer
- .The outer input slot receives x − 4.
- .3 multiplies x and −4.
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- Draw one multiplication arrow from the outside factor to each term inside.
Part 2: A square outside formula
A square means multiplying the input by itself. If the input is a sum, both copies of the whole sum must be multiplied. The middle term comes from two cross products.
- A square does not distribute over addition.
Worked example
A first square composition
Let f(x) = and g(x) = x + 1. Find f(g(x)). You want to square the complete inner output. Plan: wrap the inner expression in parentheses in every outer input place, then distribute and collect matching terms.
Show the steps and the answer
- .Squaring multiplies the whole input by itself.
- .The four products include two matching middle terms.
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- Multiply two written copies if the square formula is hard to remember.
Part 3: A fraction outside formula
A fraction's denominator may also contain an input slot. Replace that slot with the complete inner expression. Then check when the new denominator would be zero.
- For f(x) = , f(g(x)) = .
- The original and intermediate restrictions still matter; the next lesson develops both gates.
g(x) = 3x + 1
Require x ≠
Worked example
A linear output enters a denominator
Let f(x) = and g(x) = 3x + 1. Find f(g(x)). You want to subtract 2 from the g output, then take the reciprocal. Plan: wrap the inner expression in parentheses in every outer input place, then distribute and collect matching terms.
Show the steps and the answer
- .The whole inner expression replaces x in the denominator.
- .The constants 1 − 2 combine to −1.
- Find the forbidden starting input by solving : add 1 to get , then divide by 3 to get . Check: . Exclude that input.This finds and confirms the one start that makes the new denominator zero. The inner linear function itself accepts every real input.
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- Copy the entire fraction first, then replace its input places.
Part 4: Compose a function with itself
A machine can send its answer back through the same rule. The second trip uses the first answer as its input. In j(j(x)), the two j names mean two separate applications of the same instructions. This operation is different from multiplying the first answer by itself.
- (j ∘ j)(x) = j(j(x)).
- j(j(x)) uses the output as a new input; j(x squares the output instead.
Worked example
The same formula can receive its own output
Let j(x) = 4x + 5. Find j(j(x)) and its value at x = 1. You run j twice, using a new input the second time. Plan: put the whole first output 4x + 5 into j, distribute 4, and check with two separate number evaluations.
Show the steps and the answer
- .The outer copy of j receives 4x + 5 as its whole input.
- .Distribution multiplies both inner terms by 4, then combines the added constants.
- At .The composed formula gives the final output for starting input 1.
- j(j(x)) = 16x + 25.
- j(j(1)) = 41.
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- Know cold: same name means same instructions again, with a new input.
Part 5: Connect three functions
Think of three stations in a kitchen. The first prepares something for the second, and the second prepares something for the third. In p(q(v(x))), v acts first, q second, and p last. Each completed answer replaces the next input. More functions mean more stages, while the inside-first method stays the same.
- p(q(v(x))) runs v, then q, then p.
- A chain is defined only when every stage accepts the answer handed to it.
Worked example
Connect three formulas in order
Let v(x) = x + 3, q(x) = , and p(x) = 2x − 7. Find p(q(v(2))) and p(q(v(x))). You run three jobs, starting with the deepest parentheses. Plan: add 3, square the result, then double and subtract 7.
Show the steps and the answer
- .v touches the starting input, so it acts first.
- .The output 5 is now the input to the square.
- .The final rule receives 25, rather than the original 2.
- .The inner expression is squared in full and handed to the last rule.
- .All four products belong to the square.
- .The outside factor multiplies each term, then the constants combine.
- p(q(v(2))) = 43.
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- Write one line for every function, starting with the innermost parentheses.
5 How
- Copy the outer formula and identify every input slot.
- Write the complete inner formula in parentheses in every slot.
- Keep powers outside those parentheses so they act on the entire input.
- Expand with distribution. For a square, multiply the two identical parentheses and keep both cross products.
- Combine like terms, preserve any domain restrictions, and check a small allowed input by the two-stage route.
Build one formula for a composition
- Copy the outer formula and identify every input slot.
- Write the complete inner formula in parentheses in every slot.
- Keep powers outside those parentheses so they act on the entire input.
- Expand with distribution. For a square, multiply the two identical parentheses and keep both cross products.
- Combine like terms, preserve any domain restrictions, and check a small allowed input by the two-stage route.
6 Worked example
Worked example
A square makes the middle term
Let f(x) = − 6 and g(x) = 3x + 2. Find (f ∘ g)(x) and (g ∘ f)(x). You want one formula for each order. Plan: put the complete inner formula into the outer input place, multiply out any square using four products, and collect matching terms.
Show the steps and the answer
- .The outer f squares its whole input before subtracting 6.
- .Each of the two terms in one copy multiplies each term in the other copy.
- .The two middle products add to 12x, and 4 − 6 = −2.
- .Now g multiplies f’s entire output by 3 and adds 2.
- .The factor 3 multiplies both and −6, then −18 + 2 = −16.
- Both domains are all real numbers.
Ladder: from easy to exam-hard
Try each rung before you open its steps.
Rung 1 of 7
A constant inner answer
Let g(x) = 4 and f(x) = x + 1. Find f(g(x)). Whatever input you start with, the first machine returns 4. Plan: wrap the inner expression in parentheses in every outer input place, then distribute and collect matching terms.
Show the steps and the answer
- .The inner output is always 4.
- .The outer function adds 1 to its input.
Rung 2 of 7
Distribute over an inner line
Let f(x) = 2x + 3 and g(x) = x − 4. Find f(g(x)). You want to double the complete inner answer and add 3. Plan: wrap the inner expression in parentheses in every outer input place, then distribute and collect matching terms.
Show the steps and the answer
- .x − 4 replaces the outer input slot.
- .Distribute 2 and then combine the constants.
Rung 3 of 7
Fill repeated slots
Let f(x) = − x and g(x) = x + 2. Find f(g(x)). You must use the whole g output twice. Plan: wrap the inner expression in parentheses in every outer input place, then distribute and collect matching terms.
Show the steps and the answer
- .Both occurrences of the outer input receive x + 2.
- .Multiplying the square produces four terms, and subtracting the last package changes both signs.
- .4x − x = 3x and 4 − 2 = 2.
Rung 4 of 7
A square with a negative term
Let f(x) = + 1 and g(x) = 3x − 2. Find f(g(x)). You want to square the whole difference and then add 1. Plan: wrap the inner expression in parentheses in every outer input place, then distribute and collect matching terms.
Show the steps and the answer
- .The square acts on all of g's output.
- .Each cross product contains one negative factor, while (−2)(−2) is positive.
- .The cross products add to −12x and 4 + 1 = 5.
Rung 5 of 7
Slots on both sides of a fraction
Let f(x) = and g(x) = 2x. Find f(g(x)). You replace the input on both top and bottom. Plan: put 2x into both places, then find the starting input that makes the entire denominator zero.
Show the steps and the answer
- .Each x slot in f receives the full expression 2x.
- Solve to locate the forbidden input: , so . Plug it back in: . Exclude .The denominator must not be zero. This equation finds the starting input at which that failure would occur; g itself has no restrictions.
Rung 6 of 7
The same function twice
Let j(x) = 4x + 5. Find j(j(x)) and its value at x = 1. You run j twice, using a new input the second time. Plan: put the whole first output 4x + 5 into j, distribute 4, and check with two separate number evaluations.
Show the steps and the answer
- .The outer copy of j receives 4x + 5 as its whole input.
- .Distribution multiplies both inner terms by 4, then combines the added constants.
- At .The composed formula gives the final output for starting input 1.
- j(j(x)) = 16x + 25.
- j(j(1)) = 41.
Rung 7 of 7
A three-stage symbolic chain
Let v(x) = x + 3, q(x) = , and p(x) = 2x − 7. Find p(q(v(2))) and p(q(v(x))). You run three jobs, starting with the deepest parentheses. Plan: add 3, square the result, then double and subtract 7.
Show the steps and the answer
- .v touches the starting input, so it acts first.
- .The output 5 is now the input to the square.
- .The final rule receives 25, rather than the original 2.
- .The inner expression is squared in full and handed to the last rule.
- .All four products belong to the square.
- .The outside factor multiplies each term, then the constants combine.
- p(q(v(2))) = 43.
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- Know cold: every slot gets the whole package. Circle each input-variable occurrence before replacing it.
- Understand, then rebuild: the expanded formula. Parentheses and distribution can recreate it; memorizing the numbers in front of its variable terms is unnecessary.
- Use x = 1 to check for a missing middle term. At x = 0 that term becomes zero and may hide the error.
7 The trap
Writing (2x + 1 = 4 + 1. The square multiplies two whole sums, so the two cross products must appear.