Instant PDF download, name-and-email checkout. Complete Book Bundle: every Economics, Statistics, Mathematics, Econometrics and Research Methods book
Mathematics

Composite and Inverse Functions: How to Find f(g(x)) and f⁻¹(x), with Currency and Tax Examples

Learn composite and inverse functions step by step: find f(g(x)) and f⁻¹(x), restrict domains, and solve a currency and tax case with worked examples.

In 30 seconds
  • A composite function \(f(g(x))\), often written \(fg(x)\), means “do \(g\) first, then do \(f\) to the result”.
  • An inverse function \(f^{-1}(x)\) undoes \(f\): it takes an output back to the input that produced it.
  • To find an inverse, write \(y = f(x)\), make \(x\) the subject, then swap the letters. Only one-one functions have inverses, so you may need to restrict the domain.
  • In our case, a $12 e-book costs a student in Pakistan Rs 4,002 after conversion, a fee and tax; the inverse function shows that a Rs 5,000 budget covers a list price of up to $15.09.
  • Exam point: \(fg(x)\) and \(gf(x)\) are usually different, and the graph of \(f^{-1}\) is the reflection of the graph of \(f\) in the line \(y = x\).

The case: what does a dollar price really cost?

Ayesha is a first-year student in Lahore. She wants to buy a study guide that an overseas website sells for $12. Her bank card pays in Pakistani rupees, so two things happen to the price before it reaches her statement.

First, the bank converts dollars to rupees. In our example it uses a rate of Rs 280 per dollar and adds a fixed card fee of Rs 120 per foreign transaction. Second, a 15% tax is charged on the whole rupee amount, fee included. (The figures are illustrative; real exchange rates, bank fees and tax rules change and differ between banks.)

Ayesha has two questions:

  • How many rupees will a $12 book cost her in total?
  • She has a monthly budget of Rs 5,000 for books. What is the most expensive book, in dollars, that she can afford?

The first question chains two steps together: convert, then tax. That is a composite function. The second question runs the chain backwards: start from the rupee total and recover the dollar price. That is an inverse function. This post shows how both work, how to find them by algebra, and what can go wrong.

The concept: functions in a chain, and functions in reverse

A function is a rule that takes each input from a set called the domain and gives exactly one output. The set of outputs is the range.[1] In the case, the conversion rule is one function and the tax rule is another.

Let \(c(x)\) be the rupee amount (including the fee) for a price of \(x\) dollars, and let \(t(y)\) be the total after tax on a rupee amount \(y\):

\[ c(x) = 280x + 120, \qquad t(y) = 1.15y \]

To find the final cost we put the output of \(c\) into \(t\). We write this as \(t(c(x))\), or in the shorter notation used by many exam boards, \(tc(x)\). The function written closest to \(x\) acts first. This feels backwards at first, because we read left to right, but the brackets make it clear: you work out the inside bracket first.

An inverse goes the other way. If \(f\) sends 3 to 10, then \(f^{-1}\) sends 10 back to 3. The notation \(f^{-1}\) does not mean \(\frac{1}{f}\); it is a name for the “undo” function. An inverse only exists if no two inputs share the same output. Such a function is called one-one (or injective). If two inputs gave the same output, the inverse would not know which one to return.[1]

Key termComposite and inverse functions: the composite \(fg\) is the function \(x \mapsto f(g(x))\), defined when the range of \(g\) lies inside the domain of \(f\). The inverse \(f^{-1}\) of a one-one function \(f\) is the function that satisfies \(f^{-1}(f(x)) = x\) for every \(x\) in the domain of \(f\); its domain is the range of \(f\) and its range is the domain of \(f\).
\[ fg(x) = f\big(g(x)\big), \qquad f^{-1}\big(f(x)\big) = f\big(f^{-1}(x)\big) = x \]

Here \(x\) is the input. \(g(x)\) is the output of the first function, and it becomes the input of \(f\). The symbol \(f^{-1}\) stands for the inverse of \(f\). The second pair of equations says that doing \(f\) and then \(f^{-1}\), in either order, returns you to where you started. That is the defining test of an inverse, and it is also the quickest way to check your answer.

