Composite and Inverse Functions AA SL

A composite function feeds the output of one function into another, and an inverse function undoes what a function does. This page shows how to form and evaluate a composite function in the right order, how to find an inverse by swapping and rearranging, and how to state the domain of an inverse, with worked examples and exam-style questions.

Formulas at a glance

None of the results on this page are in the formula booklet. Composite function notation, the inverse function and the cancelling rule are definitions and properties you are expected to know.

Composite function notation

(f∘g)(x)=f(g(x))(f\circ g)(x) = f(g(x))

Not in the booklet

Inverse cancels the original function

(f∘f−1)(x)=(f−1∘f)(x)=x(f\circ f^{-1})(x)=(f^{-1}\circ f)(x)=x

Not in the booklet

Visualising an inverse

Graph of f−1f^{-1} = reflection of ff in y=xy=x

Not in the booklet

Working out the domain of an inverse

Domain of f−1f^{-1} = Range of ff

Not in the booklet

Which method to use

Work from the inside out for composites, and swap xx and yy for inverses.

The question asks you toDo thisWatch for
Find an expression for (f∘g)(x)(f\circ g)(x)Replace every xx in ff with the whole expression g(x)g(x), then simplify(f∘g)(x)(f\circ g)(x) is usually not the same as (g∘f)(x)(g\circ f)(x)
Evaluate (f∘g)(a)(f\circ g)(a) for a number aaFind g(a)g(a) first, then apply ff to that valueThe function written next to xx acts first
State the domain of f∘gf\circ gStart with the domain of gg, then remove any xx for which g(x)g(x) is not allowed in ffFor example, f(x)=xf(x)=\sqrt{x} needs g(x)≥0g(x)\ge0
Solve (f∘g)(x)=k(f\circ g)(x)=kBuild the composite first, then solve the equationCheck each solution is in the domain
Find f−1(x)f^{-1}(x)Write y=f(x)y=f(x), swap xx and yy, then make yy the subjectThe domain of f−1f^{-1} is the range of ff
Find f−1(a)f^{-1}(a), or solve f(x)=af(x)=aSolving f(x)=af(x)=a gives x=f−1(a)x=f^{-1}(a), so use whichever is quickerWhen the formula for ff is simple, solve the equation directly
Decide whether an inverse existsCheck that ff is one-to-one: every output comes from one input onlyRestrict the domain if it is not, for example x2x^2 with x≥0x\ge0
Check an inverseShow that (f∘f−1)(x)=x(f\circ f^{-1})(x)=xThe graph of f−1f^{-1} is the reflection of the graph of ff in y=xy=x
Write down the domain or range of f−1f^{-1}Swap the two: domain of f−1f^{-1} is the range of ff, and range of f−1f^{-1} is the domain of ffRead the range of ff from its restricted domain

Section 1 of 2 SL2.5

Composite functions

A composite function applies one function to the output of another: (f∘g)(x)=f(g(x))(f\circ g)(x)=f(g(x)) means apply gg first, then ff. To find it, substitute the whole expression for g(x)g(x) into ff wherever xx appears, then simplify. The order matters, because (f∘g)(x)(f\circ g)(x) and (g∘f)(x)(g\circ f)(x) are usually different.

Composite function notation

This is a definition rather than a formula-booklet entry, so it's worth being fluent with the notation itself.

Work from the inside out

Evaluate (or substitute for) the innermost function first, then carry that result outward one layer at a time.

This applies just as well when three or more functions are chained together, e.g. (f∘g∘h)(x)(f\circ g\circ h)(x).

Key terms

What is the inner function?

In f(g(x))f(g(x)), gg is the inner function because it acts on xx first. Its output becomes the input of the outer function ff.

e.g. If f(x)=x+5f(x)=x+5 and g(x)=3xg(x)=3x, then (f∘g)(x)=3x+5(f\circ g)(x)=3x+5, with gg applied first.

How do you find a composite function algebraically?

Write the outer function with brackets where xx is, then put the whole inner function inside the brackets and simplify.

