Composing Functions Algebraically: Building New Functions from Existing Ones

Master composing functions algebraically through 5 detailed exercises with step-by-step solutions, visual explanations, and comprehensive learning materials.

Core Concepts & Notation
\( (f \circ g)(x) = f(g(x)) \)
Composition Notation
\( (g \circ f)(x) = g(f(x)) \)
Reverse Composition
\( (f \circ g \circ h)(x) = f(g(h(x))) \)
Triple Composition
\( (f \circ f)(x) = f(f(x)) \)
Self-Composition
Key Definitions:

Function Composition: The process of creating a new function by applying one function to the result of another

Algebraic Composition: Replacing the independent variable in one function with another function

Notation (f ∘ g)(x): Read as "f composed with g of x" or "f of g of x"

Inner Function: The function that is applied first (g in f(g(x)))

Outer Function: The function that is applied second (f in f(g(x)))

Domain Restrictions: The output of the inner function must be in the domain of the outer function

Algebraic Composition Process:
  1. Identify the inner and outer functions
  2. Replace every occurrence of the variable in the outer function with the inner function
  3. Simplify the resulting expression algebraically
  4. State the domain if required
Memory Tip: Think of it as a "function machine": g(x) feeds into f(x)
Memory Tip: Order matters! f(g(x)) ≠ g(f(x)) in general
Key Note: Always substitute the entire function, not just its value
Solution: Exercises 1 to 3
1 Linear Functions
Exercise 1
Given \( f(x) = 2x + 3 \) and \( g(x) = x - 1 \), find \( (f \circ g)(x) \) and \( (g \circ f)(x) \).
Strategy:

For (f ∘ g)(x): Substitute g(x) into f(x). For (g ∘ f)(x): Substitute f(x) into g(x).

Solution Steps:
  1. Find (f ∘ g)(x) by substituting g(x) into f(x)
  2. Find (g ∘ f)(x) by substituting f(x) into g(x)
  3. Compare results to demonstrate non-commutativity
Given
\( f(x) = 2x + 3, g(x) = x - 1 \)
Composition
\( (f \circ g)(x) \)
Result
\( 2x + 1 \)
Step 1: Find (f ∘ g)(x)

\( (f \circ g)(x) = f(g(x)) \)

Substitute g(x) = x - 1 into f(x) = 2x + 3

\( f(g(x)) = f(x - 1) = 2(x - 1) + 3 \)

Step 2: Simplify the expression

\( f(g(x)) = 2(x - 1) + 3 = 2x - 2 + 3 = 2x + 1 \)

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

\( (g \circ f)(x) = g(f(x)) \)

Substitute f(x) = 2x + 3 into g(x) = x - 1

\( g(f(x)) = g(2x + 3) = (2x + 3) - 1 \)

Step 4: Simplify the expression

\( g(f(x)) = (2x + 3) - 1 = 2x + 2 \)

Step 5: Compare the results

\( (f \circ g)(x) = 2x + 1 \)

\( (g \circ f)(x) = 2x + 2 \)

Since they are different, composition is not commutative.

\( (f \circ g)(x) = 2x + 1 \)
\( (g \circ f)(x) = 2x + 2 \)
Compositions:

\( (f \circ g)(x) = 2x + 1 \)

\( (g \circ f)(x) = 2x + 2 \)

Applied Rules:

• Substitution: Replace input variable with entire function

• Algebraic Simplification: Distribute and combine like terms

• Non-Commutativity: Order of composition matters

2 Polynomial Functions
Exercise 2
Given \( f(x) = x^2 + 2x \) and \( g(x) = x + 1 \), find \( (f \circ g)(x) \) and \( (g \circ f)(x) \).
Strategy:

For (f ∘ g)(x): Substitute g(x) into f(x) and expand. For (g ∘ f)(x): Substitute f(x) into g(x).

