Composition gives you a new way to look at two ideas you already know. An inverse is the function that, composed with f, takes every number back to where it started. And every transformation you’ve done, like stretches and shifts, is really a composition with a simple linear function. Trig functions here use radians, and logx means log10x.
Let g(x)=A(x+B), a linear function. Composing it with f in the two different orders gives the two kinds of transformations.
g on the inside: horizontal changes.
f(g(x))=f(A(x+B))
This is y=f(k(x−d)) with k=A and d=−B: a horizontal stretch or compression by a factor of ∣A∣1 (and a reflection in the y-axis if A<0), then a translation B units left (right if B<0).
g on the outside: vertical changes.
g(f(x))=A(f(x)+B)=Af(x)+AB
This is a vertical stretch by a factor of ∣A∣ (and a reflection in the x-axis if A<0), then a translation of AB units up. Notice that the vertical shift is AB, not B: the +B happens first, and then it gets stretched too.
So “inside” changes act on x (horizontally), and “outside” changes act on y (vertically), just as in combined transformations.
(a) Simplify f−1(f(x)) and f(f−1(x)), and state where each equals x.
(b) What goes wrong if you put x=−3 into the formula for f−1(f(x))?
Solution.
(a)
f−1(f(x))=(x2−4)+4=x2=∣x∣
This equals x for x≥0, which is exactly the domain of f. ✓
f(f−1(x))=(x+4)2−4=(x+4)−4=x
This works for x≥−4, the domain of f−1 (and the range of f). ✓
(b) (−3)2−4=5 and 5+4=3, so you get 3, not −3. That’s not a contradiction: −3 isn’t in the restricted domain of f, so the identity was never promised for it.
Let g(x)=21(x+4). For f(x)=x2, f(x)=x and f(x)=2x, find f(g(x)) and g(f(x)) and describe each as a transformation of f.
Solution. Here A=21 and B=4.
f(x)=x2.
f(g(x))=(21(x+4))2=41(x+4)2: a horizontal stretch by a factor of 2, then a translation 4 units left. Vertex (−4,0).
g(f(x))=21(x2+4)=21x2+2: a vertical compression by a factor of 21, then a translation AB=2, so 2 units up. Vertex (0,2).
f(x)=x.
f(g(x))=21(x+4): stretched horizontally by a factor of 2, then shifted 4 left. The graph starts at (−4,0), so the domain is {x∈R∣x≥−4} and the range stays {y∈R∣y≥0}. Check: (1,1) on y=x maps to (2(1)−4,1)=(−2,1), and 21(−2+4)=1=1. ✓
g(f(x))=21(x+4)=21x+2: compressed vertically by 21 and shifted 2 up. The domain is still {x∈R∣x≥0}, and the range is {y∈R∣y≥2}. It starts at (0,2) and passes through (4,3).
f(x)=2x.
f(g(x))=221(x+4): stretched horizontally by 2 and shifted 4 left. The asymptote stays y=0, the range stays {y∈R∣y>0}, and the point (0,1) moves to (−4,1). By the exponent laws, this also equals 22⋅2x/2=4⋅2x/2: for exponentials, a horizontal translation is the same as a vertical stretch (by a factor of 4 here).
g(f(x))=21(2x+4)=21⋅2x+2: compressed vertically by 21 and shifted 2 up. The asymptote moves to y=2, and the range is {y∈R∣y>2}. It passes through (0,2.5) and (1,3).
In every case, g on the inside changed things horizontally, and g on the outside changed things vertically.
Checking only one composition.f(g(x))=x alone isn’t enough to prove that f and g are inverses in general. Check both orders.
Ignoring the domain.x2 is ∣x∣, not x. The identity f−1(f(x))=x only holds for x in the domain of f, so a restricted domain matters.
Assuming 10logx=x for every x.10logx=x needs x>0; for x=−5, log(−5) doesn’t exist. (But log(10x)=x works for every real x.)
Getting the direction of the horizontal shift wrong.f(A(x+B)) shifts the graph B units left, the opposite of the sign you see. (21(x+4))2 moves 4 units left, not right.
Forgetting that the vertical shift gets stretched.g(f(x))=A(f(x)+B) moves the graph by AB, not B. With g(x)=21(x+4), g(f(x))=21f(x)+2, a shift of 2 up, not 4 up.
Confusing f−1 with f1.f−1(f(x))=x is about undoing. f(x)1⋅f(x)=1 is a different fact about reciprocals.
Both give x, so they’re inverses. Domain of f: {x∈R∣x=3}. Domain of g: {x∈R∣x=0}. (Each domain is the other’s range.)
6. (Core) Let f(x)=x2+2 for x≤0.
(a) Find f−1(x) and its domain.
(b) Verify that f−1(f(x))=x and f(f−1(x))=x on the right domains.
Solution
(a) Swap: x=y2+2, so y=±x−2. The range of f−1 must be the domain of f, y≤0, so take the negative root:
f−1(x)=−x−2,{x∈R∣x≥2}
(b) For x≤0:
f−1(f(x))=−(x2+2)−2=−x2=−∣x∣=x
The last step works because x≤0, so ∣x∣=−x. For x≥2:
f(f−1(x))=(−x−2)2+2=(x−2)+2=x
7. (Core) Let f(x)=cosx and g(x)=3(x−1). Find f(g(x)) and g(f(x)), and describe each as a transformation of y=cosx. State the range of each.
Solution
f(g(x))=cos(3(x−1)): a horizontal compression by a factor of 31 (period 32π), then a translation 1 unit right. The range is {y∈R∣−1≤y≤1}.
g(f(x))=3(cosx−1)=3cosx−3: a vertical stretch by a factor of 3, then a translation 3 units down. The range is {y∈R∣−6≤y≤0}.
8. (Challenge) Let f(x)=logx and g(x)=10(x+2).
(a) Find f(g(x)), and use a law of logarithms to show it is a vertical translation of y=log(x+2).
(b) Find g(f(x)) and state its domain.
Solution
(a)
f(g(x))=log(10(x+2))=log10+log(x+2)=1+log(x+2)
So y=log(10(x+2)), which is y=logx compressed horizontally by a factor of 101 and then shifted 2 left, is the same graph as y=log(x+2) translated up 1 unit. The domain is {x∈R∣x>−2}.
(b) g(f(x))=10(logx+2)=10logx+20. The domain is {x∈R∣x>0}.
9. (Challenge) Let f(x)=x2.
(a) Find all linear functions g(x)=A(x+B) with f(g(x))=9x2−12x+4.
(b) Show that h(x)=x−1x+5 is its own inverse by finding h(h(x)).
Solution
(a) 9x2−12x+4=(3x−2)2, so we need (g(x))2=(3x−2)2. That means g(x)=3x−2 or g(x)=−(3x−2)=−3x+2. In the form A(x+B):
g(x)=3(x−32)org(x)=−3(x−32)
(The second one includes a reflection in the y-axis, which doesn’t change the even function x2.)
Try these independently after the practice questions. Show your setup and explain your reasoning. Use exact answers where possible, and check that your answers fit the question. Homework solutions are not provided on the published site.
H1. (Foundations) A function f has an inverse, and f(−2)=7, f(3)=−4 and f(7)=0. Find each value, or explain how you know it.
(a) f−1(f(3))
(b) f(f−1(0))
(c) f−1(−4)
(d) f−1(f−1(0))
(e) f(f(−2))
H2. (Foundations) A taxi company in Halifax charges a $3.75 base fare plus $2.25 per kilometre (hypothetical rates). The function f(x)=3.75+2.25x gives the fare in dollars for a trip of x km.
(a) Find f−1(x). What does it calculate?
(b) Show by composition, in both orders, that your function really is the inverse of f.
(c) Find the fare for a 12 km trip. A rider paid $21.75. How long was the trip?
(d) In words, what does f−1(f(x))=x mean in this context?
(a) Show that f and g are inverses by composing in both orders.
(b) Evaluate g(11) and then f(g(11)).
(c) For x2 and x you had to restrict the domain, but here no restriction is needed. Explain why.
H4. (Core) Let f(x)=x−23x+1.
(a) Find f−1(x).
(b) Verify your answer by showing that f(f−1(x))=x and f−1(f(x))=x.
(c) State the domain and range of f and of f−1 in set notation, and explain how the asymptotes of the two graphs are related.
H5. (Core) Let f(x)=3x−1+2.
(a) Find f−1(x) and state its domain.
(b) Simplify f−1(f(x)) and f(f−1(x)), and state exactly where each one equals x.
(c) A classmate says, ”f(f−1(x))=x, so f(f−1(0))=0.” What is wrong with this?
(d) Describe y=f−1(x) as a transformation of y=log3x.
H6. (Core) Let f be any function.
(a) Find linear functions h and k so that y=3f(x−2)+1 is the same as y=h(f(k(x))). Which of h and k causes the horizontal change, and which causes the vertical change?
(b) Write g(x)=f(2x−6) as a composition f(m(x)) with a linear function m. Factor m(x) and describe the transformation that turns y=f(x) into y=g(x).
Now let f(x)=x.
(c) State the domain of g(x)=2x−6 in set notation. The point (4,2) is on y=x. Use mapping notation to find its image on y=g(x), and check that the image satisfies the equation.
“If f(x)=x2, then f−1(x)=x, so f−1(f(x))=x2=x for every real number x. Check: x=4 gives 16=4.”
(a) Test the student’s claim with x=−5.
(b) Explain what is wrong with the reasoning. Why did the check with x=4 not catch it?
(c) Give two different ways to restrict the domain of f(x)=x2 so that it has an inverse. For each, state f−1(x) and show that both compositions give x on the right domains.
H8. (Challenge) A function is self-inverse if f−1=f, which means f(f(x))=x.
(a) Let f(x)=x−2ax+3. Find all values of a for which f is self-inverse, and prove that your function works by computing f(f(x)).
(b) For your function from (a), check numerically using f(0) and then f(f(0)). What symmetry must the graph of a self-inverse function have?
(c) Find all linear functions f(x)=mx+b that are self-inverse. Describe their graphs.
H9. (Challenge) Let p(x)=2x and q(x)=x−3, and let f be any function.
(a) Find p(q(f(x))) and q(p(f(x))). Which one equals 2f(x)−6? Describe, in order, the two transformations each composition applies to the graph of y=f(x).
(b) Find f(p(q(x))) and f(q(p(x))). Which one equals f(2x−3)?
(c) For f(x)=x, where does the graph of y=f(2x−3) start? Explain how your answer to (b) predicts this.
H10. (Challenge) Let g(x)=−2log2(4x+8)+1.
(a) Write g(x)=h(f(k(x))) with f(x)=log2x and linear functions h and k. Describe the transformations of y=log2x in order, and give the mapping notation.
(b) Use a law of logarithms to show that g(x)=−2log2(x+2)−3.
(c) Find g−1(x), and verify by composition in both orders, stating the domains where each composition equals x.