Functions: composition, inverse rules and allowed inputs
Track each input through a sequence of rules and preserve domain restrictions when reversing or combining functions.
In this guide
Treat a function as a rule with a domain
A function assigns exactly one output to each allowed input. The phrase 'allowed input' matters as much as the formula. A denominator cannot be zero, and an ordinary real square root requires a nonnegative quantity under the radical. Two formulas may produce the same output wherever both are defined yet have different domains. When a question combines functions, keep track of the intermediate result: the output of the inner function must be an allowed input to the outer function. This is a chain of conditions, not just a substitution exercise.
Composition is a sequence, not multiplication
The notation f(g(x)) means apply g first and then apply f to the result. The inner parentheses show the first operation. In contrast, f(x)g(x) means multiply two outputs produced from the same input. Reversing the order of composition usually changes the result. A useful written method is to give the intermediate output its own line rather than attempting every operation mentally. For an algebraic composition, replace every occurrence of the outer function's input with the whole inner expression, using parentheses to preserve its structure.
Worked example 1: compare two orders
Let f(x) = 3x - 4 and g(x) = x² + 2. Find f(g(3)) and g(f(3)). Both functions accept every real input, so no domain restriction interferes here. The calculations use the same starting number and the same rules, but their ordering differs. The example also shows why evaluating f and g separately and multiplying the answers would solve a different problem.
- For f(g(3)), first compute g(3) = 3² + 2 = 11. Then f(11) = 3(11) - 4 = 29.
- For g(f(3)), first compute f(3) = 3(3) - 4 = 5. Then g(5) = 5² + 2 = 27.
- The answers 29 and 27 differ. Composition is not generally interchangeable in order.
- As a symbolic check, f(g(x)) = 3x² + 2, while g(f(x)) = (3x - 4)² + 2. Substituting x = 3 confirms both results.
Worked example 2: reverse a one-to-one rule
Let h(x) = (5x + 7)/3. Find the input that gives output 9, then express the general inverse rule. An inverse reverses the original input-output relationship. It is available as a function only when each output under consideration corresponds to one original input. This linear rule has that property because its slope is nonzero.
- For the particular output, solve (5x + 7)/3 = 9. Multiply by 3, subtract 7, and divide by 5 to obtain x = 4.
- For the general rule, write y = (5x + 7)/3 and solve for x: x = (3y - 7)/5.
- Express the inverse using its own input variable: h⁻¹(x) = (3x - 7)/5. Thus h⁻¹(9) = 4.
- Check the reversal: h(4) = 9. The inverse notation h⁻¹ does not mean the reciprocal 1/h.
A domain restriction can survive simplification
Consider f(x) = 1/(x - 2) and g(x) = √x. Their composition f(g(x)) is 1/(√x - 2). Two conditions apply: x must be at least zero so the square root is real, and x must not equal 4 so the denominator stays nonzero. Checking only one condition gives an incomplete domain. More generally, simplification does not erase restrictions from an earlier stage of a rule. If an intermediate calculation is undefined, a later-looking formula cannot make the original sequence valid retroactively.
Misconception: every function reverses without a choice
For p(x) = x² on all real inputs, both 7 and -7 produce 49. A reverse rule assigning both outputs to input 49 would not be a function. Restricting the original domain to x ≥ 0 makes p one-to-one and gives the inverse √x. Restricting it to x ≤ 0 instead produces the negative square-root branch. The domain is therefore part of the inverse problem, not a decorative statement.
Try it yourself
Let p(x) = x² with domain x ≥ 0. What is p⁻¹(49)? Separately, is x = 4 allowed as an input of 1/(√x - 2)? Explain both decisions.
Reveal the worked answer
The inverse returns the allowed input whose square is 49. That input is 7; -7 is outside the stated domain. The inverse is not the reciprocal 1/49. For the second expression, x = 4 makes the denominator √4 - 2 = 0, so it is excluded even though the square root itself exists.
The inverse returns the allowed input whose square is 49. That input is 7; -7 is outside the stated domain. The inverse is not the reciprocal 1/49. For the second expression, x = 4 makes the denominator √4 - 2 = 0, so it is excluded even though the square root itself exists.
Put one idea into practice.
Try a short mathematics session, then use the explanations to choose what to review next.
Start a short sessionSources & further reading
OpenStax College Algebra 2e: Composition of functionsOpenStax College Algebra 2e: Inverse functionsSomething unclear or incorrect? Suggest a correction to this guide.
Original FreeReviewer.ph guidance, informed by the linked sources. Exam requirements and procedures should always be checked with the examining body.