Given
\( f(x) = x^2 + 2x, g(x) = x + 1 \)
Composition
\( (f \circ g)(x) \)
Result
\( x^2 + 4x + 3 \)
Step 1: Find (f ∘ g)(x)

\( (f \circ g)(x) = f(g(x)) \)

Substitute g(x) = x + 1 into f(x) = x² + 2x

\( f(g(x)) = f(x + 1) = (x + 1)^2 + 2(x + 1) \)

Step 2: Expand (x + 1)²

\( (x + 1)^2 = x^2 + 2x + 1 \)

Step 3: Expand 2(x + 1)

\( 2(x + 1) = 2x + 2 \)

Step 4: Combine all terms

\( f(g(x)) = x^2 + 2x + 1 + 2x + 2 = x^2 + 4x + 3 \)

Step 5: Find (g ∘ f)(x)

\( (g \circ f)(x) = g(f(x)) \)

Substitute f(x) = x² + 2x into g(x) = x + 1

\( g(f(x)) = g(x^2 + 2x) = (x^2 + 2x) + 1 \)

Step 6: Simplify the expression

\( g(f(x)) = x^2 + 2x + 1 \)

\( (f \circ g)(x) = x^2 + 4x + 3 \)
\( (g \circ f)(x) = x^2 + 2x + 1 \)
Compositions:

\( (f \circ g)(x) = x^2 + 4x + 3 \)

\( (g \circ f)(x) = x^2 + 2x + 1 \)

Applied Rules:

• Binomial Expansion: (a + b)² = a² + 2ab + b²

• Distribution: Apply to each term separately

• Combining Like Terms: Add coefficients of like terms

3 Rational Functions
Exercise 3
Given \( f(x) = \frac{1}{x} \) and \( g(x) = x + 2 \), find \( (f \circ g)(x) \) and \( (g \circ f)(x) \). State the domain of each composition.
Strategy:

For (f ∘ g)(x): Substitute g(x) into f(x). For (g ∘ f)(x): Substitute f(x) into g(x). Check domain restrictions.

Given
\( f(x) = \frac{1}{x}, g(x) = x + 2 \)
Composition
\( (f \circ g)(x) \)
Result
\( \frac{1}{x+2} \)
Step 1: Find (f ∘ g)(x)

\( (f \circ g)(x) = f(g(x)) \)

Substitute g(x) = x + 2 into f(x) = 1/x

\( f(g(x)) = f(x + 2) = \frac{1}{x + 2} \)

Step 2: Find domain of (f ∘ g)(x)

For f(g(x)) to be defined, g(x) must be in the domain of f

Since f(x) = 1/x, we need g(x) ≠ 0

So x + 2 ≠ 0, which means x ≠ -2

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

\( (g \circ f)(x) = g(f(x)) \)

Substitute f(x) = 1/x into g(x) = x + 2

\( g(f(x)) = g\left(\frac{1}{x}\right) = \frac{1}{x} + 2 \)

Step 4: Find domain of (g ∘ f)(x)

For g(f(x)) to be defined, f(x) must be in the domain of g

Since g(x) = x + 2, it's defined for all real numbers

But f(x) = 1/x requires x ≠ 0

So the domain is x ≠ 0

Step 5: State the final answers

\( (f \circ g)(x) = \frac{1}{x + 2}, x \neq -2 \)

\( (g \circ f)(x) = \frac{1}{x} + 2, x \neq 0 \)

\( (f \circ g)(x) = \frac{1}{x + 2}, x \neq -2 \)
\( (g \circ f)(x) = \frac{1}{x} + 2, x \neq 0 \)
Compositions & Domains:

\( (f \circ g)(x) = \frac{1}{x + 2}, x \neq -2 \)

\( (g \circ f)(x) = \frac{1}{x} + 2, x \neq 0 \)

Applied Rules:

• Domain Restriction: Output of inner function must be in domain of outer function

• Rational Functions: Denominator cannot be zero

• Composition Domain: Intersection of all relevant domains

