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)=3(x−2). For f(x)=x2, f(x)=sinx and f(x)=logx, find f(g(x)) and g(f(x)) and describe each as a transformation of f.
Solution. Here A=3 and B=−2.
f(x)=x2.
f(g(x))=(3(x−2))2=9(x−2)2: a horizontal compression by a factor of 31, then a translation 2 units right. Vertex (2,0).
g(f(x))=3(x2−2)=3x2−6: a vertical stretch by a factor of 3, then a translation AB=−6, so 6 units down. Vertex (0,−6).
f(x)=sinx.
f(g(x))=sin(3(x−2)): period 32π, translated 2 units right. The range stays {y∈R∣−1≤y≤1}.
g(f(x))=3(sinx−2)=3sinx−6: amplitude 3, axis y=−6, period still 2π. The range is {y∈R∣−9≤y≤−3}.
f(x)=logx.
f(g(x))=log(3(x−2)): compressed horizontally by 31 and shifted 2 right. The domain is {x∈R∣x>2} and the vertical asymptote is x=2. By the laws of logarithms, this also equals log3+log(x−2): for logarithms, a horizontal compression is the same as a vertical shift (up log3≈0.48).
g(f(x))=3(logx−2)=3logx−6: stretched vertically by 3 and shifted 6 down. The domain is still {x∈R∣x>0}, with asymptote x=0. It passes through (1,−6) and (10,−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. sin(3(x−2)) moves 2 units 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)=3(x−2), g(f(x))=3f(x)−6, a shift of 6 down, not 2 down.
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)=sinx and g(x)=2(x+1). Find f(g(x)) and g(f(x)), and describe each as a transformation of y=sinx. State the range of each.
Solution
f(g(x))=sin(2(x+1)): a horizontal compression by a factor of 21 (period π), then a translation 1 unit left. The range is {y∈R∣−1≤y≤1}.
g(f(x))=2(sinx+1)=2sinx+2: a vertical stretch by a factor of 2, then a translation 2 units up. The range is {y∈R∣0≤y≤4}.
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.)