Skip to main content
ExamExplained
NSW · Maths Advanced
Maths Advanced study scene
§-Syllabus dot point
NSWMaths AdvancedSyllabus dot point

When does a function have an inverse, and how do we form, evaluate and graph composite and inverse functions?

Form composite functions, determine when a function has an inverse, find and graph the inverse, and use restriction of domain to invert non-one-to-one functions

A focused answer to the HSC Maths Advanced dot point on composite and inverse functions. Composition order and domain, the horizontal line test, finding the inverse by swapping and solving, the reflection in y=xy = x, and restricting domains to invert non-one-to-one functions, with worked examples.

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

What this dot point is asking

NESA wants you to form composite functions fgf \circ g and gfg \circ f, determine when a function has an inverse using the horizontal line test or one-to-one criterion, find the inverse algebraically, sketch it as the reflection in y=xy = x, and restrict the domain of a non-one-to-one function so an inverse exists.

The answer

Composite functions

The composite fgf \circ g is the function (fg)(x)=f(g(x))(f \circ g)(x) = f(g(x)): apply gg first, then ff to the result.

Domain: xx must be in the domain of gg, and g(x)g(x) must be in the domain of ff. In other words, the natural domain of fgf \circ g is

{xdom(g):g(x)dom(f)}.\{x \in \text{dom}(g) : g(x) \in \text{dom}(f)\}.

Composition is not commutative: usually f(g(x))g(f(x))f(g(x)) \neq g(f(x)).

Composition is associative: (fg)h=f(gh)=f(g(h(x)))(f \circ g) \circ h = f \circ (g \circ h) = f(g(h(x))).

When does an inverse exist

A function ff has an inverse (on its given domain) if and only if it is one-to-one: every value of yy in the range comes from exactly one xx.

Equivalent test (the horizontal line test): every horizontal line meets the graph at most once. Strictly increasing or strictly decreasing functions are automatically one-to-one. Many "natural" functions like x2x^2, sinx\sin x, cosx\cos x, and x|x| are not one-to-one on their natural domain and need their domain restricted.

Finding an inverse algebraically

The inverse f1f^{-1} "undoes" ff: f1(f(x))=xf^{-1}(f(x)) = x for xdom(f)x \in \text{dom}(f) and f(f1(y))=yf(f^{-1}(y)) = y for yrange(f)y \in \text{range}(f).

To find f1f^{-1} from y=f(x)y = f(x):

  1. Swap xx and yy.
  2. Solve for yy in terms of xx.
  3. State the domain of f1f^{-1}, which is the range of ff.

The inverse graph

The graph of y=f1(x)y = f^{-1}(x) is the reflection of the graph of y=f(x)y = f(x) in the line y=xy = x. Point (a,b)(a, b) on ff corresponds to (b,a)(b, a) on f1f^{-1}. Horizontal asymptotes of ff become vertical asymptotes of f1f^{-1} and vice versa.

If ff is increasing, so is f1f^{-1}. If ff is decreasing, so is f1f^{-1}.

See the inverse appear as a reflection, stage by stage

Take f(x)=2x3f(x) = 2x - 3 (whose inverse is f1(x)=x+32f^{-1}(x) = \frac{x + 3}{2}, found below). The four panels build the inverse purely by reflecting in y=xy = x, with no algebra, so you can see why swapping coordinates is the same as mirroring.

Stage 1, draw the function and the mirror line. Plot y=f(x)=2x3y = f(x) = 2x - 3 and the dashed line y=xy = x. The line y=xy = x is the mirror; every point will be flipped across it. Mark the yy-intercept (0,3)(0, -3) to track later.

Function and the mirror line y equals xThe line y equals f of x equals two x minus three is drawn in accent, with the dashed mirror line y equals x. The y-intercept at zero minus three is marked.xy-33y = xy = f(x)(0, -3)Stage 1Draw y = f(x) = 2x - 3 and the mirror line y = x (dashed).

Stage 2, reflect a single point. Take a point on ff, say (2,1)(2, 1). Reflecting in y=xy = x swaps its coordinates to give (1,2)(1, 2). The connector between them crosses y=xy = x at right angles, which is exactly what "reflection in y=xy = x" means.

Reflecting a single point in the line y equals xThe point two one on y equals f of x reflects across the dashed line y equals x to the point one two, with a thin connector showing the coordinates swap.xy-33y = xy = f(x)(2, 1)(1, 2)Stage 2Reflect a point across y = x: (2, 1) becomes (1, 2). Coordinates swap.

