Function Composition in Precalculus

Master function composition: combining functions, evaluating composite functions, and understanding the order of operations with detailed exercises and solutions.

Solution: Exercises 1 to 3
1 Basic Composition
Exercise 1
Given f(x) = 2x + 3 and g(x) = x² - 1, find (f ∘ g)(x) and (g ∘ f)(x). Show that function composition is not commutative.
Definition:

Function Composition: The operation (f ∘ g)(x) = f(g(x)), which means applying g first, then applying f to the result. The composition is read as "f composed with g" or "f of g of x".

Composition Method:
  1. Identify the inner function (g(x)) and outer function (f(x))
  2. Substitute the inner function into the outer function
  3. Simplify the resulting expression
  4. Remember: order matters - (f ∘ g)(x) ≠ (g ∘ f)(x) in general
Composition
(f ∘ g)(x)
Result
2x² + 1
Composition
(g ∘ f)(x)
Step 1: Find (f ∘ g)(x) = f(g(x))

First, find g(x): g(x) = x² - 1

Then substitute g(x) into f: f(g(x)) = f(x² - 1)

f(x² - 1) = 2(x² - 1) + 3 = 2x² - 2 + 3 = 2x² + 1

Step 2: Find (g ∘ f)(x) = g(f(x))

First, find f(x): f(x) = 2x + 3

Then substitute f(x) into g: g(f(x)) = g(2x + 3)

g(2x + 3) = (2x + 3)² - 1 = 4x² + 12x + 9 - 1 = 4x² + 12x + 8

Step 3: Compare results

(f ∘ g)(x) = 2x² + 1

(g ∘ f)(x) = 4x² + 12x + 8

Since 2x² + 1 ≠ 4x² + 12x + 8, function composition is not commutative

Step 4: Verify with specific value

Let x = 1:

(f ∘ g)(1) = 2(1)² + 1 = 3

(g ∘ f)(1) = 4(1)² + 12(1) + 8 = 24

Since 3 ≠ 24, this confirms composition is not commutative

Step 5: Understand the process

(f ∘ g)(x) means "apply g first, then apply f"

(g ∘ f)(x) means "apply f first, then apply g"

The order of operations matters significantly

Composition Results:
(f ∘ g)(x) = 2x² + 1
(g ∘ f)(x) = 4x² + 12x + 8
Since (f ∘ g)(x) ≠ (g ∘ f)(x), composition is not commutative
Order of application matters in function composition
Final answer:

(f ∘ g)(x) = 2x² + 1 and (g ∘ f)(x) = 4x² + 12x + 8. Since these are different expressions, this demonstrates that function composition is not commutative.

Applied rules:

• Composition definition: (f ∘ g)(x) = f(g(x))

• Order matters: (f ∘ g)(x) ≠ (g ∘ f)(x) in general

• Substitution: Replace x in outer function with entire inner function

• Non-commutativity: Function composition is not commutative unlike addition/multiplication

2 Multi-Step Composition
Exercise 2
Given f(x) = 3x - 2, g(x) = x², and h(x) = √x, find (f ∘ g ∘ h)(x) and (h ∘ g ∘ f)(x). State the domains of each composite function.
Definition:

Multi-Step Composition: Applying three or more functions in sequence. For (f ∘ g ∘ h)(x), apply h first, then g, then f. The domain is restricted by the most restrictive function in the chain.

Triple Composition
(f ∘ g ∘ h)(x)
Result
3x - 2
Domain
x ≥ 0
Step 1: Find (f ∘ g ∘ h)(x)

Work from inside out: first h(x) = √x

Then g(h(x)) = g(√x) = (√x)² = x

Finally f(g(h(x))) = f(x) = 3x - 2

So (f ∘ g ∘ h)(x) = 3x - 2

Step 2: Determine domain of (f ∘ g ∘ h)(x)

h(x) = √x requires x ≥ 0

g(√x) = x is defined for x ≥ 0 (since √x ≥ 0)

f(x) = 3x - 2 is defined for all real numbers

Therefore, domain is x ≥ 0

Step 3: Find (h ∘ g ∘ f)(x)

Work from inside out: first f(x) = 3x - 2

Then g(f(x)) = g(3x - 2) = (3x - 2)²

Finally h(g(f(x))) = h((3x - 2)²) = √((3x - 2)²) = |3x - 2|

So (h ∘ g ∘ f)(x) = |3x - 2|

Step 4: Determine domain of (h ∘ g ∘ f)(x)

f(x) = 3x - 2 is defined for all real numbers

