Domain, range, composite and inverse functions
IB Math AA · Functions
Domain, range and function notation
The domain of $f$ is the set of inputs for which $f(x)$ is defined; the range is the set of outputs actually produced. Unless a domain is stated, take the largest set of real numbers for which the formula makes sense: no division by zero, and no square root of a negative number.
Composite functions
$(f\circ g)(x)=f\left(g(x)\right)$: apply $g$ first, then $f$. In general $f\circ g\neq g\circ f$.
The domain of $f\circ g$ is the set of $x$ in the domain of $g$ for which $g(x)$ lies in the domain of $f$. Both conditions must be checked; the formula that comes out at the end does not record the first one.
Inverse functions
$f^{-1}$ exists only if $f$ is one-to-one: every horizontal line meets the graph at most once. Then
$$f^{-1}\left(f(x)\right)=x\quad\text{and}\quad f\left(f^{-1}(x)\right)=x$$The graph of $y=f^{-1}(x)$ is the reflection of $y=f(x)$ in the line $y=x$. Consequently
- domain of $f^{-1}$ = range of $f$;
- range of $f^{-1}$ = domain of $f$.
Note that $f^{-1}(x)$ is not $\dfrac{1}{f(x)}$: the superscript $-1$ here names the inverse function, not a reciprocal.
Worked example: two composite functions and the equation setting them equal
Given $f(x)=3x-2$ and $g(x)=x^{2}+1$. Find $(f\circ g)(x)$ and $(g\circ f)(x)$, then solve the equation $(f\circ g)(x)=(g\circ f)(x)$.
Solution
The two composite functions. Substitute the whole expression, not letter by letter:
$$(f\circ g)(x)=f\left(x^{2}+1\right)=3\left(x^{2}+1\right)-2=3x^{2}+1$$$$(g\circ f)(x)=g\left(3x-2\right)=\left(3x-2\right)^{2}+1=9x^{2}-12x+5$$Set them equal.
$$3x^{2}+1=9x^{2}-12x+5\;\Longrightarrow\;6x^{2}-12x+4=0\;\Longrightarrow\;3x^{2}-6x+2=0$$$$x=\frac{6\pm\sqrt{36-24}}{6}=\frac{6\pm 2\sqrt{3}}{6}=1\pm\frac{\sqrt{3}}{3}$$The two solutions are approximately $0.4226$ and $1.5774$. Quick check with $x=1$: $(f\circ g)(1)=4$ while $(g\circ f)(1)=2$ — different, as expected because $x=1$ lies between the two solutions.
Worth remembering: $(f\circ g)$ and $(g\circ f)$ are two entirely different functions, and the equation setting them equal usually has solutions — just finitely many, not an identity.
Worked example: inverse of a rational function and its domain
Given $f(x)=\dfrac{2x+1}{x-3}$ with $x\neq 3$. Find $f^{-1}(x)$, then state the domain and range of $f^{-1}$.
Solution
Let $y=f(x)$ and solve backwards for $x$.
$$y=\frac{2x+1}{x-3}\;\Longrightarrow\;y(x-3)=2x+1\;\Longrightarrow\;yx-3y=2x+1$$Collect all the $x$ terms on one side:
$$x(y-2)=3y+1\;\Longrightarrow\;x=\frac{3y+1}{y-2}$$$$f^{-1}(x)=\frac{3x+1}{x-2}$$The domain comes from the original function, not from the new formula. The function $f$ has horizontal asymptote $y=2$ so the range of $f$ is $y\neq 2$; hence the domain of $f^{-1}$ is $x\neq 2$. The domain of $f$ is $x\neq 3$ so the range of $f^{-1}$ is $y\neq 3$.
Here the new formula happens to say the same thing ($x-2\neq 0$), but this coincidence only occurs for linear-over-linear rational functions. With $f(x)=x^{2}$ on $x\ge 0$, the formula $f^{-1}(x)=\sqrt{x}$ does not record the condition $x\ge 0$ of the original function.