Mathematics Made Simple textbook coverMathematics Made Simple explains composite and inverse functions with worked examples and graphs.Get the textbook · $12

Two facts about inverses are worth fixing in your mind now. First, the domain and range swap places. If \(f\) takes inputs \(x \ge 2\) and gives outputs \(f(x) \ge 1\), then \(f^{-1}\) takes inputs \(x \ge 1\) and gives outputs \(f^{-1}(x) \ge 2\). Second, the graph of \(y = f^{-1}(x)\) is the reflection of the graph of \(y = f(x)\) in the line \(y = x\). Every point \((a, b)\) on \(f\) becomes \((b, a)\) on \(f^{-1}\).[3]

Why this method fits the case

Ayesha’s problem is a natural chain. The tax rule cannot act until the conversion rule has produced a rupee amount. Writing each step as its own function keeps the steps separate and easy to change. If the bank raises its fee, only \(c\) changes. If the government changes the tax rate, only \(t\) changes. The composite \(tc\) then updates by itself.

The inverse fits the budget question because Ayesha knows the output (Rs 5,000) and wants the input (a dollar price). Rather than guessing prices and checking, she can build one formula that turns any rupee budget into a maximum dollar price. Shops, banks and economists use the same idea whenever they “gross up” or “net down” a figure: from a price including tax back to the price before tax, or from a converted amount back to the original currency.[4]

The method also tells us something about order. Suppose instead the tax were charged in dollars first and the result converted afterwards. Then the total would be \(c(t(x))\), not \(t(c(x))\). We will see below that these give different answers, because in one case the fee is taxed and in the other it is not.

When is it not the right tool? Inverses fail when the function is not one-one. A tax system with bands, where two different incomes give the same tax bill, has no inverse over its whole domain. A function like \(y = x^2\) on all real numbers has no inverse either, because \(3\) and \(-3\) both give 9. In those cases you must restrict the domain to a part where the function is one-one, or accept that the “reverse” question has more than one answer. Composites also fail if the first function produces outputs that the second cannot accept, such as feeding a negative number into a square root.

Setting it up

Here are the quantities in the case and the functions we will use.

QuantitySymbolValue or rule
List price of the book\(x\)$12 (US dollars)
Exchange rate–Rs 280 per $1 (illustrative)
Card fee per transaction–Rs 120 (illustrative)
Conversion function\(c(x)\)\(280x + 120\)
Tax rate–15% on the rupee amount (illustrative)
Tax function\(t(y)\)\(1.15y\)
Total cost function\(T(x) = tc(x)\)to be found
Monthly budget–Rs 5,000

The domain of \(c\) is \(x \ge 0\), since prices cannot be negative. Its range is \(c(x) \ge 120\). Every value in that range is a valid input for \(t\), so the composite \(tc\) is defined for all \(x \ge 0\).

Solving it

We start with a pure algebra example to fix the method, then a domain-restriction example, and finish with the case.

Worked example

Given \(f(x) = 2x + 3\) and \(g(x) = x^2\) for all real \(x\), find \(fg(x)\), \(gf(x)\), \(fg(2)\) and \(gf(2)\).

Step 1For \(fg(x)\), apply \(g\) first: \(g(x) = x^2\). Then put \(x^2\) into \(f\): \(fg(x) = 2x^2 + 3\).
Step 2For \(gf(x)\), apply \(f\) first: \(f(x) = 2x + 3\). Then square it: \(gf(x) = (2x + 3)^2 = 4x^2 + 12x + 9\).
Step 3Substitute \(x = 2\): \(fg(2) = 2(4) + 3 = 11\) and \(gf(2) = (7)^2 = 49\).

The two orders give 11 and 49, so \(fg \ne gf\): order matters.

Worked example

The function \(f\) is defined by \(f(x) = (x – 2)^2 + 1\) for \(x \ge 2\). State the range of \(f\), find \(f^{-1}(x)\) and state its domain.