Solution: Exercises 4 to 5
4 Three-Function Composition
Exercise 4
Given \( f(x) = x^2 \), \( g(x) = 2x + 1 \), and \( h(x) = x - 3 \), find \( (f \circ g \circ h)(x) \).
Recognition Pattern:

Chain of compositions: Evaluate from right to left: h(x), then g(h(x)), then f(g(h(x))).

Given
\( f(x) = x^2, g(x) = 2x + 1, h(x) = x - 3 \)
Chain
\( h(x) \to g(h(x)) \to f(g(h(x))) \)
Result
\( (2x-5)^2 \)
Step 1: Start with the rightmost function

\( h(x) = x - 3 \)

Step 2: Find g(h(x))

\( g(h(x)) = g(x - 3) = 2(x - 3) + 1 = 2x - 6 + 1 = 2x - 5 \)

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

\( f(g(h(x))) = f(2x - 5) = (2x - 5)^2 \)

Step 4: Expand if needed

\( (2x - 5)^2 = 4x^2 - 20x + 25 \)

Step 5: Write the final answer

\( (f \circ g \circ h)(x) = (2x - 5)^2 = 4x^2 - 20x + 25 \)

\( (f \circ g \circ h)(x) = (2x - 5)^2 = 4x^2 - 20x + 25 \)
Triple Composition:

\( (f \circ g \circ h)(x) = (2x - 5)^2 \)

Applied Rules:

• Right-to-Left Evaluation: Evaluate compositions from inside out

• Chain Rule: Each function feeds into the next

• Binomial Expansion: Expand when necessary

5 Self-Composition
Exercise 5
Given \( f(x) = x^2 - 2x + 1 \), find \( (f \circ f)(x) \).
Strategy:

Self-composition: Substitute the function into itself: f(f(x)).

Given
\( f(x) = x^2 - 2x + 1 \)
Self-Compose
\( f(f(x)) \)
Result
\( x^4 - 4x^3 + 6x^2 - 4x + 1 \)
Step 1: Recognize the self-composition

\( (f \circ f)(x) = f(f(x)) \)

We need to substitute f(x) wherever x appears in f(x)

Step 2: Set up the substitution

\( f(f(x)) = [f(x)]^2 - 2[f(x)] + 1 \)

Where \( f(x) = x^2 - 2x + 1 \)

Step 3: Calculate [f(x)]²

\( [f(x)]^2 = (x^2 - 2x + 1)^2 \)

\( = (x^2)^2 + (-2x)^2 + 1^2 + 2(x^2)(-2x) + 2(x^2)(1) + 2(-2x)(1) \)

\( = x^4 + 4x^2 + 1 - 4x^3 + 2x^2 - 4x \)

\( = x^4 - 4x^3 + 6x^2 - 4x + 1 \)

Step 4: Calculate -2[f(x)]

\( -2[f(x)] = -2(x^2 - 2x + 1) = -2x^2 + 4x - 2 \)

Step 5: Combine all terms

\( f(f(x)) = [f(x)]^2 - 2[f(x)] + 1 \)

\( = (x^4 - 4x^3 + 6x^2 - 4x + 1) + (-2x^2 + 4x - 2) + 1 \)

\( = x^4 - 4x^3 + 6x^2 - 2x^2 - 4x + 4x + 1 - 2 + 1 \)

\( = x^4 - 4x^3 + 4x^2 \)

Step 6: Verify the calculation

Double-check by substituting a value, say x = 0:

\( f(0) = 0^2 - 2(0) + 1 = 1 \)

\( f(f(0)) = f(1) = 1^2 - 2(1) + 1 = 0 \)

\( x^4 - 4x^3 + 4x^2 \) at x = 0: \( 0 - 0 + 0 = 0 \) ✓

\( (f \circ f)(x) = x^4 - 4x^3 + 4x^2 \)
Self-Composition:

\( (f \circ f)(x) = x^4 - 4x^3 + 4x^2 \)

