FiveWay Premium

Unlock every question

896 more practice questions, 134 Challenge questions, timed mock exams in the 2027 format, and sets built from the skills you miss.

Current accessGuestYou are browsing without an account. Sign in to keep your record.

Free

Always, no account needed to read

  • A 7-question diagnostic and the first 8 practice questions in every topic
  • A worked solution and a note on each wrong choice for those questions
  • Every concept note, in every topic
  • Your record and My page

Premium

Everything in Free, plus

  • The other 896 questions — every topic, to the end
  • 134 Challenge questions, pitched above the exam ceiling
  • Timed mock exams — unit exams, and full exams with Section I (multiple choice) + Section II (free response)
  • Sets built from the skills you keep missing, refilled weekly
  • Analytics — accuracy per skill, time per question, your weak topics
Unlock early access

Early access is free while we test. No card, no timer. Compare plans

Topic 2.7B

Composition of Functions (Part B)

In 2.7A we evaluated compositions one number at a time: first the inside value, then the outside function. That works, but if you need f(g(x)) for many inputs, it is better to build one formula that does both steps at once. This note builds those formulas, finds where they are defined, and runs the process in reverse by breaking a complicated function into simpler pieces.

9 MIN READ6 IDEAS33 PROBLEMS10 flashcards

01

Building a Formula for f(g(x))

CONCEPT

Substitute the Whole Inside Function

To find f(g(x)), take the formula for f and replace every x with the entire expression g(x), in parentheses.

Then simplify. The result is a single function that does g and then f.

Worked example

With f(x)=x2−3 and g(x)=2x+1 from 2.7A, find formulas for f(g(x)) and g(f(x)).

  1. 01

    f(g(x)): replace x in f with (2x+1):

    f(g(x))=(2x+1)2−3=4x2+4x−2
  2. 02

    g(f(x)): replace x in g with (x2 − 3):

    g(f(x))=2 (x2−3)+1=2x2−5
  3. 03

    Check against 2.7A: 4(2)2+4(2)−2=22=f(g(2)) ✓, and 2(2)2−5=3=g(f(2)) ✓. Two different formulas, as expected, because order matters.

    Remember from 2.4: Nova's weekly model was exactly this. With T(w)=w/4 and N(t)=256(1.5)t, N(T(w))=256(1.5)w/4.

COMMON MISTAKE

“f(g(x))=x2−3 with 2x+1 stuck on: 2x+12−3.”

The whole inside function must go in parentheses before squaring: (2x+1)2, not 2x+12. Without parentheses only the 1 gets squared. Check with x=2: the wrong version gives 2, but f(g(2)) is 22.

Try it

f(x)=x2 and g(x)=x−1. What is f(g(x))?

02

The Domain of a Composition

CONCEPT

Two Conditions

x is in the domain of f(g(x)) exactly when (1)x is in the domain of g, AND (2) the value g(x) is in the domain of f.

Remember from 2.7A: g(f(5)) was undefined because f(5)=−1 was outside g's domain. The same thing happens with formulas.

Worked example

Example 1. f(x)=x and g(x)=5−x. Find the domains of f(g(x)) and g(f(x)).

  1. 01

    f(g(x)) = √(5−x). The square root needs 5−x≥0, so x≤5. (For example, x=5 gives 0 and x=1 gives 2, but x=6 gives −1, not real.)

  2. 02

    g(f(x))=5−x. Here the inside function x needs x≥0 first. After that, 5 − (anything) is fine. Domain: x≥0.

  3. 03

    Same two functions, opposite orders, different domains: x≤5 versus x≥0.

Worked example

Example 2. f(x)=1/(x−3) and g(x)=x2−1. Find f(g(x)) and its domain.

  1. 01

    Substitute:

    f(g(x))=1(x2−1)−3=1x2−4,x≠2,  x≠−2
  2. 02

    f can't take the input 3, so exclude every x with g(x)=3: x2−1=3 gives x2=4, so x=2 or x=−2. Remember from 2.1 and 2.5A: an even power has two roots, and here BOTH must be excluded.

  3. 03

    Domain: all real x except 2 and −2. Check a value that works: f(g(3))=1/(9−4)=1/5.

    A hidden restriction. Let f(x)=x2 and g(x)=x. Then f(g(x))=(x)2, which simplifies to x. But the simplified formula hides a restriction: g only accepts x≥0, so f(g(x)) is defined only for x≥0.

    Figure

    The formulas look the same after simplifying, but the composition keeps the domain of the inside function.

COMMON MISTAKE

“(x)2=x, so the domain of f(g(x)) is all real numbers.”

Find the domain BEFORE simplifying. The inside function x already throws out every negative input, and simplifying afterward can't bring them back. (Compare √(x2): at x=−3 it gives 3, not −3, so it is not x either.)

Quick check

Let f(x)=x and g(x)=5−x. What is the domain of f(g(x))?

03

Decomposing a Function

Sometimes you need to go backwards: given one function, find an inside function g and an outside function f so that h(x)=f(g(x)). Ask yourself: what is calculated FIRST, and what is done to it?

h(x)inside g(x)outside f(x)
(3x−1)43x − 1x4
2x2x22x
√(x2 + 9)x2 + 9√x
256(1.5)w/4w/4256(1.5)w

