← Back to course

Math — Mechina

Composition of functions and the inverse function

Summary

Composition (g∘f)(x)=g(f(x))(g\circ f)(x)=g(f(x)): first apply ff, then feed the result into gg. The inverse function f−1f^{-1} "undoes" ff: if f(a)=bf(a)=b then f−1(b)=af^{-1}(b)=a. It exists only when ff is one-to-one (each value is taken once).

Notation

g∘fg\circ f
Composition: gg after ff (read right to left)
f−1f^{-1}
The inverse function — not 1f\frac1f
(f−1)′(b)(f^{-1})'(b)
The derivative of the inverse at the point bb
f−1(f(x))=x,f(f−1(y))=y,(f−1)′(b)=1f′(a)  (f(a)=b)f^{-1}(f(x))=x,\qquad f(f^{-1}(y))=y,\qquad (f^{-1})'(b)=\frac{1}{f'(a)}\ \ (f(a)=b)
  • Finding f−1f^{-1}: write y=f(x)y=f(x), isolate xx, and swap the names. y=2x+3⇒x=y−32y=2x+3\Rightarrow x=\frac{y-3}2, so f−1(x)=x−32f^{-1}(x)=\frac{x-3}2.
  • A value of the inverse: f−1(b)f^{-1}(b) = the solution of f(x)=bf(x)=b. Usually you guess a "nice" solution (x=0x=0, 11, −1-1).
  • Graph: the graph of f−1f^{-1} is the reflection of ff in y=xy=x. The domain and the range swap.
  • Derivative: (f−1)′(b)=1f′(a)(f^{-1})'(b)=\frac1{f'(a)} — compute f′f' at the point a=f−1(b)a=f^{-1}(b), not at bb.
  • Inner function: given g(f(x))g(f(x)) and ff, set u=f(x)u=f(x), i.e. x=f−1(u)x=f^{-1}(u). Example: g(ln⁡x)=x+3⇒g(u)=eu+3g(\ln x)=x+3\Rightarrow g(u)=e^u+3.
-112345-112345xyff⁻¹y=x
ff and f−1f^{-1} are symmetric about the line y=xy=x.

Question types

1

Composition and the inner function

You are given g∘fg\circ f or f∘gf\circ g, and asked for one of the functions or a value.

Worked example

f(x)=ln⁡xf(x)=\ln x, and (g∘f)(x)=2x−1(g\circ f)(x)=2x-1 for every x>0x>0. Find g(x)g(x) and g(1)g(1).

Solution

Ideagg receives ln⁡x\ln x. Call it uu and write xx in terms of it.
  1. g(ln⁡x)=2x−1g(\ln x)=2x-1.

    Why: g∘fg\circ f = gg of ff.

  2. u=ln⁡x⇒x=euu=\ln x\Rightarrow x=e^u.

    Why: The inverse of ln⁡\ln.

  3. g(u)=2eu−1g(u)=2e^u-1.

    Why: Substitute.

  4. g(1)=2e−1≈4.44g(1)=2e-1\approx4.44.
Checkg(ln⁡x)=2eln⁡x−1=2x−1g(\ln x)=2e^{\ln x}-1=2x-1 ✓.
Common mistakeg(x)=2ln⁡x−1g(x)=2\ln x-1 — confusing gg with g∘fg\circ f.

Variants of this type · 2

1.1Double composition

Worked example

f(x)=2x−1f(x)=2x-1. Compute f(f(f(1)))f(f(f(1))) and (f∘f)(x)(f\circ f)(x).

Solution

IdeaFrom the inside out.
  1. f(1)=1f(1)=1, so f(f(f(1)))=1f(f(f(1)))=1.
  2. f(f(x))=2(2x−1)−1=4x−3f(f(x))=2(2x-1)-1=4x-3.
Check4⋅1−3=14\cdot1-3=1 ✓.
Common mistakef(f(x))=(2x−1)2f(f(x))=(2x-1)^2 — composition is not multiplication.
1.2The order of composition

