Cookmath

Composition

(f∘g)(x)=f(g(x)): g acts first. For f(x)=2x+1,g(x)=x²: f(g(3))=19, whereas g(f(3))=49.

Before you begin

Check: if f(x)=2x+1, then f(3)=7. Function evaluation replaces every occurrence of the input.

What you will learn

Understand the idea

The composition (f∘g)(x)=f(g(x)) feeds g’s output into f. Order generally changes the result. Its domain requires x in g’s domain and g(x) in f’s domain; a simplified expression cannot restore inputs excluded by either original stage.

Worked example 1

For f(x)=x² and g(x)=x+3, compare f(g(2)) and g(f(2)).

  1. Inside first: g(2)=5, then f(5)=25.
  2. In reverse, f(2)=4, then g(4)=7.
  3. The formulas are (x+3)² and x²+3, so composition is not commutative.

Worked example 2

Find f∘g and its domain for f(u)=√u and g(x)=1/(x−2).

  1. The formula is √(1/(x−2)).
  2. Require x≠2 and 1/(x−2)≥0; the positive numerator forces x−2>0.
  3. Thus the domain is (2,∞), excluding 2.

Diagnose an error

Is f(g(x)) the same as f(x)g(x)?

Compare your reasoning

Is f(g(x)) the same as f(x)g(x)?

  1. No: composition substitutes an output as a new input; multiplication multiplies two outputs.
  2. With f(x)=x+1,g(x)=2x at x=1, composition is 3 while the product is 4.

Independent practice

Submit your answer in the interactive lesson to unlock the worked solution. Type your reasoning or build it with clickable tiles.

Practice 1

Find f(g(x)) for f(x)=3x−2 and g(x)=x²+1.

Solution locked until submission.

Practice 2

Find the domain of √(5−2x).

Solution locked until submission.

Practice 3

Write (2x−1)⁴ as a composition of two nonidentity functions.

Solution locked until submission.

Practice 4

A price of p is reduced by 10%, then taxed 8%. Give the final-price function and evaluate p=50.

Solution locked until submission.

Connect and reflect

Label the output of the inner stage before applying the outer stage; check domain at both stages.

Original Cookmath explanations and exercises. Scope reference: OpenStax Precalculus 2e · scope reference; original Cookmath lesson. Cookmath units are smaller study groups, not publisher chapter counts.

Continue learning

Functions