e.g. For f(x)=x2+1f(x)=x^2+1 and g(x)=x−3g(x)=x-3, (f∘g)(x)=(x−3)2+1=x2−6x+10(f\circ g)(x)=(x-3)^2+1=x^2-6x+10.

How do you evaluate a composite function at a number?

Work from the inside out: evaluate the inner function at the number, then evaluate the outer function at that result.

e.g. With f(x)=x2f(x)=x^2 and g(x)=x+1g(x)=x+1: g(2)=3g(2)=3, then f(3)=9f(3)=9, so (f∘g)(2)=9(f\circ g)(2)=9.

What is the identity function?

The identity function leaves every input unchanged, so its output is just xx. A function composed with its inverse gives this result.

e.g. If f(x)=2xf(x)=2x and g(x)=x2g(x)=\dfrac x2, then (f∘g)(x)=2×x2=x(f\circ g)(x)=2\times\dfrac x2=x.

Worked example, step by step

The question No calculator needed [4 marks]

Let f(x)=2x−5f(x)=2x-5 and g(x)=x2+1g(x)=x^2+1.

(a) Find an expression for (g∘f)(x)(g\circ f)(x), giving your answer in the form ax2+bx+cax^2+bx+c.

(b) Solve (g∘f)(x)=10(g\circ f)(x)=10.

Worked solution: worked example

Answer: (a) (g∘f)(x)=4x2−20x+26(g\circ f)(x)=4x^2-20x+26. (b) x=1x=1 or x=4x=4.

Step 1 - Read the order.

(g∘f)(x)=g(f(x))(g\circ f)(x)=g(f(x)). The function ff acts first and its output goes into gg, so f(x)=2x−5f(x)=2x-5 is the inner function.

Why? The function nearest to xx is applied first. Writing g(f(x))g(f(x)) out in full before you substitute stops the two functions being swapped, which is the most common slip on this topic.

Step 2 - Substitute the inner function.

In g(x)=x2+1g(x)=x^2+1, replace every xx with 2x−52x-5: g(f(x))=(2x−5)2+1.g(f(x))=(2x-5)^2+1. M1 - Substitute f(x)f(x) into gg: (2x−5)2+1(2x-5)^2+1

Why? Every xx in the outer function is replaced by the whole expression for the inner function, so keep that expression in brackets. Without the brackets, only the 55 would be squared.

Step 3 - Expand and simplify.

(2x−5)2+1=4x2−20x+25+1=4x2−20x+26.(2x-5)^2+1=4x^2-20x+25+1=4x^2-20x+26. A1 - 4x2−20x+264x^2-20x+26

Why? The question asks for the form ax2+bx+cax^2+bx+c, so multiply out the bracket and collect the constants. Remember the middle term of (2x−5)2(2x-5)^2 is 2×2x×(−5)=−20x2\times2x\times(-5)=-20x.

Step 4 - Set the composite equal to 10.

4x2−20x+26=10⇒4x2−20x+16=0⇒x2−5x+4=0.4x^2-20x+26=10\quad\Rightarrow\quad4x^2-20x+16=0\quad\Rightarrow\quad x^2-5x+4=0. M1 - Set the composite equal to 1010 and rearrange to a quadratic equation

Why? Now that the composite is a single expression in xx, solving (g∘f)(x)=10(g\circ f)(x)=10 is an ordinary quadratic equation. Move everything to one side and divide by the common factor 44 to make it easier to factorise.

Step 5 - Solve.

(x−1)(x−4)=0⇒x=1 or x=4.(x-1)(x-4)=0\quad\Rightarrow\quad x=1\ \text{or}\ x=4. A1 - x=1x=1 and x=4x=4

Why? Both solutions are valid, because ff and gg are defined for every real number.

Step 6 - Check.

For x=1x=1: f(1)=−3f(1)=-3 and g(−3)=10g(-3)=10. For x=4x=4: f(4)=3f(4)=3 and g(3)=10g(3)=10. Both give 1010.

Why? Substituting a solution into ff and then into gg uses the original functions, so it also catches an error in the composite itself.

