Neural Sync Active
Composite and Inverse Functions
Registry Synced
Composite and Inverse Functions
1722 words
9 min read
Reading compass
Now ยท ๐ฏ Learning Objectives
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โxโ1โ=x1โ1โ=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โ11โxโ11โโ Q3: Find the inverse of f(x)=4x+7.y=4x+7โx=4y+7โy=4xโ7โfโ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+2โfโ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โ11โxโ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+1โfโ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