Step 1Range: \((x-2)^2 \ge 0\), and it equals 0 when \(x = 2\). So \(f(x) \ge 1\).
Step 2Write \(y = (x – 2)^2 + 1\). Rearrange: \(y – 1 = (x – 2)^2\), so \(x – 2 = \pm\sqrt{y – 1}\).
Step 3Because \(x \ge 2\), we have \(x – 2 \ge 0\), so take the positive root: \(x = 2 + \sqrt{y – 1}\).
Step 4Swap letters: \(f^{-1}(x) = 2 + \sqrt{x – 1}\), with domain \(x \ge 1\) (the range of \(f\)).
Step 5Check: \(f(4) = 4 + 1 = 5\) and \(f^{-1}(5) = 2 + \sqrt{4} = 4\). Correct.

The domain restriction \(x \ge 2\) is what makes \(f\) one-one, and it decides which square root to keep.

Worked example

Using \(c(x) = 280x + 120\) and \(t(y) = 1.15y\), find the total cost function \(T(x) = tc(x)\), the cost of a $12 book, and the largest list price Ayesha can afford with Rs 5,000.

Step 1Compose: \(T(x) = t(c(x)) = 1.15(280x + 120) = 322x + 138\).
Step 2Cost of the book: \(T(12) = 322 \times 12 + 138 = 3864 + 138 = 4002\). So Rs 4,002.
Step 3Find the inverse. Write \(y = 322x + 138\), so \(x = \dfrac{y – 138}{322}\). Hence \(T^{-1}(x) = \dfrac{x – 138}{322}\), for \(x \ge 138\).
Step 4Budget: \(T^{-1}(5000) = \dfrac{5000 – 138}{322} = \dfrac{4862}{322} \approx 15.099\).
Step 5Prices are in cents, and rounding up would break the budget, so round down: $15.09. Check: \(T(15.09) = 322 \times 15.09 + 138 = 4996.98\), which is under Rs 5,000.

A $12 book costs Rs 4,002, and Ayesha can afford any book listed at up to $15.09.

Mathematics Made Simple Practice Questions coverMake composite and inverse functions automatic with the Practice Questions book: 1,565 questions, all fully worked.Get 1,565 questions · $9

What the answer tells us

The composite \(T(x) = 322x + 138\) has a clear meaning. The slope 322 is the effective exchange rate after tax: each extra dollar of list price costs Rs 280 plus 15% tax, which is Rs 322. The constant 138 is the card fee after tax: Rs 120 plus 15%. So a fixed fee quietly grows when it is taxed.

Does the order matter? Suppose the tax were charged on the dollar price first, and the bank then converted and added its fee. The total would be

\[ c(t(x)) = 280(1.15x) + 120 = 322x + 120. \]

For the $12 book this gives Rs 3,984, which is Rs 18 less than before. The difference is exactly the 15% tax on the Rs 120 fee. So \(tc \ne ct\), just as \(fg \ne gf\) in the first example. In real life the order is set by law and by the bank, not by the buyer, but the maths shows why the order is worth knowing.

Reasonableness check. Without the fee or tax, $12 would be \(12 \times 280 = \) Rs 3,360. Tax adds roughly one sixth, which takes us to about Rs 3,860, and the taxed fee adds Rs 138, giving Rs 4,002. That matches. For the budget, Rs 5,000 divided by an effective rate of about Rs 322 per dollar is about $15.5, and removing the fee pulls it down a little to $15.10. Our answer of $15.09 sits right where it should.

Sensitivity. The inverse makes “what if” questions easy. If the rupee weakens to Rs 300 per dollar, the composite becomes \(1.15(300x + 120) = 345x + 138\), and the inverse at Rs 5,000 gives \(\frac{4862}{345} \approx 14.09\). A weaker rupee of about 7% cuts Ayesha’s maximum list price by a dollar. If instead her budget rises to Rs 6,000, the maximum becomes \(\frac{5862}{322} \approx 18.20\), so $18.20.

The graph below shows the second worked example. The blue curve is \(f(x) = (x-2)^2 + 1\) for \(x \ge 2\). The gold curve is its inverse, \(f^{-1}(x) = 2 + \sqrt{x – 1}\). The dashed line is \(y = x\). Each curve is the mirror image of the other in that line: the point \((4, 5)\) on \(f\) matches the point \((5, 4)\) on \(f^{-1}\), and the start points \((2, 1)\) and \((1, 2)\) also swap.