Marks (4):
M1 Substitute f(x)f(x) into gg: (2x−5)2+1(2x-5)^2+1
A1 4x2−20x+264x^2-20x+26
M1 Set the composite equal to 1010 and rearrange to a quadratic equation
A1 x=1x=1 and x=4x=4

Now you try: enter your answers to be marked

These are real practice questions. Type your answer in each box and press Mark it. The worked solution and mark scheme appear straight away, and your first attempt is the one that counts. Use the keyboard for powers, roots and trig, and the working box for your notes.

1
Easy
No calc
[3 marks]
Let f(x)=x−4f(x)=x-4 and g(x)=3xg(x)=3x.

Find;
(a) (f∘g)(2)(f\circ g)(2)
[2]
(b) (g∘f)(2)(g\circ f)(2)
[1]
Fractions & powers
Other

Worked solution: practice question 1

2
Medium
No calc
[4 marks]
Let f(x)=xf(x)=\sqrt{x} and g(x)=x+5g(x)=x+5.
(a) Find (f∘g)(x)(f\circ g)(x).
[2]
(b) State the domain of f∘gf\circ g.
[2]
Fractions & powers
Other

Worked solution: practice question 2

3
Hard
No calc
[5 marks]
Let f(x)=x2f(x)=x^{2} and g(x)=2x−1g(x)=2x-1.

Solve (f∘g)(x)=(g∘f)(x)(f\circ g)(x)=(g\circ f)(x).
[5]
Fractions & powers
Other

Worked solution: practice question 3

Your score so far: 0 out of 12 marks

Common mistakes

  • Evaluating a composite function in the wrong order. (f∘g)(x)≠(g∘f)(x)(f\circ g)(x)\neq(g\circ f)(x) in general - work out the inner function first, and check carefully which letter is written first.
  • Reading (f∘g)(x)(f\circ g)(x) as f(x)g(x)f(x)g(x). The small circle is composition, not multiplication - there's no product of ff and gg happening here at all.
  • Skipping a layer in a triple composite. With something like (f∘g∘h)(x)(f\circ g\circ h)(x), substituting two functions in at once instead of working strictly inside-out is a common source of algebra slips.

Try some questions on composite functions

Section 2 of 2 SL2.2 SL2.5

Inverse functions

The inverse function f−1f^{-1} reverses ff, so that (f∘f−1)(x)=(f−1∘f)(x)=x(f\circ f^{-1})(x)=(f^{-1}\circ f)(x)=x. To find it, write y=f(x)y=f(x), swap xx and yy, and rearrange to make yy the subject. Only a one-to-one function has an inverse, and the graph of f−1f^{-1} is the reflection of the graph of ff in the line y=xy=x.

How inverses behave

None of these are formula-booklet entries - they're properties you're expected to know and use directly.

Domain of an inverse

Domain of f−1=Range of f\text{Domain of } f^{-1} = \text{Range of } f

Not in the booklet - prior knowledge. Input and output swap roles when you invert, so their domains and ranges swap too.

Key terms

What is a one-to-one function?

A one-to-one function gives a different output for every different input, so each output comes from exactly one input. Only such a function has an inverse.

e.g. f(x)=3x+1f(x)=3x+1 is one-to-one, but f(x)=x2f(x)=x^2 is not, because f(2)=f(−2)=4f(2)=f(-2)=4.

How do you check that an inverse is correct?

Compose it with the original function. If (f∘f−1)(x)=x(f\circ f^{-1})(x)=x, the inverse is correct.

e.g. For f(x)=2x+6f(x)=2x+6 and f−1(x)=x−62f^{-1}(x)=\dfrac{x-6}{2}: f(f−1(x))=2×x−62+6=xf\left(f^{-1}(x)\right)=2\times\dfrac{x-6}{2}+6=x.

How are the graphs of ff and f−1f^{-1} related?

They are reflections of each other in the line y=xy=x. If (a,b)(a,b) is on the graph of ff, then (b,a)(b,a) is on the graph of f−1f^{-1}.

e.g. If the graph of f(x)=2xf(x)=2x passes through (3,6)(3,6), then the graph of f−1f^{-1} passes through (6,3)(6,3).

How do you restrict a domain so that an inverse exists?