Stage 3, reflect the whole graph. Reflect every point of ff in the same way and the images trace out a new straight line: y=f1(x)=x+32y = f^{-1}(x) = \frac{x + 3}{2}. The original ff is now muted; its mirror image is the inverse, in accent. Because ff is increasing, so is its inverse.

The inverse function as the reflection of fThe inverse y equals f inverse of x equals x plus three over two is the reflection of y equals f of x in the dashed line y equals x. The original f is muted and the inverse is in accent.xy-33y = xy = f(x)y = f⁻¹(x)Stage 3Reflect every point: y = f⁻¹(x) = (x + 3)/2, the mirror image of f in y = x.

Stage 4, read off the swapped intercepts. The reflection swaps the axes, so the yy-intercept of ff at (0,3)(0, -3) becomes the xx-intercept of f1f^{-1} at (3,0)(-3, 0). This is the graphical face of "domain and range swap" and is a quick way to sketch an inverse without finding its equation.

Swapped intercepts of f and its inverseThe y-intercept of f at zero minus three corresponds to the x-intercept of the inverse at minus three zero, showing coordinates swap under the reflection.xy-33y = xy = f(x)y = f⁻¹(x)(0, -3)(-3, 0)Stage 4Intercepts swap: f cuts the y-axis at (0, -3); f⁻¹ cuts the x-axis at (-3, 0).

Restricting the domain

For a non-one-to-one function ff, choose a domain on which ff is one-to-one, then invert. Different restrictions give different inverses.

  • f(x)=x2f(x) = x^2: restrict to x0x \ge 0 to get f1(x)=xf^{-1}(x) = \sqrt{x}. Restricting to x0x \le 0 gives f1(x)=xf^{-1}(x) = -\sqrt{x}.
  • f(x)=sinxf(x) = \sin x: standard restriction is π2xπ2-\frac{\pi}{2} \le x \le \frac{\pi}{2}. Inverse is arcsinx\arcsin x on [1,1][-1, 1].
  • f(x)=cosxf(x) = \cos x: standard restriction is 0xπ0 \le x \le \pi. Inverse is arccosx\arccos x on [1,1][-1, 1].

Operations and inverses

The inverse of a composition reverses the order:

(fg)1=g1f1,(f \circ g)^{-1} = g^{-1} \circ f^{-1},

provided both inverses exist on appropriate domains. Think of putting on socks then shoes: to undo, take off shoes then socks.

How exam questions ask about composite and inverse functions

These dot points are examined with a small set of recurring instructions. Translate each one to the method:

  • "Find f(g(x))f(g(x)) and g(f(x))g(f(x))." Substitute the inner function into the outer one, both ways, and simplify. They usually differ, so compute both; do not assume symmetry (2022 HSC Q18).
  • "State the domain of fgf \circ g." Two conditions: xx in the domain of gg, and g(x)g(x) in the domain of ff. The binding one is whichever restricts xx more.
  • "Find f1(x)f^{-1}(x)" or "find the inverse function." Swap xx and yy, solve for yy, and state the domain of f1f^{-1} (which is the range of ff).
  • "Does ff have an inverse?" or "is ff one-to-one?" Apply the horizontal line test, or argue ff is strictly increasing/decreasing. If it fails, the answer is no on that domain.
  • "State a restriction so that ff has an inverse, then find it." Pick an interval on which ff is monotonic (for x2x^2, take x0x \ge 0 or x0x \le 0), then invert; the restriction decides the sign of the square root (2021 HSC Q19).
  • "Sketch y=f(x)y = f(x) and y=f1(x)y = f^{-1}(x) on the same axes." Draw ff, draw y=xy = x dashed, and reflect; mark that intercepts and asymptotes swap axes. You do not need the inverse's equation to draw it.
  • "Show that g=f1g = f^{-1}" or "verify the inverse." Compute f(g(x))f(g(x)) (and/or g(f(x))g(f(x))) and show it simplifies to xx.
  • "Where do ff and f1f^{-1} meet?" For an increasing ff, intersections lie on y=xy = x, so solve f(x)=xf(x) = x.

Exam-style practice questions

Practice questions written in the style of NESA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

2022 HSC Q184 marksLet f(x)=2x3f(x) = 2 x - 3 and g(x)=x2g(x) = x^2. Find f(g(x))f(g(x)), g(f(x))g(f(x)), and the inverse function f1(x)f^{-1}(x).
Show worked answer →

Composition is "outside applied to inside".

f(g(x))=f(x2)=2x23f(g(x)) = f(x^2) = 2 x^2 - 3.

