FUNCTIONS · STRUCTURE

Composition and inverse functions

Composition chains functions together. An inverse function reverses a function. Together, these ideas explain how multi-step processes are built and undone.

x
input
f(x)
first output
g(f(x))
final output

1. Function composition

The composition of \(g\) with \(f\) means “apply \(f\) first, then apply \(g\).”

\[(g\circ f)(x)=g(f(x))\]
Order matters. In general, \(g\circ f\neq f\circ g\). Composition is usually not commutative.

Example

Let \(f(x)=2x+1\) and \(g(x)=x^2\). Then

\[(g\circ f)(x)=(2x+1)^2\qquad (f\circ g)(x)=2x^2+1\]

The results differ because the functions are applied in different orders.

2. Domain of a composition

For \((g\circ f)(x)\) to exist, two conditions must hold: \(x\) must belong to the domain of \(f\), and the value \(f(x)\) must belong to the domain of \(g\).

\[D_{g\circ f}=\{x\in D_f\mid f(x)\in D_g\}\]

Example: if \(f(x)=x-3\) and \(g(u)=\sqrt{u}\), then \((g\circ f)(x)=\sqrt{x-3}\), so \(x\ge3\).

3. What is an inverse function?

An inverse reverses the input-output relationship of a function. If \(f(a)=b\), then its inverse satisfies \(f^{-1}(b)=a\).

\[f^{-1}\circ f=\operatorname{id}\qquad\text{and}\qquad f\circ f^{-1}=\operatorname{id}\]

Here \(\operatorname{id}(x)=x\). The notation \(f^{-1}\) means inverse function, not \(1/f\).

When does an inverse exist?

A function has an inverse on its full codomain when it is bijective. At minimum, it must be one-to-one on the domain being inverted.

Horizontal line test

A real graph represents a one-to-one function exactly when every horizontal line intersects it at most once.

4. Finding an inverse algebraically

Find the inverse of \(f(x)=3x-5\).

Step 1Write \(y=3x-5\).
Step 2Swap the roles of input and output: \(x=3y-5\).
Step 3Solve for \(y\): \(x+5=3y\), hence \(y=(x+5)/3\).
\[f^{-1}(x)=\frac{x+5}{3}\]

5. Verifying an inverse

The strongest algebraic check is composition in both directions.

\[f(f^{-1}(x))=3\left(\frac{x+5}{3}\right)-5=x\]
\[f^{-1}(f(x))=\frac{(3x-5)+5}{3}=x\]

Both compositions return the identity, confirming the inverse.

6. Graphical interpretation

The graph of \(f^{-1}\) is the reflection of the graph of \(f\) across the line \(y=x\). Swapping every point \((a,b)\) to \((b,a)\) exactly reverses input and output.

Domain and range swap

\(D_{f^{-1}}=R_f\) and \(R_{f^{-1}}=D_f\).

Restriction may be necessary

For example, \(f(x)=x^2\) is not one-to-one on all real numbers, but restricting to \(x\ge0\) gives inverse \(f^{-1}(x)=\sqrt{x}\).

7. Common mistakes

Confusing inverse and reciprocal: \(f^{-1}(x)\neq1/f(x)\). Ignoring domain restrictions: an inverse may exist only after restricting the original domain. Reversing composition order: \((g\circ f)(x)\) means \(f\) first, then \(g\).

8. Practice

Let \(f(x)=x+4\) and \(g(x)=2x\). Find \((g\circ f)(x)\), \((f\circ g)(x)\), and \(f^{-1}(x)\).

Solution

\((g\circ f)(x)=2x+8\), \((f\circ g)(x)=2x+4\), and \(f^{-1}(x)=x-4\).

Related topics