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

Note that $f^{-1}(x)$ is not $\dfrac{1}{f(x)}$: the superscript $-1$ here names the inverse function, not a reciprocal.

(−2, 4) (2, 4) y = 4 y = x² O x y −2 2 nhánh x < 0 (dropped when restricted) nhánh x ≥ 0 kept: one-to-one
The horizontal line test, read by eye. The dashed line $y=4$ cuts the parabola at two points, so there are two values of $x$ that both give $y=4$; such a function cannot have an inverse, because $f^{-1}(4)$ would have to return two numbers at once. Cut off the grey branch ($x<0$) and each horizontal line meets the graph only once, and $f^{-1}(x)=\sqrt{x}$ exists. The figure also lets you read directly two quantities that questions often ask for: the range of the retained branch is $y\ge 0$, and if you keep the grey branch instead of the blue one, the inverse function would be $-\sqrt{x}$ rather than $\sqrt{x}$. In other words, the phrase "restrict the domain" is not only there to make the inverse exist — it also determines the sign of the inverse function.

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.

Common mistake

Stating the domain of a composite function by looking at the simplified formula. For example with $f(x)=\dfrac{1}{x-2}$ and $g(x)=\sqrt{x}$: the composite is $(f\circ g)(x)=\dfrac{1}{\sqrt{x}-2}$, and that formula only "fails" when $\sqrt{x}=2$, i.e. $x=4$. But the correct domain is $x\ge 0$ and $x\neq 4$. The mechanism: the condition $x\ge 0$ comes from $g$, and once $g$ has been substituted in, it leaves no trace on the page. The student writes the final formula and reads the condition from it — a reasonable procedure that loses exactly half. The same error also occurs the other way: with $(g\circ f)(x)=\sqrt{\dfrac{1}{x-2}}$ we must have $x-2>0$ (not $\ge$, and not $x\neq 2$). A self-protecting habit: write the two condition lines before substituting, and only then simplify.

Key takeaway

A composite function is read from the inside out, and its domain always has two conditions. An inverse function is the opposite: the formula is the easy part, the domain is the part that earns marks — and the domain of $f^{-1}$ must be copied from $f$, not read from the formula just found.

← The binomial theorem, counting and rational indices · All IB Math AA lessons · Practice IB Math AA questions (free, instant scoring) · Quadratic functions, the discriminant and restricted ranges →