A function and its inverse reflect in y = x x and y
f(x) = (x − 2)² + 1, x ≥ 2f⁻¹(x) = 2 + √(x − 1), x ≥ 1y = x
012345678012345678xy(4, 5) on f(5, 4) on f⁻¹(2, 1)(1, 2)
Figure 1. The graph of \(f^{-1}\) is the reflection of the graph of \(f\) in the line \(y = x\). The domain of each function is the range of the other.
Common mistakeDoing the functions in the wrong order. In \(fg(x)\), the function next to \(x\), which is \(g\), acts first. Students often compute \(g(f(x))\) instead. Say it aloud as “f of g of x” and work from the inside bracket outwards.
Common mistakeTreating \(f^{-1}(x)\) as \(\frac{1}{f(x)}\). For \(f(x) = 2x + 3\), the inverse is \(\frac{x – 3}{2}\), not \(\frac{1}{2x + 3}\). A second error is forgetting the domain: the domain of \(f^{-1}\) is the range of \(f\), and examiners expect you to state it.
Exam tipAlways check an inverse by testing one value: pick an easy \(x\), find \(f(x)\), then put that answer into your \(f^{-1}\). If you do not get \(x\) back, your algebra has a slip. When a question asks you to sketch \(f\) and \(f^{-1}\) on one diagram, draw the line \(y = x\) and make the two curves clear mirror images, including where they start and end. In Cambridge 9709 Pure Mathematics 1, functions questions also often ask why an inverse does not exist; the expected answer is that the function is not one-one, ideally with a pair of inputs that share an output.[2]

If you want more depth, the Mathematics Made Simple textbook covers domain, range, composites and inverses step by step, including graphs of each case. To build speed, the Mathematics Made Simple Practice Questions book has graded sets on functions with full worked answers.

Mathematics Made Simple bundle coverMaster functions, domains and inverses with both Mathematics Made Simple books for $16.Both books · $16

Practice questions

Try each question before you open the worked answer. They rise from routine to exam standard.

EasyQ1. Given \(f(x) = 3x – 1\) and \(g(x) = x + 4\), find \(fg(x)\) and \(gf(x)\). Show worked answer
\(fg(x) = f(x + 4) = 3(x + 4) – 1 = 3x + 11\).
\(gf(x) = g(3x – 1) = (3x – 1) + 4 = 3x + 3\).
The two are different, so the order matters.
EasyQ2. Find \(f^{-1}(x)\) for \(f(x) = 5x + 2\), and hence find \(f^{-1}(17)\). Show worked answer
Let \(y = 5x + 2\), so \(x = \dfrac{y – 2}{5}\).
So \(f^{-1}(x) = \dfrac{x – 2}{5}\).
\(f^{-1}(17) = \dfrac{15}{5} = 3\). Check: \(f(3) = 17\).
MediumQ3. The function \(f\) is defined by \(f(x) = \dfrac{2x + 1}{x – 3}\) for \(x \ne 3\). Find \(f^{-1}(x)\) and state the value of \(x\) for which it is not defined. Show worked answer
Let \(y = \dfrac{2x + 1}{x – 3}\). Then \(y(x – 3) = 2x + 1\), so \(yx – 3y = 2x + 1\).
Collect \(x\) terms: \(x(y – 2) = 3y + 1\), so \(x = \dfrac{3y + 1}{y – 2}\).
Hence \(f^{-1}(x) = \dfrac{3x + 1}{x – 2}\), not defined at \(x = 2\).
Check: \(f(4) = \dfrac{9}{1} = 9\) and \(f^{-1}(9) = \dfrac{28}{7} = 4\).
MediumQ4. The function \(f\) is defined by \(f(x) = x^2 – 6x + 11\) for \(x \ge 3\). Express \(f(x)\) in the form \((x – a)^2 + b\), state the range of \(f\), and find \(f^{-1}(x)\). Show worked answer
Complete the square: \(x^2 – 6x + 11 = (x – 3)^2 – 9 + 11 = (x – 3)^2 + 2\).
For \(x \ge 3\), \((x – 3)^2 \ge 0\), so the range is \(f(x) \ge 2\).
Let \(y = (x – 3)^2 + 2\). Then \(x – 3 = \sqrt{y – 2}\) (positive root since \(x \ge 3\)).
\(f^{-1}(x) = 3 + \sqrt{x – 2}\), for \(x \ge 2\).
Check: \(f(6) = 36 – 36 + 11 = 11\) and \(f^{-1}(11) = 3 + 3 = 6\).
ExamQ5. The functions \(f\) and \(g\) are defined for all real \(x\) by \(f(x) = 4x – 3\) and \(g(x) = x^2 + 1\). (a) Solve \(fg(x) = 17\). [3] (b) Find \(f^{-1}(x)\). [2] (c) Solve \(f(x) = f^{-1}(x)\). [2] Show worked answer
(a) \(fg(x) = 4(x^2 + 1) – 3 = 4x^2 + 1\) [M1]. Set \(4x^2 + 1 = 17\), so \(x^2 = 4\) [M1], giving \(x = 2\) or \(x = -2\) [A1].
(b) Let \(y = 4x – 3\), so \(x = \dfrac{y + 3}{4}\) [M1]. \(f^{-1}(x) = \dfrac{x + 3}{4}\) [A1].
(c) \(4x – 3 = \dfrac{x + 3}{4}\), so \(16x – 12 = x + 3\) [M1], giving \(15x = 15\) and \(x = 1\) [A1].
Note: for a line, \(f\) and \(f^{-1}\) meet on \(y = x\); solving \(4x – 3 = x\) also gives \(x = 1\).