For a function that is not one-to-one, restrict the domain to a part where it is, such as one side of the vertex of a parabola. The inverse then exists on that restricted domain.

e.g. f(x)=x2f(x)=x^2 is not one-to-one, but restricting to x≥0x\ge0 gives the inverse f−1(x)=xf^{-1}(x)=\sqrt{x}.

Worked example, step by step

The question No calculator needed [5 marks]

Let f(x)=4x−1+2f(x)=\dfrac{4}{x-1}+2, for x∈Rx\in\mathbb{R}, x≠1x\ne1.

(a) Find f−1(x)f^{-1}(x).

(b) Write down the domain of f−1f^{-1}.

(c) Solve f(x)=6f(x)=6.

Worked solution: worked example

Answer: (a) f−1(x)=1+4x−2f^{-1}(x)=1+\dfrac{4}{x-2}. (b) x∈Rx\in\mathbb{R}, x≠2x\ne2. (c) x=2x=2.

Step 1 - Make x the subject.

Write y=4x−1+2y=\dfrac{4}{x-1}+2. Then y−2=4x−1⇒x−1=4y−2⇒x=1+4y−2.y-2=\dfrac{4}{x-1}\quad\Rightarrow\quad x-1=\dfrac{4}{y-2}\quad\Rightarrow\quad x=1+\dfrac{4}{y-2}. M1 - Write y=f(x)y=f(x) and make xx the subject

Why? An inverse undoes ff, so you solve for the input xx in terms of the output yy. Subtract 22 first so that the fraction is on its own, then take the reciprocal of both sides.

Step 2 - Swap x and y.

Replace yy by xx to write the inverse as a function of xx: f−1(x)=1+4x−2.f^{-1}(x)=1+\dfrac{4}{x-2}. A1 - f−1(x)=1+4x−2f^{-1}(x)=1+\dfrac{4}{x-2}

Why? The input of a function is always written as xx, so after rearranging you rename the variable. This is the step that is easy to forget.

Step 3 - Find the domain from the range of f.

The fraction 4x−1\dfrac{4}{x-1} is never zero, so f(x)f(x) never equals 22. The range of ff is all real numbers except 22, so the domain of f−1f^{-1} is x≠2x\ne2. A1 - Domain x≠2x\ne2

Why? The domain of f−1f^{-1} is the range of ff, because the outputs of ff become the inputs of f−1f^{-1}. It also matches the formula: f−1(x)f^{-1}(x) is undefined when x=2x=2.

Step 4 - Use the inverse to solve f(x) = 6.

If f(x)=6f(x)=6 then x=f−1(6)x=f^{-1}(6). So x=1+46−2=1+1=2.x=1+\dfrac{4}{6-2}=1+1=2. M1 - Use x=f−1(6)x=f^{-1}(6) A1 - x=2x=2

Why? Solving f(x)=af(x)=a is the same as finding f−1(a)f^{-1}(a), because the inverse takes an output of ff back to its input. Here that avoids having to solve the equation from scratch, since you already have f−1f^{-1}.

Step 5 - Check.

f(2)=42−1+2=6f(2)=\dfrac{4}{2-1}+2=6, which is the value in the question. Also 6≠26\ne2, so 66 is in the domain of f−1f^{-1}.

Why? Putting the answer back into ff confirms both the inverse and the arithmetic.

Marks (5):
M1 Write y=f(x)y=f(x) and make xx the subject
A1 f−1(x)=1+4x−2f^{-1}(x)=1+\dfrac{4}{x-2}
A1 Domain x≠2x\ne2
M1 Use x=f−1(6)x=f^{-1}(6)
A1 x=2x=2

Now you try: enter your answers to be marked

1
Easy
No calc
[3 marks]
Find f−1(x)f^{-1}(x) for f(x)=5x−2f(x)=5x-2.
[3]
Fractions & powers
Other

Worked solution: practice question 1

2
Medium
No calc
[4 marks]
Let f(x)=x+2x−1f(x)=\dfrac{x+2}{x-1}, x≠1x\ne1.

Find f−1(x)f^{-1}(x).
[4]
Fractions & powers
Other

