Composition of functions: crash course
about 15 min to listen10 lessons16 questions to tryUnit 4 of 17
Short view. Each lesson's rule, its steps and its trap. Switch to Full for a worked example and a question to try in every lesson.Full view. Each lesson's rule, its steps, one worked example with Watch it solved, the trap, and one question to try.
You need first
1 Combine two functions with arithmetic
The rule
; ; (fg); .
Use inputs allowed by both functions; for the quotient also require .
How
- Find the requested operation and its order. g − f means the g answer minus the f answer.
- Use the same input in both original functions, because their outputs must refer to the same starting value.
- Record where both formulas work and, for division, where the bottom output is nonzero.
- Put each whole expression in parentheses before combining it. Simplify while keeping every original domain restriction.
- Check one permitted input directly in the original functions.
Worked example
Worked example
The same input, four different combinations
Let f(x) = x + 1 and g(x) = 2x. Find their sum, difference f − g, product, and quotient f divided by g at input 2. The question asks you to get both outputs at 2, then combine those outputs in four ways. Plan: evaluate both functions at the same input 2, combine their outputs in four ways, then derive the four combined formulas.
Show the steps and the answer
Same input: 2
f(2) = 3; g(2) = 4
- and .Both functions receive input 2, so both answers describe that same input.
- .The sum adds the two outputs.
- .The written order puts the f output first.
- (fg).The product multiplies the outputs.
- .The quotient divides the f output by the nonzero g output.
- As formulas, and .Only matching x terms combine; the written subtraction order stays fixed.
- (fg), and , requiring .Distribution multiplies both terms. The quotient removes the input 0 that makes 2x zero.
- Sum: 7.
- Difference: −1.
- Product: 12.
- Quotient: .
The trap
Subtracting only the first term of a function. ( − 1) − (x − 1) subtracts the entire second expression, so both of its signs change.
Quick check
Try it before you open its steps. It is question 3 of 6 in the full lesson, where they run from easy to exam-hard.
Try it · level 3 of 6
Factor a difference of squares
Rewrite − 16 as a product. You want two factors whose multiplication recreates the original expression. Plan: recognize − , use the difference and sum of x and 4, then multiply to check.
Show the steps and the answer
- , so .This is a difference of two squares.
- .Expanding gives + 4x − 4x − 16; the middle terms cancel.
2 Composition passes one answer into the next function
The rule
.
First apply g, then apply f to g's output.
The product (fg) is a different operation.
How
- Rewrite the circle notation as nested parentheses, meaning one pair of parentheses inside another: (f ∘ g)(x) = f(g(x)).
- Name the inner function, which touches the original input.
- Evaluate that function and write its output as a separate intermediate, or in-between, answer.
- Put that whole intermediate answer into the outer function.
- Check the path: original input, inner output, final output.
Worked example
Worked example
Add 1, then double
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
- .The circle means composition, so g is the inner function.
- .The original input goes into g first.
- .The output 3 from g is the input to f.
The trap
Starting with f because its name appears first. In f ∘ g, g receives the original input. Expand the circle notation before calculating.
3 Order changes the result, and units must fit
The rule
Usually as functions.
Check both orders rather than assuming equality.
For a meaningful composition, the inner output must be an acceptable outer input, including its units.
How
- For each order, identify the function nearest the original input.
- Evaluate or substitute that inner function into the other function.
- Compare the resulting formulas and their domains. A different answer at one allowed input proves the functions differ.
- For an application, label the starting input, intermediate output, and final output with units.
- Check that the intermediate unit matches the outer function's expected input unit.
Worked example
Worked example
Two orders of composition, and a unit check for fuel use
(a) Let f(x) = 2x + 5 and g(x) = . Find f(g(x)) and g(f(x)). Decide whether they are the same function. (b) A delivery van drives at a steady speed, so the distance it covers in t hours is D(t) = 60t miles. The van uses fuel according to G(d) = gallons for d miles driven. Find the meaningful composition that gives gallons used after t hours, and evaluate it at t = 3. Explain why the other order, D(G(d)), is not meaningful.
Show the steps and the answer
- For f(g(x)), the inner function is g, because it acts on x first. For g(f(x)), the inner function is f.In a composition, the function written nearest the input is applied first.
- Substitute g(x) = into f: .f doubles its input and adds 5, and here its input is .
- Substitute f(x) = 2x + 5 into g: .g squares its input, and here its input is the whole expression 2x + 5.
- Compare the two results at . and . Both functions have domain all real numbers.A single allowed input that gives different outputs proves the functions are different.
- In part (b), label the units. For D, the input t is in hours and the output is in miles. For G, the input d is in miles and the output is in gallons.A composition is meaningful only if the inner output can be used as the outer input.
- Use the order G(D(t)). The chain is t hours miles gallons. So gallons.D gives miles, and miles is the unit G expects as its input.
- Evaluate at . miles, and gallons.First find the intermediate output, then feed it into the outer function.
- Check the order D(G(d)). G(d) gives gallons, but D expects an input in hours.The intermediate unit (gallons) does not match the input unit D expects (hours), so this composition has no real-world meaning.
Work to write
- f(g(1)) = 7 ≠ 49 = g(f(1)), so f∘g ≠ g∘f
- t (hours) → D(t) (miles) → G(D(t)) (gallons)
- G(D(3)) = 6 gallons
- D(G(d)) is not meaningful: G outputs gallons, but D needs hours
The trap
Treating a valid arithmetic calculation as proof that an application makes sense. Label the units as well as the numbers.
4 Follow a composition through tables
The rule
To evaluate f(g(a)) from tables, read g(a), then use that output as the input for the f lookup.
A composition is defined only when both lookups exist.
How
- Read the nested notation and choose the inner table.
- Find the column labeled with the original input in that table.
- Read its output and write it as the intermediate value.
- Find that value among the input labels of the outer table, which may be a different column.
- Read the outer output. If either required input is absent from a complete table, the composition is undefined there.
Worked example
Worked example
Both orders from the tables at input 3
The two pictures list every input accepted by f and g. Find f(g(3)) and g(f(3)). You start at input 3 and find the final output in each order. Plan: read the inner table first, write its answer, and use that answer as an input in the outer table.
Show the steps and the answer
- For f(g(3)), read the column under 3 in the g picture: .g is the inner function in this expression.
- Move to the column under 2 in the f picture: .The intermediate answer 2 becomes the outer input.
- For g(f(3)), read the column under 3 in the f picture: .The reversed composition starts with f.
- Move to the column under 3 in the g picture: .The intermediate answer happened to equal the original input this time.
- f(g(3)) = 8.
- g(f(3)) = 2.
The trap
Reading the same input column in both pictures. The outer lookup uses the inner output, which can move you to a new column.
Quick check
Try it before you open its steps. It is question 3 of 5 in the full lesson, where they run from easy to exam-hard.
Try it · level 3 of 5
Use the same table twice
Find p(p(3)) in this complete p table. You put the first answer through p again. Plan: read p under 3, then move to p under the number it returns.
Show the steps and the answer
- .The innermost p acts on 3 first.
- .The same function receives a new input, 0, on the second pass.
5 Follow a composition across two graphs
The rule
For f(g(a)): read the y-value of g at ; use that number as the x-value on f; read f's y-value.
A point (a, b) on g means .
How
- Choose the inner graph from the function nearest the starting input.
- Locate that input on the inner graph's x-axis and move vertically to its curve.
- Read the curve's y-coordinate as the intermediate output.
- Locate that number on the outer graph's x-axis and move vertically to its curve.
- Read the outer y-coordinate as the final answer. Check each graph's own scale.
Worked example
Worked example
A line feeds a square graph
The first picture is g(x) = x + 2 and the second is f(x) = . Use the labeled points to find f(g(2)). The input is 2 on g; the resulting height selects the input on f. Plan: read the inner curve at the starting horizontal input, then carry its height to the outer x-axis.
Show the steps and the answer
- On g, find the labeled point (2, 4), so .The point's horizontal coordinate is the input and its vertical coordinate is the output.
- Move to input 4 on f's horizontal axis.g's output becomes f's input, rather than staying a height.
- Read the labeled point (4, 16), so .The outer graph gives the final output at the intermediate input.
The trap
Using the first graph's output as a height on the second graph. Move it to the second x-axis before finding the outer output.
Quick check
Try it before you open its steps. It is question 3 of 5 in the full lesson, where they run from easy to exam-hard.
Try it · level 3 of 5
A negative handoff can work
Using g(x) = x + 2 and f(x) = , find f(g(−3)). The input is negative, and the first output is also negative. You want the second graph’s output at that handoff. Plan: read g at −3, then start on f to the left of zero.
Show the steps and the answer
- On g, the point gives .A point below the horizontal axis has a negative output.
- Put on f’s horizontal axis. The point gives .Negative inputs are positions to the left of zero; their square is nonnegative.
- .The final output is the second graph’s height, not the first output’s sign.
6 Evaluate formulas one number at a time
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.
How
- Expand circle notation into parentheses if needed.
- Copy the inner formula and replace every input letter with the original number, using parentheses for negative numbers.
- Complete that arithmetic and write the intermediate output.
- Copy the outer formula and replace every input letter with that output.
- Complete the arithmetic and check by substituting into a combined formula.
Worked example
Worked example
Both orders at input 1
Let f(t) = − 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
- For f(h(1)), start with .h is the inner function for this order.
- .The output 5 replaces both occurrences of t in f.
- For h(f(1)), start with .f is the inner function for the reversed order.
- .The intermediate output 0 is a valid numerical input to h.
- f(h(1)) = 20.
- h(f(1)) = 2.
The trap
Replacing only the squared input in − t. The same input goes into both positions, so f(5) is − 5.
Quick check
Try it before you open its steps. It is question 2 of 4 in the full lesson, where they run from easy to exam-hard.
Try it · level 2 of 4
Fill every outer slot and reverse the order
Let f(t) = − 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
- For f(h(1)), start with .h is the inner function for this order.
- .The output 5 replaces both occurrences of t in f.
- For h(f(1)), start with .f is the inner function for the reversed order.
- .The intermediate output 0 is a valid numerical input to h.
- f(h(1)) = 20.
- h(f(1)) = 2.
7 Substitute the whole inside expression
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.
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.
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.
The trap
Writing (2x + 1 = 4 + 1. The square multiplies two whole sums, so the two cross products must appear.
Quick check
Try it before you open its steps. It is question 4 of 7 in the full lesson, where they run from easy to exam-hard.
Try it · level 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.
8 A composite domain has two gates
The rule
The domain of consists of the x values allowed by g for which g(x) is allowed by f.
Keep original restrictions when simplifying the composite formula.
How
- Find the inner domain. Record inputs making an inner denominator zero or violating any other inner requirement.
- Find what the outer function cannot accept. For an outer denominator, determine its forbidden input values.
- Set g(x) equal to each forbidden outer input and solve. Exclude the solutions that are in the inner domain.
- Keep only starting inputs passing both gates. For roots, use inequalities rather than only equations, as the next lesson explains.
- Write the result in interval notation and check a permitted input and each excluded input using the original stages.
Worked example
Worked example
Two different failures in a fraction composition
Let f(x) = and g(x) = . Find the domain of (f ∘ g)(x). You want every starting number that can get through g and then f. Plan: find where the first bottom is zero, then find where g hands f the number 1; exclude both starts.
Show the steps and the answer
- Gate 1: set to find the starting input that makes g divide by zero.A zero inner bottom prevents any in-between answer.
- Add 2: . Divide by 3: . Plug back in: . Exclude .Balanced operations find the failed start, and substitution confirms the zero bottom.
- Gate 2: f cannot accept 1, since . Find every start whose g answer is 1.The outer function receives g(x), so the forbidden number is a handoff value.
- Solve . On the inner domain multiply by the nonzero : .This locates starts that reach the forbidden outer input. The first exclusion makes the multiplication legal.
- Add 2: . Divide by 3: .These operations find the start that causes the second failure.
- Plug back in: , and . Exclude 2.The first stage works at 2, but its answer breaks the second division.
- Keep and . Split the line at these two excluded points.All remaining starts pass both original bottoms.
- Domain: (−∞, ) ∪ (, 2) ∪ (2, ∞).
- Set-builder: {x | x ≠ and x ≠ 2}.
The trap
Checking only the simplified final denominator. That can lose an inner restriction which disappeared during algebra.
Quick check
Try it before you open its steps. It is question 3 of 5 in the full lesson, where they run from easy to exam-hard.
Try it · level 3 of 5
An inner restriction only
Let g(x) = and f(x) = . Find the composite domain. You want a defined inner fraction followed by a square. Plan: inspect the original inside rule, then inspect the outside rule at the inside answer, keeping both restrictions.
Show the steps and the answer
- Set to locate the inner zero bottom. Subtract 4: . Plug back in: . Exclude .The equation identifies the failed first-stage input.
- No further exclusion is needed.The outer square accepts any real intermediate output.
9 Square roots add boundary checks
The rule
requires .
A denominator requires A(x) > 0.
For f(g(x)), apply every root requirement at its own stage and keep both gates.
How
- Write the inner radicand requirement before using the inner function's output.
- Substitute the inner output into the outer radicand and require it to be nonnegative.
- Use the inner range when possible. A real square root output is always at least zero.
- Before squaring an inequality, check that both compared sides are nonnegative. Then square and solve while preserving the earlier requirements.
- If a root is a denominator, replace its nonnegative condition with a greater than zero one.
- Combine the bounds and test endpoints in the original two-stage formula.
Worked example
Worked example
A root inside a root
Let f(x) = and g(x) = . Find (f ∘ g)(x) and its domain. You want a nested-root formula and the starting inputs for which both roots exist. Plan: find where the inner root exists, then use its nonnegative output to check the outer radicand after adding 2.
Show the steps and the answer
- .The whole inner root replaces the outer input.
- The inner root requires .A real square root cannot have a negative radicand.
- , so .Subtracting 3 gives the first inequality; multiplying by −1 reverses its direction.
- The outer root requires . This adds no restriction.Where the inner root exists, it is at least zero, so adding 2 makes the outer radicand at least 2.
- Domain: (−∞, 3].
The trap
Demanding a positive radicand for every square root. Ordinary roots allow zero; roots in denominators must avoid zero because of division.
Quick check
Try it before you open its steps. It is question 4 of 7 in the full lesson, where they run from easy to exam-hard.
Try it · level 4 of 7
An inner root reaches a forbidden outer input
Let g(x) = and f(x) = . Find the domain of f(g(x)). You need the root to exist and its answer to avoid 5. Plan: keep the inner lower bound, solve = 5, then exclude the verified start.
Show the steps and the answer
- Gate 1: gives .This finds the starting inputs where the inner root exists.
- Gate 2: f rejects input 5, since . Solve to find the start that hands f that value.The equation locates the failed outer handoff.
- Both sides are nonnegative. Square: . Subtract 9: .Squaring reverses the existing root here; subtraction isolates the failed start.
- Plug back in: and . Exclude 16.The candidate truly breaks gate 2 and already lies in the inner domain.
- At the lower boundary and , so include .A zero root is permitted here because the outer bottom is −5, not zero.
10 Decompose by naming the inside and outside jobs
The rule
To write , choose g as the inside job and f as the job applied to its output.
Check by substitution and preserve h's original domain.
How
- Work out h at a permitted small input. The final job you perform suggests the outer function; everything before it suggests the inner function.
- Define g(x) as that package, which will be calculated first.
- Define f(x) as the operation applied to one input package.
- Substitute g(x) into f and show that f(g(x)) recreates h(x).
- Check the composite domain against the original domain. A formula match alone can hide a lost input.
- If another split is requested, choose a different package and repeat the same checks.
Worked example
Worked example
Three decompositions
Write each as f(g(x)): (a) h(x) = ; (b) h(x) = (5x − 4; (c) h(x) = . You want an inside calculation followed by the finishing operation. Plan: name everything before the last operation as g, name the last operation as f, then recompose and compare domains.
Show the steps and the answer
- (a) Choose and . Recompose: .The inside builds the radicand; the outside takes its root. u is another name for f’s input slot.
- Require . Rearrange to , so .This finds the starts whose radicand is nonnegative. Their distance from zero is at most ≈ 2.24.
- Test and : both give radicand . Start 3 gives and fails.These tests show why both a lower and an upper boundary are needed.
- (b) Choose g(x) = 5x − 4 and f(u) = . Recompose: .Build the whole parenthesized expression first, then cube it. Neither stage restricts real starts.
- (c) Choose and . Recompose: .Addition builds the bottom before taking the reciprocal.
- Locate the failed bottom by solving : subtract 8, giving . Plug back in: . Exclude .This equation finds the one start whose inside answer cannot enter the reciprocal.
- Domain: [−, ].
- Domain: (−∞, ∞).
- (c) g(x) = x + 8
- Domain: (−∞, −8) ∪ (−8, ∞).
The trap
Giving the two correct component formulas in the wrong order. Recompose f(g(x)) on paper before accepting your decomposition.
Quick check
Try it before you open its steps. It is question 4 of 7 in the full lesson, where they run from easy to exam-hard.
Try it · level 4 of 7
A quadratic package under a root
Decompose h(x) = and give its domain. The expression 10 − is quadratic: its highest input power is . You want the radicand-building job, the root job, and the permitted starts. Plan: identify the last operation, name the earlier work as g, then recompose and check the allowed starts.
Show the steps and the answer
- Take and .The quadratic expression is the package inside the root.
- .The entire radicand fills the outer input slot.
- Require , so and .The distance of x from zero must be no more than .
- Starts 3 and give inside and work. Starts 4 and give and fail. Since , both boundaries lie between those pairs.This makes the two-sided distance bound concrete.
- Domain: [−, ].
11 Quick checks for the whole unit
Quick check 1 of 8
Let f(x) = + 2 and g(x) = 4x. Find f(g(1)) and g(f(0)). You want the output of each two-step route.
Show the steps and the answer
- f(g(1)) = f(4) = 18, because g acts first.
- g(f(0)) = g(2) = 8, because f acts first.
Quick check 2 of 8
Use the two pictured complete tables. Find p(q(2)); then find every start x for which p(q(x)) = 5. The first gives an input and asks for an output; the second gives an output and asks for inputs.
Show the steps and the answer
- p(q(2)) = p(3) = 4.
- p(q(x)) = 5 requires q(x) = 1, so x = 1 or x = 4, because only p(1) is 5 and the q output 1 appears in those two columns.
Quick check 3 of 8
p(t) counts pages printed in t minutes, and w(n) gives grams of ink used for n pages. What does w(p(8)) measure, and why does p(w(8)) lack the stated meaning?
Show the steps and the answer
- w(p(8)) measures grams of ink used in 8 minutes of printing, because pages are the shared handoff.
- p(w(8)) passes grams to a rule expecting minutes, so its units do not match.
Quick check 4 of 8
Let f(u) = and g(x) = . Find the domain of f(g(x)). You want starts where the root exists and its answer does not make the outer bottom zero.
Show the steps and the answer
- [−11, 5) ∪ (5, ∞), because x ≥ −11 makes the root real and = 4 gives x + 11 = 16, hence excluded start 5. At 5 the root is 4 and the outer bottom is 0
- at −11 the outer bottom is −4 and works.
Quick check 5 of 8
Let f(x) = 5x − 2. Find f(f(x)). You want to feed the first answer into the same rule again.
Show the steps and the answer
Quick check 6 of 8
Let g(x) = x − 7 and f(u) = . Find the domain of f(g(x)). You need the inner output to be allowed under the root.
Show the steps and the answer
Quick check 7 of 8
Now use g(x) = x − 7 and f(u) = . Is input 7 still allowed? Find the domain.
Show the steps and the answer
- Input 7 is excluded.
- Domain: (7, ∞), because the denominator must be real and nonzero, requiring x − 7 > 0.
Quick check 8 of 8
The pictures show g(x) = 6 − x and f(x) = with no answer labels. Read f(g(2)) from the grid. You want the height on g at input 2, then the height on f at that new input.