Applied Rules:

• Self-Composition: Substitute function into itself

• Polynomial Expansion: Expand binomial expressions

• Verification: Check with specific values

Comprehensive Theory & Applications
\( (f \circ g)(x) = f(g(x)) \)
Basic Composition
Associative
\((f \circ g) \circ h = f \circ (g \circ h)\)
Grouping doesn't matter
Non-Commutative
\(f \circ g \neq g \circ f\)
Order matters
Identity
\(f \circ I = I \circ f = f\)
I(x) = x
Domain
\( \text{dom}(f \circ g) = \{x \in \text{dom}(g) : g(x) \in \text{dom}(f)\} \)
Restrictions apply
Key Properties:

Domain Considerations: The range of the inner function must be contained in the domain of the outer function

Associativity: Composition is associative: (f ∘ g) ∘ h = f ∘ (g ∘ h)

Non-Commutativity: Generally f ∘ g ≠ g ∘ f

Identity Element: The identity function I(x) = x acts as an identity element

Advanced Techniques:
  1. Substitution method: Replace variable with entire function
  2. Domain analysis: Check restrictions at each step
  3. Pattern recognition: Identify when compositions simplify
  4. Algebraic simplification: Combine like terms and factor when possible
  5. Verification: Use specific values to check correctness
Memory Aid: Think "f of g of x" - work from inside out
Memory Aid: Like putting on socks then shoes - order matters!
Key Note: Always substitute the entire function, not just its value
Common Mistake: Forgetting domain restrictions after composition
Applications: Physics, engineering, computer science, economics
Exam Tips: Practice substitution, check domains, verify non-commutativity
Essential Rules:

• Composition Order: (f ∘ g)(x) = f(g(x)) - evaluate g first

• Domain Restriction: Range of g ⊆ Domain of f

• Non-Commutativity: f ∘ g ≠ g ∘ f in general

• Algebraic Substitution: Replace variable with entire function

• Verification: Check with specific values when possible

Questions & Answers

Question: When I compose functions algebraically, how do I know which function to substitute into which?

Answer: The notation tells you exactly which function goes where:

  • (f ∘ g)(x) means f(g(x)): Substitute g(x) into f(x)
  • (g ∘ f)(x) means g(f(x)): Substitute f(x) into g(x)
  • Read from right to left: The rightmost function is evaluated first

Think of it as a pipeline: (f ∘ g)(x) means x goes through g first, then through f. So you start with g(x) and plug that into f.

For example, if f(x) = x² and g(x) = x + 1:

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

Question: I often make mistakes when expanding expressions like (f ∘ g)(x). Any tips for getting the algebra right?

Answer: Here are some key strategies for accurate algebra:

  1. Work step-by-step: Don't try to do everything at once
  2. Use parentheses: Keep track of what you're substituting
  3. Expand systematically: For binomials, use FOIL or the formula (a + b)² = a² + 2ab + b²
  4. Combine like terms: Only add terms with the same degree
  5. Check your work: Substitute a simple value to verify your answer

For example, if you have f(x) = x² and g(x) = x + 3:

(f ∘ g)(x) = f(x + 3) = (x + 3)² = x² + 6x + 9

To check: when x = 0, g(0) = 3, f(3) = 9, and our formula gives 0 + 0 + 9 = 9 ✓

Question: Why does the order of function composition matter? Isn't it like multiplication where order doesn't matter?

Answer: Function composition is not commutative, unlike multiplication of numbers. This is because:

  • Sequential operations: f(g(x)) applies g first, then f
  • Different inputs: g(x) and f(x) operate on different inputs
  • Domain considerations: The outputs may not be compatible in reverse

Think of real-world examples:

  • Putting on socks then shoes ≠ putting on shoes then socks
  • Applying a discount then tax ≠ applying tax then discount

For example, with f(x) = x + 1 and g(x) = 2x:

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

These are different functions, demonstrating that order matters in composition.