g(3x - 2) = (3x - 2)² is defined for all real numbers

h((3x - 2)²) = √((3x - 2)²) requires (3x - 2)² ≥ 0

Since any real number squared is non-negative, domain is all real numbers

Step 5: Simplify the absolute value

(h ∘ g ∘ f)(x) = |3x - 2|

This equals 3x - 2 when 3x - 2 ≥ 0 (i.e., x ≥ 2/3)

This equals -(3x - 2) = -3x + 2 when 3x - 2 < 0 (i.e., x < 2/3)

Step 6: Verify the compositions

Let x = 4: (f ∘ g ∘ h)(4) = 3(4) - 2 = 10

Check: h(4) = 2, g(2) = 4, f(4) = 10 ✓

Let x = 1: (h ∘ g ∘ f)(1) = |3(1) - 2| = |1| = 1

Check: f(1) = 1, g(1) = 1, h(1) = 1 ✓

Triple Compositions:
(f ∘ g ∘ h)(x) = 3x - 2, domain: [0, ∞)
(h ∘ g ∘ f)(x) = |3x - 2|, domain: (-∞, ∞)
Order significantly affects both result and domain
Domains are restricted by the most restrictive function in chain
Final answer:

(f ∘ g ∘ h)(x) = 3x - 2 with domain [0, ∞), and (h ∘ g ∘ f)(x) = |3x - 2| with domain (-∞, ∞). The order of composition affects both the result and the domain.

Applied rules:

• Chain composition: Work from inside out: f(g(h(x)))

• Domain restrictions: Each function in chain may impose restrictions

• Order dependency: Different orders yield different results

• Absolute value: √(x²) = |x|, not just x

3 Evaluating at Specific Values
Exercise 3
Given f(x) = x² - 3x + 2 and g(x) = 2x + 1, find (f ∘ g)(-2) and (g ∘ f)(3) using two methods: direct composition and step-by-step evaluation.
Definition:

Composite Function Evaluation: Finding the value of a composite function at a specific input. This can be done by first finding the general composition and then substituting, or by evaluating step-by-step.

Method 1
Direct Composition
Method 2
Step-by-Step
Result
Same Value
Step 1: Method 1 - Direct composition for (f ∘ g)(-2)

Find (f ∘ g)(x) = f(g(x)) = f(2x + 1)

= (2x + 1)² - 3(2x + 1) + 2

= 4x² + 4x + 1 - 6x - 3 + 2

= 4x² - 2x

Now evaluate at x = -2: (f ∘ g)(-2) = 4(-2)² - 2(-2) = 16 + 4 = 20

Step 2: Method 2 - Step-by-step for (f ∘ g)(-2)

First find g(-2): g(-2) = 2(-2) + 1 = -4 + 1 = -3

Then find f(-3): f(-3) = (-3)² - 3(-3) + 2 = 9 + 9 + 2 = 20

So (f ∘ g)(-2) = 20

Step 3: Method 1 - Direct composition for (g ∘ f)(3)

Find (g ∘ f)(x) = g(f(x)) = g(x² - 3x + 2)

= 2(x² - 3x + 2) + 1

= 2x² - 6x + 4 + 1

= 2x² - 6x + 5

Now evaluate at x = 3: (g ∘ f)(3) = 2(3)² - 6(3) + 5 = 18 - 18 + 5 = 5

Step 4: Method 2 - Step-by-step for (g ∘ f)(3)

First find f(3): f(3) = (3)² - 3(3) + 2 = 9 - 9 + 2 = 2

Then find g(2): g(2) = 2(2) + 1 = 4 + 1 = 5

So (g ∘ f)(3) = 5

Step 5: Compare the methods

Method 1 (direct composition) is better when evaluating multiple inputs

Method 2 (step-by-step) is better for single evaluations

Both methods yield the same results, confirming our work

Step 6: Verify with alternative approach

For (f ∘ g)(-2): g(-2) = -3, then f(-3) = 9 + 9 + 2 = 20 ✓

For (g ∘ f)(3): f(3) = 2, then g(2) = 5 ✓

Evaluation Results:
(f ∘ g)(-2) = 20 using both methods
(g ∘ f)(3) = 5 using both methods
Direct composition better for multiple evaluations
Step-by-step better for single evaluations
Both methods yield identical results
Final answer:

(f ∘ g)(-2) = 20 and (g ∘ f)(3) = 5. Both values were verified using two different methods, confirming the accuracy of our calculations.

Applied rules:

• Direct method: Find general composition first, then substitute