There is usually more than one correct decomposition. For (3x−1)4 you could also use g(x)=(3x−1)2 and f(x)=x2. What doesn't help is the trivial split f(x)=x, g(x)=h(x): it is correct, but it says nothing.

Worked example

Example 3. Decompose h(x)=2x+5 and k(x)=5x2−1.

  1. 01

    Ask: if I plug in a number, what do I calculate FIRST? For h at x=2: first 2(2)+5=9, then 9=3. So the inside is g(x)=2x+5 and the outside is f(x)=x.

  2. 02

    For k at x=2: first 22−1=3, then 53=125. Inside g(x)=x2−1, outside f(x)=5x.

  3. 03

    Check by composing back: f(g(x)) = √(2x+5) ✓ and 5x2−1 ✓.

Try it

h(x)=x+5 can be written as f(g(x)) with

04

Transformations Are Compositions

CONCEPT

Composing With a Linear Function

A change to the OUTPUT happens after f, so it is a linear function on the outside: 2f(x)−3=L(f(x)) with L(x)=2x−3.

A change to the INPUT happens before f, so it is a linear function on the inside: f(x+2)=f(S(x)) with S(x)=x+2, and f(3x)=f(M(x)) with M(x)=3x.

The identity function I(x)=x changes nothing: f(I(x))=I(f(x))=f(x).

Remember from 2.4: “If Nova had launched 2 months earlier” was N(t+2)=N(S(t)), an input change, and it equaled 576(1.5)t, which is an output change (a vertical stretch). The same function can be seen as either composition.

In 2.8 you will meet pairs of functions that undo each other, so that f(g(x))=x: composition with the result being the identity.

Worked example

Example 4. Let f(x)=x2. Write g(x)=3f(x−2)+1 as a composition, and find its formula.

  1. 01

    Inside (acts first on x): S(x)=x−2, a shift right by 2.

  2. 02

    Outside (acts on the output of f): L(x)=3x+1, a vertical stretch by 3 and a shift up 1. So g(x)=L(f(S(x))): three functions in a row.

  3. 03

    Formula: g(x)=3(x−2)2+1=3x2−12x+13. Check: g(2)=1 (the vertex moved to (2,1)) and g(3)=3(1)+1=4.

Worked example

Try it yourself. (a) f(x)=x+4, g(x)=x2. Find f(g(x)) and g(f(x)), and check both at x=1. (b) f(x)=x, g(x)=x−7. Find f(g(x)) and its domain. (c) Decompose h(x)=(x+5)3.

Answers: (a) f(g(x))=x2+4 and g(f(x))=(x+4)2=x2+8x+16. At x=1: 5 and 25. (b) x−7, domain x≥7. (c) g(x)=x+5, f(x)=x3.

Try it

g(x)=f(x)+3 is the composition k(f(x)) with

05

Practice

Worked example

P1. f(x)=3x and g(x)=x−4. Find f(g(x)) and g(f(x)).

Answer: f(g(x))=3(x−4)=3x−12. g(f(x))=3x−4.

Worked example

P2. f(x)=1/x and g(x)=x−6. Find f(g(x)) and its domain.

Answer: f(g(x))=1/(x−6). f can't take 0, so exclude x with x−6=0: all real x except 6.

Worked example

P3. Decompose h(x)=e2x+1 into f(g(x)).

Answer: g(x)=2x+1 (inside) and f(x)=ex (outside).

Worked example

P4. f(x)=x and g(x)=x2−4. Find f(g(x)) and its domain.

Answer: f(g(x)) = √(x2 − 4). Need x2−4≥0. The boundary x2=4 has two roots, x=±2, so the domain is x≤−2 or x≥2. (x=1 fails: −3 is not real; x=3 and x=−3 both give 5.)

Common slips

  • “f(g(x))=x2−3 with 2x+1 stuck on: 2x+12−3.”

    The whole inside function must go in parentheses before squaring: (2x+1)2, not 2x+12. Without parentheses only the 1 gets squared. Check with x=2: the wrong version gives 2, but f(g(2)) is 22.

  • “(x)2=x, so the domain of f(g(x)) is all real numbers.”

    Find the domain before simplifying. The inside function x already throws out every negative input, and simplifying afterward can't bring them back. (Compare √(x2): at x=−3 it gives 3, not −3, so it is not x either.)

Lock it in

Try the flashcards

10 cards · Composition and inverses

Start

Recap card

6 lines to re-read the night before.

  1. 01

    To build f(g(x)), substitute the whole expression g(x), in parentheses, for x in f. Then simplify.

  2. 02

    Domain of f(g(x)): x must be in the domain of g And g(x) must be in the domain of f. Find it before simplifying.

  3. 03

    When excluding values, solve g(x) = (bad input) completely; an even power gives two values to exclude.

  4. 04

    Decomposing: the inside function is what is computed first. Several decompositions can be correct.

  5. 05

    Output changes are compositions on the outside, input changes on the inside. I(x)=x changes nothing.

  6. 06

    Next, in 2.8: inverse functions, functions that undo each other, so that f(g(x))=x.

Premium feature

Unlock Premium

Every question, sets from your misses, mock exams and more.

Current accessFree

  • Every practice question
  • Sets from your misses
  • Mock exams
Sign in to unlock

Free during early access — no card. Your progress stays exactly where it is. Compare plans