g(f(x))=g(2x3)=(2x3)2=4x212x+9g(f(x)) = g(2 x - 3) = (2 x - 3)^2 = 4 x^2 - 12 x + 9.

To invert ff, swap xx and yy and solve: x=2y3    y=x+32x = 2 y - 3 \implies y = \frac{x + 3}{2}.

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

Markers reward correct composition in both orders (they differ), the swap-and-solve method for the inverse, and a tidy final expression.

2021 HSC Q194 marksThe function f(x)=x2f(x) = x^2 is not one-to-one on R\mathbb{R}. State a domain restriction that makes ff one-to-one, find the inverse on that restricted domain, and state the domain and range of the inverse.
Show worked answer →

Restrict to x0x \ge 0. On this domain, ff is increasing and one-to-one, with range [0,)[0, \infty).

Inverse: swap xx and yy in y=x2y = x^2 to get x=y2x = y^2 with y0y \ge 0, so y=xy = \sqrt{x}.

f1(x)=xf^{-1}(x) = \sqrt{x} on domain [0,)[0, \infty) with range [0,)[0, \infty).

Markers expect a domain choice that yields a one-to-one function, a correct inverse derived by swap-and-solve with the right sign, and a domain and range that match.

Practice questions

Original practice questions graded from foundation to exam level, each with a full worked solution. Try them before revealing the solution.

foundation2 marksLet f(x)=3x+1f(x) = 3x + 1 and g(x)=x2g(x) = x^2. Find f(g(x))f(g(x)) and g(f(x))g(f(x)).
Show worked solution →

Substitute the inner function into the outer one, both ways. For f(g(x))f(g(x)), feed g(x)=x2g(x) = x^2 into ff:

f(g(x))=f(x2)=3x2+1.f(g(x)) = f(x^2) = 3x^2 + 1.

For g(f(x))g(f(x)), feed f(x)=3x+1f(x) = 3x + 1 into gg:

g(f(x))=g(3x+1)=(3x+1)2=9x2+6x+1.g(f(x)) = g(3x + 1) = (3x + 1)^2 = 9x^2 + 6x + 1.

Marker's note: one mark for f(g(x))=3x2+1f(g(x)) = 3x^2 + 1, one mark for g(f(x))=9x2+6x+1g(f(x)) = 9x^2 + 6x + 1 correctly expanded. Writing the same answer for both (assuming composition is commutative) loses a mark.

foundation3 marksFind the inverse function of f(x)=4x7f(x) = 4x - 7, then verify your answer by showing that f(f1(x))=xf(f^{-1}(x)) = x.
Show worked solution →

Swap xx and yy, then solve. Write y=4x7y = 4x - 7 and swap the variables:

x=4y74y=x+7y=x+74.x = 4y - 7 \quad\Rightarrow\quad 4y = x + 7 \quad\Rightarrow\quad y = \frac{x + 7}{4}.

So f1(x)=x+74f^{-1}(x) = \dfrac{x + 7}{4}.

Verify by composition. Substitute f1(x)f^{-1}(x) into ff:

f ⁣(x+74)=4x+747=(x+7)7=x.f\!\left(\frac{x + 7}{4}\right) = 4 \cdot \frac{x + 7}{4} - 7 = (x + 7) - 7 = x. \checkmark

Marker's note: one mark for the swap-and-solve method, one for f1(x)=x+74f^{-1}(x) = \frac{x + 7}{4}, one for the verification simplifying to xx. A verification that stops before the final =x= x does not earn the last mark.

core3 marksLet f(x)=x2f(x) = \sqrt{x - 2} with domain x2x \ge 2 and g(x)=x2+1g(x) = x^2 + 1. Find f(g(x))f(g(x)) and state its natural domain.
Show worked solution →

Substitute gg into ff.

f(g(x))=g(x)2=(x2+1)2=x21.f(g(x)) = \sqrt{g(x) - 2} = \sqrt{(x^2 + 1) - 2} = \sqrt{x^2 - 1}.

Apply both domain conditions. First xx must be in the domain of gg, which is all of R\mathbb{R}. Second, g(x)g(x) must be in the domain of ff, so g(x)2g(x) \ge 2:

x2+12x21x1 or x1.x^2 + 1 \ge 2 \quad\Rightarrow\quad x^2 \ge 1 \quad\Rightarrow\quad x \le -1 \text{ or } x \ge 1.

The natural domain of fgf \circ g is (,1][1,)(-\infty, -1] \cup [1, \infty).