• Step-by-step: Evaluate each function individually

• Verification: Both methods should yield the same result

• Efficiency: Choose method based on number of evaluations needed

Function Composition Guide
(f ∘ g)(x) = f(g(x))
Composition Definition
Composition
(f ∘ g)(x)
Apply g first, then f
Domain
{x ∈ dom(g) : g(x) ∈ dom(f)}
Valid inputs for composition
Associative
(f ∘ g) ∘ h = f ∘ (g ∘ h)
Order of grouping doesn't matter
Key Definitions:

Function Composition: The operation of combining two functions where the output of one function becomes the input of another

Inner Function: The function applied first in a composition (g in f(g(x)))

Outer Function: The function applied second in a composition (f in f(g(x)))

Domain of Composition: The set of all x in the domain of g such that g(x) is in the domain of f

Non-Commutative: In general, (f ∘ g)(x) ≠ (g ∘ f)(x)

Composition Strategy:
  1. Identify functions: Determine which function is inner and which is outer
  2. Substitute systematically: Replace every occurrence of x in the outer function with the inner function
  3. Simplify: Algebraically manipulate to get the final form
  4. Check domain: Ensure the composition is defined for the intended inputs
  5. Verify: Test with specific values to confirm correctness
Tip 1: Remember that function composition is not commutative: (f ∘ g)(x) ≠ (g ∘ f)(x) in general.
Tip 2: When evaluating at a specific value, step-by-step evaluation is often faster than finding the general composition.
Tip 3: For triple compositions like (f ∘ g ∘ h)(x), work from inside out: first h, then g, then f.
Tip 4: Always check domain restrictions when composing functions with limited domains (like square roots).
Associative Property: Function composition is associative: (f ∘ g) ∘ h = f ∘ (g ∘ h).
Domain Consideration: The domain of (f ∘ g)(x) is restricted by both the domain of g and the domain of f.
Essential Formulas:

• Composition: (f ∘ g)(x) = f(g(x))

• Domain of composition: {x ∈ dom(g) : g(x) ∈ dom(f)}

• Associative property: (f ∘ g) ∘ h = f ∘ (g ∘ h)

• Identity function: (f ∘ I)(x) = (I ∘ f)(x) = f(x), where I(x) = x

• Power notation: fⁿ(x) = f ∘ f ∘ ... ∘ f (n times)

Solution: Exercises 4 to 5
4 Real-World Application
Exercise 4
A company's production function is P(x) = 2x + 10 (units produced from x hours of labor), and the revenue function is R(y) = 5y - 0.1y² (dollars from y units sold). Find the revenue as a function of hours worked and calculate revenue for 20 hours of labor.
Definition:

Real-World Composition: Using function composition to model sequential processes where the output of one process becomes the input of another, such as production → sales → revenue.

Composition
(R ∘ P)(x)
Revenue Function
10x - 0.4x² + 50
Revenue at 20h
$170
Step 1: Identify the functions

P(x) = 2x + 10: Units produced from x hours of labor

R(y) = 5y - 0.1y²: Revenue from selling y units

We want R(P(x)): Revenue as a function of hours worked

Step 2: Form the composition

(R ∘ P)(x) = R(P(x)) = R(2x + 10)

= 5(2x + 10) - 0.1(2x + 10)²

Step 3: Expand and simplify

= 5(2x + 10) - 0.1(2x + 10)²

= 10x + 50 - 0.1(4x² + 40x + 100)

= 10x + 50 - 0.4x² - 4x - 10

= -0.4x² + 6x + 40

Step 4: Calculate revenue for 20 hours

(R ∘ P)(20) = -0.4(20)² + 6(20) + 40

= -0.4(400) + 120 + 40

= -160 + 120 + 40 = 0

Step 5: Verify with step-by-step approach

Hours = 20: P(20) = 2(20) + 10 = 50 units produced

Units = 50: R(50) = 5(50) - 0.1(50)² = 250 - 0.1(2500) = 250 - 250 = 0

Revenue = $0, confirming our composition

Step 6: Analyze the result

The revenue function R(P(x)) = -0.4x² + 6x + 40 shows diminishing returns

At 20 hours of labor, the revenue is $0, suggesting this might be beyond optimal production

Business Application:
Revenue function: R(P(x)) = -0.4x² + 6x + 40
Revenue at 20h: $0
Process: Hours → Production → Revenue
Model shows diminishing returns
Composition connects different business stages
Final answer:

The revenue as a function of hours worked is R(P(x)) = -0.4x² + 6x + 40. For 20 hours of labor, the revenue is $0. This shows how function composition can model sequential business processes.

Applied rules:

• Sequential modeling: Use composition to connect related processes

• Substitution: Replace variable in outer function with inner function

• Real-world interpretation: Verify results make practical sense

• Verification: Check with step-by-step evaluation

5 Complex Function Composition
Exercise 5
Given f(x) = 1/(x+1), g(x) = x², and h(x) = √x, find (f ∘ g ∘ h)(x) and determine its domain. Then find (h ∘ f ∘ g)(x) and its domain.
Definition:

Complex Composition: Function composition involving functions with domain restrictions such as rational functions, radicals, and other special functions requiring careful domain analysis.

First Composition
(f ∘ g ∘ h)(x)
Result
1/(x+1)
Domain
x ≥ 0, x ≠ 1
Step 1: Find (f ∘ g ∘ h)(x)

Work from inside out: h(x) = √x

Then g(h(x)) = g(√x) = (√x)² = x (since x ≥ 0 from domain of h)

Finally f(g(h(x))) = f(x) = 1/(x+1)

So (f ∘ g ∘ h)(x) = 1/(x+1)

Step 2: Determine domain of (f ∘ g ∘ h)(x)

h(x) = √x requires x ≥ 0

g(√x) = x is defined for x ≥ 0

f(x) = 1/(x+1) requires x+1 ≠ 0, so x ≠ -1

Since x ≥ 0, the condition x ≠ -1 is automatically satisfied

Domain: [0, ∞)

Step 3: Find (h ∘ f ∘ g)(x)

Work from inside out: g(x) = x²

Then f(g(x)) = f(x²) = 1/(x²+1)

Finally h(f(g(x))) = h(1/(x²+1)) = √(1/(x²+1))

So (h ∘ f ∘ g)(x) = √(1/(x²+1))

Step 4: Determine domain of (h ∘ f ∘ g)(x)

g(x) = x² is defined for all real numbers

f(x²) = 1/(x²+1) is defined for all real numbers (since x²+1 ≥ 1 > 0)

h(1/(x²+1)) = √(1/(x²+1)) requires 1/(x²+1) ≥ 0

Since x²+1 > 0 for all real x, 1/(x²+1) > 0 for all real x

Domain: (-∞, ∞)

Step 5: Simplify the second composition

(h ∘ f ∘ g)(x) = √(1/(x²+1)) = 1/√(x²+1)

Since x²+1 > 0, √(x²+1) > 0, so the expression is well-defined

Step 6: Verify with specific values

For (f ∘ g ∘ h)(x) with x = 4: (f ∘ g ∘ h)(4) = 1/(4+1) = 1/5

Check: h(4) = 2, g(2) = 4, f(4) = 1/5 ✓

For (h ∘ f ∘ g)(x) with x = 1: (h ∘ f ∘ g)(1) = 1/√(1+1) = 1/√2

Check: g(1) = 1, f(1) = 1/2, h(1/2) = √(1/2) = 1/√2 ✓

Complex Compositions:
(f ∘ g ∘ h)(x) = 1/(x+1), domain: [0, ∞)
(h ∘ f ∘ g)(x) = 1/√(x²+1), domain: (-∞, ∞)
Domain analysis critical for complex compositions
Different orders yield different domains
Radical and rational function domains require special care
Final answer:

(f ∘ g ∘ h)(x) = 1/(x+1) with domain [0, ∞), and (h ∘ f ∘ g)(x) = 1/√(x²+1) with domain (-∞, ∞). The order of composition significantly affects both the result and the domain.

Applied rules:

• Domain preservation: Each function in chain may restrict the domain

• Rational functions: Denominators cannot equal zero

• Radical functions: Arguments must be non-negative

• Order matters: Different compositions have different domains

Function Composition Summary and Guide
(f \circ g)(x) = f(g(x))
Composition Operation
Key definitions:

Function Composition: The operation of combining two functions f and g to create a new function (f ∘ g) such that (f ∘ g)(x) = f(g(x)). This means we first apply g to x, then apply f to the result of g(x).

Inner Function: The function that is applied first in a composition, whose output serves as input to the outer function.

Outer Function: The function that is applied second in a composition, which takes the output of the inner function as its input.

Domain of Composition: The set of all x in the domain of the inner function such that the output of the inner function is in the domain of the outer function.

Non-Commutative: The property that (f ∘ g)(x) ≠ (g ∘ f)(x) in general, meaning the order of functions in composition matters.