Frequently asked questions

Is fg(x) the same as f(x) multiplied by g(x)?

No. In the topic of functions, \(fg(x)\) means \(f(g(x))\), the composite. The product would be written \(f(x) \times g(x)\) or \(f(x)g(x)\). Read the question carefully; when in doubt, the composite is what a functions question means by \(fg\).

Why do some functions have no inverse?

An inverse must send each output back to exactly one input. If two inputs share an output, as with \(x^2\) at \(x = 3\) and \(x = -3\), the inverse would have to give two answers, so it is not a function. Restricting the domain, for example to \(x \ge 0\), removes the clash and allows an inverse.

How do I find the domain of an inverse function?

The domain of \(f^{-1}\) is the range of \(f\). So find the range of \(f\) first, often by completing the square or by looking at the graph. Then copy it across as the domain of the inverse.

Where is the point where f and its inverse meet?

For an increasing function, \(f\) and \(f^{-1}\) meet on the line \(y = x\), so you can solve \(f(x) = x\) instead of the harder \(f(x) = f^{-1}(x)\). For a decreasing function the curves may also meet off that line, so check the question and the graph.

References

  1. Abramson, J. et al. (2021) Algebra and Trigonometry 2e. Houston: OpenStax. https://openstax.org/details/books/algebra-and-trigonometry-2e
  2. Cambridge International (2024) Cambridge International AS & A Level Mathematics 9709: Syllabus for examination in 2026 and 2027. https://www.cambridgeinternational.org/programmes-and-qualifications/cambridge-international-as-and-a-level-mathematics-9709/
  3. International Baccalaureate Organization (2019) Mathematics: analysis and approaches guide. Geneva: IBO.
  4. Sydsæter, K., Hammond, P., Strøm, A. and Carvajal, A. (2016) Essential Mathematics for Economic Analysis, 5th edn. Harlow: Pearson.
Mathematics Made Simple complete bundle cover
This topic has a full chapter in Mathematics Made Simple, with 1,565 fully worked practice questions in the bundle.Mathematics Made Simple Complete Bundle — Textbook + 1,565 Practice Questions
Get it for $16
E

The EconTutorials team writes clear, exam-focused lessons in economics and statistics for A-Level, IB, AP and university students, with more than 13 years of classroom teaching behind every guide and book in the Made Simple series.