← Back to Add Math 0606

1.2 Composite Functions

1. Definition & Formation

A composite function joins two functions together. fg(x) means we apply g first, then apply f to the result.

fg(x)=f(g(x))

Tip: Always read from right to left! "g acting on x, then f acting on that".

Visualizing the Process

xgfg(x)fg(x)Inner Function FirstOuter Function Second

Worked Examples : Definition & Formation

1.
Given the functions f(x)=2x−3 and g(x)=x2+1, find the expressions for fg(x) and gf(x).
1. Find fg(x): This means f(g(x)).
Replace x in f with g(x).
f(g(x))=2(g(x))−3
=2(x2+1)−3
=2x2+2−3
=2x2−1
2. Find gf(x): This means g(f(x)).
Replace x in g with f(x).
g(f(x))=(f(x))2+1
=(2x−3)2+1
=(4x2−12x+9)+1
=4x2−12x+10
2.
If h(x)=1x+2 and k(x)=x, find the value of hk(4). Explain the order of operations.
Method: Work from the inside out. Evaluate k(4) first.
k(4)=4=2
Now find h(2).
h(2)=12+2=14=0.25
Order: 4 goes into k, output (2) goes into h.
3.
Express the function y=(3x+5)4 as a composition of two simpler functions f and g where y=fg(x).
We need an inner function g and outer function f.
Looking at the structure, the "inner" operation is 3x+5.
Let g(x)=3x+5.
The "outer" operation is raising to the power of 4.
Let f(x)=x4.
Check: fg(x)=f(3x+5)=(3x+5)4. Correct.
4.
Given f(x)=sin⁡(x) and g(x)=2x, solve the equation fg(x)=0.5 for 0∘≤x≤180∘.
1. Form the composite:
fg(x)=f(2x)=sin⁡(2x)
2. Solve equation:
sin⁡(2x)=0.5
Let u=2x. Range for u: 0≤u≤360∘.
sin⁡(u)=0.5⟹u=30∘,150∘
3. Find x:
2x=30∘⟹x=15∘
2x=150∘⟹x=75∘
5.
Functions f,g,h are defined as f(x)=x+2, g(x)=3x, h(x)=x2. Find the expression for hgf(x).
Work from right to left (inside out). First f(x), then g, then h.
1. gf(x)=g(x+2)=3(x+2)=3x+6.
2. h(gf(x))=h(3x+6).
3. =(3x+6)2.
Expanded: 9x2+36x+36.
6.
Given f(x)=x+12, find f2(x) (which means ff(x)).
ff(x)=f(x+12)
=(x+12)+12
Multiply top and bottom by 2 to clear fractions:
=x+1+24
=x+34
7.
Functions f and g are defined by f(x)=2x−5 and g(x)=x2+3 for x∈R.
(a) Find an expression for fg(x).
fg(x)=f(g(x))=f(x2+3)
=2(x2+3)−5
=2x2+6−5=2x2+1.
(b) Find an expression for gf(x).
gf(x)=g(f(x))=g(2x−5)
=(2x−5)2+3
=(4x2−20x+25)+3=4x2−20x+28.
(c) Solve the equation gf(x) = 20.
4x2−20x+28=20
4x2−20x+8=0
Divide by 4: x2−5x+2=0.
Use formula: x=5±25−82=5±172.
8.
The function f is defined by f(x)=xx+1, x≠−1, and g(x)=3x−1.
(a) Find fg(x) in the form ax+bcx+d.
fg(x)=f(3x−1)=3x−1(3x−1)+1
=3x−13x.
(b) Solve the equation fg(x) = 1.
3x−13x=1
3x−1=3x.
−1=0.
This is a contradiction. There is no solution.
(c) State the value of x that must be excluded from the domain of fg.
Looking at fg(x)=3x−13x, the denominator can't be zero.
So x≠0.
9.
Given f(x)=cos⁡x and g(x)=2x+π3 for 0≤x≤π.
(a) Write down the expression for fg(x).
fg(x)=cos⁡(2x+π3).
(b) Find the exact value of fg(π6).
fg(π6)=cos⁡(2(π6)+π3)
=cos⁡(π3+π3)=cos⁡(2π3).
=−0.5.
(c) Solve fg(x) = -0.5 for the given domain.
cos⁡(2x+π3)=−0.5.
Principal value (PV): 2x+π3=2π3,4π3.
Case 1: 2x+π3=2π3⟹2x=π3⟹x=π6.
Case 2: 2x+π3=4π3⟹2x=π⟹x=π2.
10.
Functions f(x)=e2x and g(x)=ln⁡(x) are given for x>0.
(a) Find fg(x) in its simplest form.
fg(x)=e2ln⁡(x).
Use log laws: 2ln⁡x=ln⁡(x2).
fg(x)=eln⁡(x2)=x2.
(b) Find gf(x) in its simplest form.
gf(x)=ln⁡(e2x).
=2xln⁡e=2x.
(c) Are f and g inverse functions? Explain.
f and g are inverses only if fg(x)=x and gf(x)=x.
Here fg(x)=x2 and gf(x)=2x.
No, they are not inverses of each other (though related).
11.
Consider the function f(x)=x+2x−1 for x≠1.
(a) Determine the expression for f^2(x) (i.e. ff(x)).
ff(x)=(x+2x−1)+2(x+2x−1)−1.
Multiply top and bottom by (x−1):
=(x+2)+2(x−1)(x+2)−(x−1)
=x+2+2x−2x+2−x+1=3x3=x.
(b) Deduce the inverse function f^(-1)(x).
Since ff(x)=x, the function is its own inverse (self-inverse).
f−1(x)=f(x)=x+2x−1.
(c) Evaluate f^15(4).
Since f2(x)=x, repeated application cycles: f1=f,f2=I,f3=f...
Odd powers are just f(x).
f15(4)=f(4)=4+24−1=63=2.
12.
Given f(x)=3x+k and g(x)=x2. The equation fg(x)=gf(x) has no real solutions for x. Find the range of possible values for k.
(a) Form the equation fg(x) = gf(x).
fg(x)=3(x2)+k=3x2+k.
gf(x)=(3x+k)2=9x2+6kx+k2.
Equation: 3x2+k=9x2+6kx+k2.
(b) Rearrange into quadratic form.
0=6x2+6kx+(k2−k).
(c) Use discriminant condition.
For "no real solutions", discriminant D<0.
b2−4ac=(6k)2−4(6)(k2−k).
=36k2−24k2+24k.
=12k2+24k<0.
12k(k+2)<0.
Critical values at k=0,k=−2. Parabola opens up, so between roots.
Range: −2<k<0.