Worked example

f=x2f=x^2, g=x+1g=x+1. Is f∘g=g∘ff\circ g=g\circ f?

Solution

IdeaCompute both.
  1. f(g(x))=(x+1)2f(g(x))=(x+1)^2.
  2. g(f(x))=x2+1g(f(x))=x^2+1.
  3. They differ (at x=1x=1: 4≠24\neq2).
Check✓.
Common mistakeAssuming the order does not matter.
2

The value of an inverse function

You are asked for f−1(b)f^{-1}(b) of a function where xx cannot be isolated (such as x3+xx^3+x or 2ex+x2e^x+x).

Worked example

f(x)=x3+2x+1f(x)=x^3+2x+1. Compute f−1(4)f^{-1}(4).

Solution

Ideaf−1(4)f^{-1}(4) is the xx with f(x)=4f(x)=4. Guess a small number.
  1. Solve x3+2x+1=4x^3+2x+1=4.

    Why: Definition of the inverse.

  2. x=1x=1: 1+2+1=41+2+1=4 ✓.

    Why: A guess.

  3. f′=3x2+2>0f'=3x^2+2>0, so ff is increasing and x=1x=1 is the only solution.

    Why: The inverse exists and is unique.

  4. f−1(4)=1f^{-1}(4)=1.
Checkf(1)=4f(1)=4 ✓.
Common mistakePlugging 44 into ff: f(4)=73f(4)=73.

Variants of this type · 1

2.1Isolating xx

Worked example

f(x)=2x+1x−3f(x)=\frac{2x+1}{x-3}. Find f−1(x)f^{-1}(x).

Solution

Ideay=f(x)y=f(x), isolate xx.
  1. y(x−3)=2x+1⇒x(y−2)=3y+1y(x-3)=2x+1\Rightarrow x(y-2)=3y+1.
  2. f−1(x)=3x+1x−2f^{-1}(x)=\frac{3x+1}{x-2}.
Checkf(0)=−13f(0)=-\frac13, f−1(−13)=0−73=0f^{-1}(-\frac13)=\frac{0}{-\frac73}=0 ✓.
Common mistakeForgetting to take xx out as a common factor.
3

The derivative of an inverse function

You are asked for (f−1)′(b)(f^{-1})'(b) or the slope of a tangent to the graph of the inverse.

Worked example

f(x)=3ex+2xf(x)=3e^x+2x. Compute (f−1)′(3)(f^{-1})'(3).

Solution

Idea(f−1)′(b)=1f′(a)(f^{-1})'(b)=\frac1{f'(a)} where f(a)=bf(a)=b.
  1. Find aa: 3ea+2a=3⇒a=03e^a+2a=3\Rightarrow a=0.

    Why: 3e0+0=33e^0+0=3.

  2. f′(x)=3ex+2f'(x)=3e^x+2, so f′(0)=5f'(0)=5.

    Why: Differentiate ff.

  3. (f−1)′(3)=15(f^{-1})'(3)=\frac15.
CheckThe slopes of a function and its inverse at matching points are reciprocals: 5⋅15=15\cdot\frac15=1 ✓.
Common mistakeComputing 1f′(3)=13e3+2\frac1{f'(3)}=\frac1{3e^3+2} — at the wrong point.

Variants of this type · 1

3.1A tangent to the graph of the inverse

Worked example

f(x)=x3+xf(x)=x^3+x. The equation of the tangent to f−1f^{-1} at the point where x=2x=2.

Solution

Ideaf(1)=2f(1)=2, so the point is (2,1)(2,1) and the slope 1f′(1)\frac1{f'(1)}.
  1. f′(1)=4f'(1)=4, slope 14\frac14.
  2. y=1+14(x−2)y=1+\frac14(x-2).
CheckThe point (2,1)(2,1) is on the graph of the inverse ✓.
Common mistakeThe point (1,2)(1,2) — swapping the coordinates the wrong way.

Practice · 20

Test yourself with problems and full solutions.

Go to practice