Worked solution: practice question 2

3
Hard
No calc
[5 marks]
For f(x)=(x−1)2+2f(x)=(x-1)^{2}+2, x≥1x\ge1, find f−1(x)f^{-1}(x) and state its domain.
(a)(i) Find f−1(x)f^{-1}(x).
[3]
(a)(ii) State its domain.
[2]
Fractions & powers
Other

Worked solution: practice question 3

Your score so far: 0 out of 12 marks

Common mistakes

  • Confusing f−1(x)f^{-1}(x) with 1f(x)\dfrac{1}{f(x)}. The −1-1 here means "inverse function", not "reciprocal" - these are almost always different expressions.
  • Assuming every function has an inverse. An inverse function only exists for a one-to-one function - if two inputs share an output, the domain needs restricting first.
  • Swapping xx and yy inconsistently. When finding an inverse, every xx must become yy and every yy must become xx at the same step - missing one leads to an equation that won't rearrange cleanly.

Try some questions on inverse functions

Using your GDC

The exact key presses for the TI-84 Plus CE, Casio fx-CG50, Casio fx-CG100 and TI-Nspire CX, with what the screen shows. Pick your calculator.

Evaluate a function at a point

Used in: Composite functions, Inverse functions

How to evaluate a function at a point on a TI-84 Plus CE

Call the function from the home screen

Press Y= and type the function into Y1: X,T,θ,n ^ 3 − 2 X,T,θ,n + 1.

Y1=X^3-2X+1

Press 2nd mode (QUIT) to return to the home screen. Press vars, then ▶ to open the Y-VARS menu, choose 1:Function and then 1:Y1. Use this menu rather than typing the letter Y and the number 1.

Type the x-value in brackets, ( 2 . 5 ), and press enter.

f(2.5)=11.625f(2.5) = 11.625, which is 11.611.6 to 3 significant figures.

Y1(2.5)
11.625
Another way: the table

Press 2nd window (TBLSET) and set Indpnt to Ask, then press 2nd graph (TABLE). The table is empty. Type 2 . 5 and press enter: the Y1 column fills in.

X | Y1
2.5 | 11.625
Another way: trace the graph

Press graph to draw the graph, then trace. Type 2 . 5 (an X= prompt appears) and press enter. The cursor jumps to that x-value and the bottom of the screen shows the point.

X=2.5
Y=11.625