Complete composition methodology:
  1. Identify the functions: Determine which function is the inner function and which is the outer function
  2. Substitute systematically: Replace every occurrence of the variable in the outer function with the entire inner function
  3. Simplify algebraically: Expand, combine like terms, and reduce to simplest form
  4. Determine the domain: Consider restrictions from both functions in the composition
  5. Verify the result: Test with specific values to confirm the composition is correct
Tip 1: Remember that function composition is not commutative: (f ∘ g)(x) is generally not equal to (g ∘ f)(x).
Tip 2: When evaluating a composite function at a specific value, step-by-step evaluation is often faster than finding the general composition.
Tip 3: For multiple compositions like (f ∘ g ∘ h)(x), work from inside out: first apply h, then g, then f.
Tip 4: Always check domain restrictions when composing functions, especially those involving radicals, rational expressions, or logarithms.
Associative Property: Function composition is associative: (f ∘ g) ∘ h = f ∘ (g ∘ h). The grouping of functions doesn't affect the result.
Domain Consideration: The domain of (f ∘ g)(x) consists of all x in the domain of g such that g(x) is in the domain of f.
Essential formulas to know:

• Basic composition: (f ∘ g)(x) = f(g(x))

• Domain of composition: {x ∈ dom(g) : g(x) ∈ dom(f)}

• Associative property: (f ∘ g) ∘ h = f ∘ (g ∘ h)

• Identity function: (f ∘ I)(x) = (I ∘ f)(x) = f(x), where I(x) = x

• Inverse property: If f and g are inverses, then (f ∘ g)(x) = (g ∘ f)(x) = x

• Power notation: fⁿ(x) = f ∘ f ∘ ... ∘ f (n times)

• Multiple composition: (f ∘ g ∘ h)(x) = f(g(h(x)))

Questions & Answers

Question: Why isn't function composition commutative? It seems like it should work the same way as addition or multiplication.

Answer: Function composition is not commutative because it represents sequential operations where the order fundamentally matters. Consider this analogy:

Real-world example: Putting on socks then shoes is different from putting on shoes then socks!

Mathematical example: Let f(x) = x + 1 and g(x) = 2x

  • (f ∘ g)(x) = f(g(x)) = f(2x) = 2x + 1
  • (g ∘ f)(x) = g(f(x)) = g(x + 1) = 2(x + 1) = 2x + 2

Since 2x + 1 ≠ 2x + 2, we see that (f ∘ g)(x) ≠ (g ∘ f)(x).

The fundamental reason is that in (f ∘ g)(x), we first apply g to x, then apply f to the result. In (g ∘ f)(x), we first apply f to x, then apply g to the result. These are completely different processes.

Question: How do I determine the domain of a composite function? I often get confused about which restrictions apply.

Answer: The domain of (f ∘ g)(x) requires satisfying two conditions:

  1. Condition 1: x must be in the domain of g (so g(x) can be calculated)
  2. Condition 2: g(x) must be in the domain of f (so f(g(x)) can be calculated)

Example: Let f(x) = √x and g(x) = x - 3

For (f ∘ g)(x) = f(g(x)) = f(x - 3) = √(x - 3):

  • From g: x can be any real number
  • From f: We need x - 3 ≥ 0, so x ≥ 3
  • Domain of (f ∘ g)(x): [3, ∞)

For (g ∘ f)(x) = g(f(x)) = g(√x) = √x - 3:

  • From f: x ≥ 0
  • From g: √x can be any real number (but √x ≥ 0 anyway)
  • Domain of (g ∘ f)(x): [0, ∞)

Always check both functions in the composition for their respective domain restrictions.

Question: What's the difference between (f ∘ g)(x) and f(x) · g(x)? They look similar but I know they're different.

Answer: These are completely different operations:

Function Composition: (f ∘ g)(x) = f(g(x))

  • First apply g to x, then apply f to the result
  • Example: If f(x) = x² and g(x) = x + 1, then (f ∘ g)(x) = f(x + 1) = (x + 1)²
  • Order matters: (f ∘ g)(x) ≠ (g ∘ f)(x) in general

Function Multiplication: (f · g)(x) = f(x) · g(x)

  • Apply both functions to x, then multiply the results
  • Example: If f(x) = x² and g(x) = x + 1, then (f · g)(x) = x² · (x + 1) = x³ + x²
  • Order doesn't matter: (f · g)(x) = (g · f)(x) (commutative)

The symbol ∘ specifically denotes composition, while · (or juxtaposition) denotes multiplication. These operations follow completely different rules and produce different results.