Marker's note: one mark for x21\sqrt{x^2 - 1}, one for setting up g(x)2g(x) \ge 2, one for the domain x1x \le -1 or x1x \ge 1. Reading the domain straight off x210\sqrt{x^2 - 1} \ge 0 (giving the same answer here by luck) misses the required g(x)dom(f)g(x) \in \text{dom}(f) reasoning and is penalised when the two disagree.

core4 marksThe function f(x)=e2x3f(x) = e^{2x} - 3 has domain all real numbers. (a) State the range of ff. (b) Find f1(x)f^{-1}(x) and state its domain.
Show worked solution →

Part (a): find the range. Since e2x>0e^{2x} > 0 for every real xx, we have e2x3>3e^{2x} - 3 > -3. As xx \to \infty, f(x)f(x) \to \infty, and as xx \to -\infty, f(x)3f(x) \to -3 from above. So the range is (3,)(-3, \infty).

Part (b): invert by swap-and-solve. Write y=e2x3y = e^{2x} - 3 and swap:

x=e2y3e2y=x+3.x = e^{2y} - 3 \quad\Rightarrow\quad e^{2y} = x + 3.

Take natural logs and solve for yy:

2y=ln(x+3)y=12ln(x+3).2y = \ln(x + 3) \quad\Rightarrow\quad y = \frac{1}{2}\ln(x + 3).

So f1(x)=12ln(x+3)f^{-1}(x) = \dfrac{1}{2}\ln(x + 3). Its domain is the range of ff, namely (3,)(-3, \infty).

Marker's note: one mark for the range (3,)(-3, \infty) in (a); one for isolating e2y=x+3e^{2y} = x + 3, one for f1(x)=12ln(x+3)f^{-1}(x) = \frac{1}{2}\ln(x + 3), one for the domain (3,)(-3, \infty) in (b). Forgetting the factor of 12\frac{1}{2} (writing ln(x+3)\ln(x + 3)) is the common slip.

core3 marksA graph shows two curves drawn on the same axes together with the dashed line y=xy = x. The first curve is an increasing exponential-shaped curve passing through the points (0,1)(0, 1) and (1,4)(1, 4) with the xx-axis as a horizontal asymptote. The second curve passes through (1,0)(1, 0) and (4,1)(4, 1) with the yy-axis as a vertical asymptote. Explain, using two specific features read from the graph, why the second curve is the inverse of the first.
Show worked solution →

Feature 1: the points are reflected in y=xy = x. The first curve passes through (0,1)(0, 1) and (1,4)(1, 4). Reflecting each point in y=xy = x swaps its coordinates, giving (1,0)(1, 0) and (4,1)(4, 1), which are exactly the two points the second curve passes through. Every point (a,b)(a, b) on the first curve corresponds to (b,a)(b, a) on the second.

Feature 2: the asymptote swaps axes. The first curve has the xx-axis (a horizontal asymptote); under reflection in y=xy = x a horizontal asymptote becomes a vertical one, and indeed the second curve has the yy-axis as its asymptote. This is the graphical signature of domain and range swapping.

Because the two curves are mirror images in y=xy = x (matching swapped points and swapped asymptotes), the second is the inverse of the first.

Marker's note: one mark for identifying the swapped points (0,1) ⁣ ⁣(1,0)(0,1)\!\to\!(1,0) and (1,4) ⁣ ⁣(4,1)(1,4)\!\to\!(4,1), one for the horizontal-to-vertical asymptote swap, one for the conclusion tying both to reflection in y=xy = x. A vague "they look symmetrical" without naming specific swapped features caps the answer at one mark.

exam5 marksLet f(x)=3x+1x3f(x) = \dfrac{3x + 1}{x - 3} for x3x \ne 3. (a) Show that ff is its own inverse, that is f(f(x))=xf(f(x)) = x. (b) Hence, or otherwise, find the exact coordinates of any point where the graph of y=f(x)y = f(x) meets the line y=xy = x.
Show worked solution →

Part (a): compute f(f(x))f(f(x)). The outer rule is f(u)=3u+1u3f(u) = \dfrac{3u + 1}{u - 3}; here the input is u=f(x)=3x+1x3u = f(x) = \dfrac{3x + 1}{x - 3}. Build the numerator and denominator separately, clearing the inner fraction by writing each over (x3)(x - 3).

Numerator 3u+13u + 1:

3u+1=3(3x+1)x3+1=3(3x+1)+(x3)x3=9x+3+x3x3=10xx3.3u + 1 = \frac{3(3x + 1)}{x - 3} + 1 = \frac{3(3x + 1) + (x - 3)}{x - 3} = \frac{9x + 3 + x - 3}{x - 3} = \frac{10x}{x - 3}.