2. Domain and Range

For fg(x) to exist, the output of g must be a valid input for f.

  • Domain
    The set of inputs x into g such that g(x) is in the domain of f.
  • Range
    The set of final outputs from f, generated by feeding the range of g into f.
Domain gRange gDomain fRange fggfIssues arise if Range g ⊄ Domain f

Worked Examples : Domain and Range

1.
Let f(x)=x and g(x)=x−5. Find the domain of the composite function fg(x).
fg(x)=f(x−5)=x−5.
For the square root to be defined, the argument must be non-negative.
x−5≥0
x≥5
Note: The domain of fg is constrained by the requirement that the output of g must fit into the domain of f.
2.
Given f(x)=x2−2 with domain x∈R and g(x)=ln⁡x with domain x>0. Find the range of fg(x).
fg(x)=(ln⁡x)2−2.
1. Consder the range of inner function g(x)=ln⁡x. Since domain is x>0, ln⁡x can take any real value (−∞,∞).
2. Let u=ln⁡x. We need range of u2−2 where u∈R.
3. Minimum value of u2 is 0.
4. Minimum value of u2−2 is −2.
Range: fg(x)≥−2.
3.
Let f(x)=1x and g(x)=x−2. Explain why fg(2) is undefined.
Check the inner function first: g(2)=2−2=0.
Now try to pass this to f: f(0)=10.
Division by zero is undefined.
Therefore, x=2 must be excluded from the domain of fg(x).
4.
Given f(x)=2x+1,x≥0 and g(x)=x2,x∈R. Find the range of gf(x).
gf(x)=g(2x+1)=(2x+1)2.
1. Range of inner function f: Since x≥0, 2x+1≥1.
2. Now consider g(u)=u2 for domain u≥1.
3. Since u2 is increasing for positive u, the minimum is at 2=1.
Range: gf(x)≥1.
5.
Determine the domain of f(x)=ln⁡(1−x2) by viewing it as a composition.
Inner function g(x)=1−x2. Outer h(u)=ln⁡u.
h(u) requires u>0.
So we need 1−x2>0.
x2<1.
−1<x<1.
Domain: (−1,1).
6.
If f(x)=ex and g(x)=x, find the range of fg(x) if the domain of g is x≥0.
fg(x)=ex.
Since x≥0, x≥0.
The exponential function eu is strictly increasing.
Minimum value is when x=0, giving e0=1.
As x→∞, ex→∞.
Range: fg(x)≥1 (or [1,∞)).

