Composite and Inverse Functions
1722 words
9 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Composite and Inverse Functions ## 🎯 Learning Objectives By the end of this topic, you will be able to: 1. **Compute** the composition $f \circ g$ of two functions 2.

Composite and Inverse Functions
🎯 Learning Objectives
By the end of this topic, you will be able to:
- Compute the composition f∘g of two functions
- Determine the domain of composite functions
- Test whether a function has an inverse using the horizontal line test
- Find the inverse of a function algebraically
- Verify inverse relationships using f(f−1(x))=f−1(f(x))=x
📋 Prerequisites
- Functions — domain, range, injective, surjective, bijective
- Exponential Functions — exponentials as injective functions
📖 Core Content
7.1 Composite Functions
7.1.1 Intuition: Function Chains
A composite function is applying one function, then another. Like a factory assembly line: raw material goes through machine g, then its output goes through machine f.
If g doubles a number and f squares it, then f(g(x)) means: first double, then square. g(f(x)) means: first square, then double — a different result!
💡 Why this matters: Composition is how we build complex transformations from simple ones. In ML, a neural network is a composition of linear transformations and activation functions.
7.1.2 Definition
The composition of f with g is:
Domain: {x∣x∈domain(g) AND g(x)∈domain(f)}
Key: Apply g first, then f to the result.
(Diagram)
7.1.3 Worked Examples
Example 1.1 (Easy): Let f(x)=x2 and g(x)=x+3. Find (f∘g)(2) and (g∘f)(2).
Step 1: (f∘g)(2)=f(g(2))=f(5)=25
Step 2: (g∘f)(2)=g(f(2))=g(4)=7
Example 1.2 (Medium): For f(x)=x and g(x)=2x−1, find (f∘g)(x) and its domain.
Step 1: (f∘g)(x)=f(g(x))=f(2x−1)=2x−1
Step 2 — Domain: Need 2x−1≥0⟹x≥1/2
Also 2x−1 must be in domain of f=[0,∞).
Example 1.3 (Hard): Given f(x)=x−11 and g(x)=xx+1, find (f∘g)(x) and its domain.
Step 1: (f∘g)(x)=f(xx+1)=xx+1−11=xx+1−x1=x11=x
Step 2 — Domain: g is undefined at x=0. g(x)=1 would make denominator 0 in f; solve xx+1=1⟹x+1=x⟹1=0 (impossible, so no extra restriction).
7.2 Inverse Functions
7.2.1 Intuition: Undoing a Function
An inverse function f−1 "undoes" what f did. If f is the "double" function (f(x)=2x), then f−1 is the "half" function (f−1(x)=x/2).
The inverse reverses the mapping: if f(a)=b, then f−1(b)=a.
💡 Why this matters: Inverses let us solve equations. If y=f(x) and we want x in terms of y, we use x=f−1(y). Logarithms are inverses of exponentials — used everywhere in data science.
7.2.2 Condition for Existence
A function has an inverse iff it is bijective (both injective and surjective). For functions with codomain = range, surjectivity is automatic if we set codomain = range. So the key condition is injective (one-to-one).
Horizontal Line Test: If every horizontal line hits the graph at most once, the function is injective and has an inverse.
| Function | HLT Pass? | Has Inverse? |
|---|---|---|
| f(x)=2x+3 | ✓ | Yes |
| f(x)=x2 (on R ) | ✗ | No |
| f(x)=x2 (on [0,∞) ) | ✓ | Yes ( x ) |
| f(x)=ex | ✓ | Yes ( lnx ) |
7.2.3 Finding the Inverse Algebraically
Recipe:
- Write y=f(x)
- Swap x and y
- Solve for y
- The result is y=f−1(x)
- Verify: f(f−1(x))=f−1(f(x))=x
7.2.4 Worked Examples
Example 2.1 (Easy): Find the inverse of f(x)=3x−5.
Step 1: y=3x−5
Step 2: Swap: x=3y−5
Step 3: Solve: x+5=3y⟹y=3x+5
Step 4: f−1(x)=3x+5
Verify: f(f−1(x))=3(3x+5)−5=x+5−5=x ✓
Example 2.2 (Medium): Find the inverse of f(x)=x−12x+1.
Step 1: y=x−12x+1
Step 2: Swap: x=y−12y+1
Step 3: Solve: x(y−1)=2y+1⟹xy−x=2y+1⟹xy−2y=x+1⟹y(x−2)=x+1⟹y=x−2x+1
Step 4: f−1(x)=x−2x+1
Example 2.3 (Hard): Find the inverse of f(x)=2x−3.
Step 1: y=2x−3 (domain x≥3/2, range y≥0)
Step 2: Swap: x=2y−3
Step 3: Square: x2=2y−3⟹y=2x2+3
Step 4: Domain of f−1 = range of f=[0,∞)
So f−1(x)=2x2+3 for x≥0.
Verify: f(f−1(x))=2⋅2x2+3−3=x2=x for x≥0 ✓
7.3 Domain and Range of Inverse
Key relationship:
- Domain of f−1 = Range of f
- Range of f−1 = Domain of f (Diagram)
📐 Key Formulas — Summary Table
| Concept | Formula | Notes |
|---|---|---|
| Composition | (f∘g)(x)=f(g(x)) | Apply g first |
| Composition domain | {x∈Dg∣g(x)∈Df} | Careful with restrictions |
| Inverse definition | f(f−1(x))=f−1(f(x))=x | |
| Inverse existence | f must be bijective | Injective necessary |
| Finding inverse | Swap x,y , solve for y | Algebraic method |
| Inverse domain | Df−1=Rf | |
| Inverse range | Rf−1=Df | |
| Graph of inverse | Reflection across y=x | Symmetry property |
⚠️ Common Pitfalls
Pitfall 1: Confusing f−1 with (f(x))−1=1/f(x)
Mistake: Thinking f−1(x)=f(x)1.
Correct: f−1 is the inverse function (undoes f). (f(x))−1=1/f(x) is the reciprocal. These are completely different! Example: f(x)=2x → f−1(x)=x/2, not 1/(2x).
Pitfall 2: Composition Order
Mistake: Computing (f∘g)(x) as g(f(x)).
Correct: (f∘g)(x)=f(g(x)) — apply g first, then f. The notation f∘g means "f after g."
Pitfall 3: Forgetting Domain Restrictions for Inverses
Mistake: Finding f−1(x)=x for f(x)=x2 without restricting domain.
Correct: f(x)=x2 on R has no inverse (fails HLT). On [0,∞), its inverse is x. On (−∞,0], its inverse is −x.
Pitfall 4: Swapping x and y Before Considering Domain
Mistake: Finding an algebraic expression for f−1 but ignoring domain restrictions.
Correct: After solving, check the domain of f−1 = range of original f.
📝 Practice Questions
Q1: If f(x)=x+2 and g(x)=x2, find (f∘g)(3) and (g∘f)(3).Strategy Hint: Apply inner function first.(f∘g)(3)=f(9)=11 (g∘f)(3)=g(5)=2511, 25 Q2: Find (f∘g)(x) for f(x)=x1 and g(x)=x−1.(f∘g)(x)=x−11x−11 Q3: Find the inverse of f(x)=4x+7.y=4x+7→x=4y+7→y=4x−7f−1(x)=4x−7 Q4: Does f(x)=x2+1 on R have an inverse? Why or why not?Strategy Hint: Check HLT.f(−2)=5=f(2) → not injective → no inverse.No — fails HLT Q5: Find the inverse of f(x)=x+3x−2.y=x+3x−2 Swap: x=y+3y−2→x(y+3)=y−2→xy+3x=y−2→xy−y=−3x−2→y(x−1)=−(3x+2)→y=1−x3x+2f−1(x)=1−x3x+2 Q6: If f(x)=2x and g(x)=3x−1, find (f∘g)(x).(f∘g)(x)=f(3x−1)=2(3x−1)=6x−26x−2 Q7: Verify that f(x)=x−1x and g(x)=x−1x are inverses.Strategy Hint: Check f(g(x))=x.f(g(x))=x−1x−1x−1x=x−1x−(x−1)x−1x=x−11x−1x=x ✓Yes, they are inverses Q8: What is the domain of (f∘g)(x) if f(x)=x and g(x)=x−5?g(x)=x−5 has domain all reals. But f requires non-negative input. So need x−5≥0→x≥5.[5,∞) Q9: Find the inverse of f(x)=ex+2.y=ex+2 Swap: x=ey+2 Take ln: lnx=y+2→y=lnx−2f−1(x)=lnx−2 Q10: If f and g are inverses, what is f(g(5))?By definition of inverse: f(g(x))=x, so f(g(5))=5.5 Q11: Find the inverse of f(x)=x3−1.y=x3−1 Swap: x=y3−1→y3=x+1→y=3x+1f−1(x)=3x+1 Q12: For f(x)=x1, find f−1(x). What do you notice?y=1/x, swap: x=1/y→y=1/x f−1(x)=1/x=f(x) — the function is self-inverse (involution).f−1(x)=x1=f(x)
🔗 Cross-References
- Previous topic: Exponential Functions
- Next topic: Logarithms — inverses of exponentials
- Related: Functions — injective, surjective, bijective concepts
- Across courses: BSMA1003 Maths 2 (inverse functions in calculus, inverse trigonometric functions) Join Discord Previous5.1 Exponential FunctionsNext6.1 Logarithmic Functions & Properties