Denominator u3u - 3:

u3=3x+1x33=(3x+1)3(x3)x3=3x+13x+9x3=10x3.u - 3 = \frac{3x + 1}{x - 3} - 3 = \frac{(3x + 1) - 3(x - 3)}{x - 3} = \frac{3x + 1 - 3x + 9}{x - 3} = \frac{10}{x - 3}.

Divide; the common factor (x3)(x - 3) cancels:

f(f(x))=10x/(x3)10/(x3)=10x10=x.f(f(x)) = \frac{10x / (x - 3)}{10 / (x - 3)} = \frac{10x}{10} = x. \checkmark

Since f(f(x))=xf(f(x)) = x, the function undoes itself, so f=f1f = f^{-1}.

Part (b): meet the line y=xy = x. Because ff is its own inverse, its graph is symmetric in y=xy = x, and any intersection with that line solves f(x)=xf(x) = x:

3x+1x3=x3x+1=x(x3)=x23xx26x1=0.\frac{3x + 1}{x - 3} = x \quad\Rightarrow\quad 3x + 1 = x(x - 3) = x^2 - 3x \quad\Rightarrow\quad x^2 - 6x - 1 = 0.

Solve with the quadratic formula:

x=6±(6)24(1)(1)2=6±402=6±2102=3±10.x = \frac{6 \pm \sqrt{(-6)^2 - 4(1)(-1)}}{2} = \frac{6 \pm \sqrt{40}}{2} = \frac{6 \pm 2\sqrt{10}}{2} = 3 \pm \sqrt{10}.

Both values satisfy x3x \ne 3, so the graph meets y=xy = x at (3+10,3+10)\left(3 + \sqrt{10}, \, 3 + \sqrt{10}\right) and (310,310)\left(3 - \sqrt{10}, \, 3 - \sqrt{10}\right).

Marker's note: two marks for correctly building and simplifying f(f(x))f(f(x)) to xx (writing each of 3u+13u + 1 and u3u - 3 over x3x - 3 is the key step), one for stating f=f1f = f^{-1}; one for reducing f(x)=xf(x) = x to x26x1=0x^2 - 6x - 1 = 0, one for both exact points 3±103 \pm \sqrt{10}. Leaving the intersection as a decimal without the exact surd form is penalised.

exam4 marksThe function f(x)=x24x+7f(x) = x^2 - 4x + 7 is defined on the restricted domain x2x \ge 2. (a) Explain why this restriction makes ff one-to-one. (b) Find f1(x)f^{-1}(x) and state its domain.
Show worked solution →

Part (a): show one-to-one on x2x \ge 2. Complete the square:

f(x)=x24x+7=(x2)2+3.f(x) = x^2 - 4x + 7 = (x - 2)^2 + 3.

The vertex is at x=2x = 2. For x2x \ge 2 the factor (x2)2(x - 2)^2 is strictly increasing, so ff is strictly increasing on this domain. A strictly increasing function passes the horizontal line test, so it is one-to-one and an inverse exists.

Part (b): invert on the restricted branch. From y=(x2)2+3y = (x - 2)^2 + 3, swap xx and yy:

x=(y2)2+3(y2)2=x3.x = (y - 2)^2 + 3 \quad\Rightarrow\quad (y - 2)^2 = x - 3.

Take the square root. Because the restriction x2x \ge 2 forces y2y \ge 2 on the inverse (the range endpoint carries over), choose the positive root:

y2=x3y=2+x3.y - 2 = \sqrt{x - 3} \quad\Rightarrow\quad y = 2 + \sqrt{x - 3}.

So f1(x)=2+x3f^{-1}(x) = 2 + \sqrt{x - 3}. The domain of f1f^{-1} is the range of ff; since the minimum value of ff on x2x \ge 2 is f(2)=3f(2) = 3, the range is [3,)[3, \infty), so the domain of f1f^{-1} is [3,)[3, \infty).

Marker's note: one mark for completing the square and arguing strictly increasing (hence one-to-one) in (a); one for reaching (y2)2=x3(y - 2)^2 = x - 3, one for choosing ++\sqrt{\,} with a reason and writing f1(x)=2+x3f^{-1}(x) = 2 + \sqrt{x - 3}, one for the domain [3,)[3, \infty) in (b). Taking -\sqrt{\,} (which suits the x2x \le 2 branch instead) is the classic sign error.

ExamExplained