3. Non-Commutativity

Order matters! In general, fg(x)≠gf(x).

Think of it like putting on socks and shoes.
Socks then Shoes: Result is dressed feet.
Shoes then Socks: Result is socks over shoes (very different!).

exceptions exist, e.g., if f(x)=x or if functions are inverses of each other.
xyfg(x) = 2x + 2gf(x) = 2x + 4Parallel but not equal!

Worked Examples : Non-Commutativity

1.
Let f(x)=3x and g(x)=x+2. Show algebraically that fg(x)≠gf(x).
fg(x)=f(x+2)=3(x+2)=3x+6.
gf(x)=g(3x)=3x+2.
Comparing the terms: 3x+6≠3x+2 (unless 0=4, impossible).
Thus composition is not commutative in this case.
2.
Find the value of k for which fg(x)=gf(x) for all x, given f(x)=2x+1 and g(x)=3x+k.
1. Find fg(x): 2(3x+k)+1=6x+2k+1.
2. Find gf(x): 3(2x+1)+k=6x+3+k.
3. Equate coefficient-free terms (constants):
2k+1=3+k.
4. Solve for k: k=2.
3.
Given f(x)=x2 and g(x)=x−1, solve the equation fg(x)=gf(x).
fg(x)=(x−1)2=x2−2x+1.
gf(x)=(x2)−1=x2−1.
Set equal: x2−2x+1=x2−1.
Subtract x2 from both sides: −2x+1=−1.
−2x=−2.
x=1.
4.
Explain with an example why fg(x) might exist even if gf(x) does not.
Let f(x)=x (Domain x≥0) and g(x)=x2 (Domain R).
fg(x)=x2=|x|. Defined for all x.
Consider a different case: f(x)=x+5,g(x)=−x. This is bad example.
Better example: f(x)=ln⁡x and g(x)=−x2−1.
f(g(x))=ln⁡(−x2−1). Since −x2−1 is always negative, this is never defined.
However, g(f(x))=−(ln⁡x)2−1 exists for x>0.
5.
Under what specific condition is fg(x)=gf(x)=x for all x?
This strictly happens when g is the inverse function of f, denoted as f−1.
If g(x)=f−1(x), then applying them in sequence returns the original input.
6.
Given f(x)=mx+c and g(x)=nx+d. Find the condition on m, n, c, d for commutativity (fg=gf).
fg(x)=m(nx+d)+c=mnx+md+c.
gf(x)=n(mx+c)+d=nmx+nc+d.
Slopes mn match. We need intercepts to match:
md+c=nc+d.
md−d=nc−c.
d(m−1)=c(n−1).
This is the condition. Useful special cases: if m=1,n=1, it always holds.