Y1( from the Y-VARS menu is the exact route: the answer is the function's value, not a cursor position. Use the table when you want several values.

The full guide: Evaluate a function at a point

Enter a function and draw its graph

Used in: Inverse functions

How to enter a function and draw its graph on a TI-84 Plus CE

Enter the function in Y= and draw it

Press Y=. If there are old functions, move to each one with ▲ or ▼ and press clear to erase it. A function is only drawn while the = sign beside it is highlighted.

Plot1 Plot2 Plot3
\Y1=
\Y2=
\Y3=

With the cursor next to Y1=, type X,T,θ,n x² − 4 X,T,θ,n + 3. The calculator uses X,T,θ,n for xx.

Plot1 Plot2 Plot3
\Y1=X²-4X+3
\Y2=
\Y3=

Press window and set Xmin = −2, Xmax = 6, Ymin = −2, Ymax = 8, leaving Xscl and Yscl as 1. For a negative number use the (−) key, not the subtraction key.

WINDOW
Xmin=-2
Xmax=6
Xscl=1
Ymin=-2
Ymax=8
Yscl=1

Press graph.

The curve is an upward-opening parabola. It meets the yy-axis at y=3y = 3.

Draw more than one function, or hide one

Type the next function next to Y2= (press ▼ to reach it) and press graph again: every function whose = sign is highlighted is drawn. To keep a function but not draw it, move onto its = sign with ◀ and press enter, so the highlight disappears. Press enter again to turn it back on.

If the graph is blank or cut off

Press zoom and choose 6:ZStandard to draw with the standard window, or choose 0:ZoomFit, which keeps your Xmin and Xmax and sets Ymin and Ymax so the whole curve fits. Choosing a window by hand is in set a good viewing window.

For a graph that contains sin, cos or tan, check the angle mode first: press mode and see switching between degrees and radians.

If the graph does not appear, the cause is usually the window, not the function. Look at the window values before you retype anything.

The full guide: Enter a function and draw its graph

See the full list of GDC guides for every calculator task.

Syllabus content covered

CodeSyllabus content
SL2.2Informal concept that an inverse function reverses or undoes the effect of a function. Inverse function as a reflection in the line y=xy=x, and the notation f−1(x)f^{-1}(x). Students should be aware that inverse functions exist for one-to-one functions; the domain of f−1(x)f^{-1}(x) is equal to the range of f(x)f(x). Example: solving f(x)=10f(x)=10 is equivalent to finding f−1(10)f^{-1}(10).
SL2.5Composite functions, (f∘g)(x)=f(g(x))(f\circ g)(x)=f(g(x)). Identity function. Finding the inverse function f−1(x)f^{-1}(x), including (f∘f−1)(x)=(f−1∘f)(x)=x(f\circ f^{-1})(x)=(f^{-1}\circ f)(x)=x. The existence of an inverse for one-to-one functions.

Official IB source: Mathematics: analysis and approaches subject brief (PDF, ibo.org).

Quick questions

What does f composed with g mean?

(f∘g)(x)(f\circ g)(x) means f(g(x))f(g(x)) - substitute xx into gg first, then take that result and substitute it into ff. It is generally not the same as (g∘f)(x)(g\circ f)(x).

How do you find the inverse of a function?

Write y=f(x)y=f(x), swap xx and yy, then rearrange to make yy the subject again - the result is f−1(x)f^{-1}(x).

Does the order of composition matter?

Yes. (f∘g)(x)(f\circ g)(x) and (g∘f)(x)(g\circ f)(x) usually give different expressions, because the inner function is applied first and changes what gets fed into the outer function.

Does every function have an inverse?

No - only a one-to-one function has an inverse. If two different inputs give the same output, the domain needs restricting before an inverse can exist.

How do I find xx when (f∘g)(x)(f\circ g)(x) equals a given number?

First find the expression for (f∘g)(x)(f\circ g)(x), then set it equal to the number and solve. For f(x)=2x+1f(x)=2x+1 and g(x)=x2g(x)=x^2, (f∘g)(x)=2x2+1=19(f\circ g)(x)=2x^2+1=19 gives x2=9x^2=9, so x=±3x=\pm3.

How do I find f−1(5)f^{-1}(5) without finding the whole inverse?

Solve f(x)=5f(x)=5 for xx. For f(x)=2x−3f(x)=2x-3, 2x−3=52x-3=5 gives x=4x=4, so f−1(5)=4f^{-1}(5)=4.

Is (f∘g)(x)(f\circ g)(x) the same as f(x)×g(x)f(x)\times g(x)?

No. The product multiplies two outputs, whereas the composite feeds one output into the other function. For f(x)=x+1f(x)=x+1 and g(x)=x2g(x)=x^2 the product is (x+1)x2(x+1)x^2, but f(g(x))=x2+1f(g(x))=x^2+1.

How do I find the inverse of a function that contains an exponential?

Swap and rearrange, using the logarithm to undo the exponential. For f(x)=3exf(x)=3e^{x}: x=3eyx=3e^{y}, so ey=x3e^{y}=\dfrac x3 and f−1(x)=ln⁡(x3)f^{-1}(x)=\ln\left(\dfrac x3\right).

Can I compose a function with itself?

Yes, (f∘f)(x)=f(f(x))(f\circ f)(x)=f(f(x)). For f(x)=2x−1f(x)=2x-1, f(f(x))=2(2x−1)−1=4x−3f(f(x))=2(2x-1)-1=4x-3.

Can a function be its own inverse?

Yes. For f(x)=6−xf(x)=6-x, swapping gives x=6−yx=6-y, so y=6−xy=6-x and f−1(x)=f(x)f^{-1}(x)=f(x). Its graph is symmetric about the line y=xy=x.

Ready to practise properly?

Practice questions on every section, marked instantly like the real exam.