Composite Functions
Introduction: chaining functions together π
students, in mathematics, a function is like a machine: you put in an input, the machine does something, and you get an output. A composite function is what happens when you feed the output of one function into another function. This idea is very important in IB Mathematics: Analysis and Approaches HL because it helps you connect different function types, solve equations, and understand how graphs and formulas behave together.
In this lesson, you will learn how to:
- explain the meaning and notation of composite functions,
- calculate composites such as $f(g(x))$,
- understand the domain of a composite function,
- connect composite functions to transformations, inverse functions, and real-world models,
- use composite functions in IB-style reasoning and problem solving.
A simple way to think about it is this: one function acts first, and then the next function acts on the result. For example, if $g(x)$ doubles a number and $f(x)$ adds $3$, then $f(g(x))$ means βdouble first, then add $3$.β This order matters a lot. π
What composite functions mean
If $f$ and $g$ are functions, the composite function $f(g(x))$ is defined by applying $g$ first and then applying $f$ to the output of $g$. We often read $f(g(x))$ as β$f$ of $g$ of $x$.β The notation shows the order clearly.
More formally, if $g$ sends $x$ to $g(x)$ and $f$ sends an input $u$ to $f(u)$, then the composite is $f(g(x)) = f(g(x))$. It looks repetitive, but the idea is that the input to $f$ is the entire expression $g(x)$.
The same idea works in the opposite order too. The composite $g(f(x))$ means apply $f$ first, then apply $g$. In general, these are not the same:
$$f(g(x)) \neq g(f(x))$$
unless the functions happen to work out that way.
For example, let $f(x) = x^2$ and let $g(x) = x+1$.
Then
$$f(g(x)) = f(x+1) = (x+1)^2,$$
while
$$g(f(x)) = g(x^2) = x^2+1.$$
These are different expressions, so the order of composition changes the result. This is a key idea in function language and representation. π
How to calculate a composite function
To evaluate a composite function, follow the substitution carefully.
Suppose
$$f(x) = 2x-5$$
and
$$g(x) = x^2+3.$$
To find $f(g(x))$, replace the input of $f$ with $g(x)$:
$$f(g(x)) = 2(x^2+3)-5.$$
Then simplify:
$$f(g(x)) = 2x^2+6-5 = 2x^2+1.$$
To find $g(f(x))$, replace the input of $g$ with $f(x)$:
$$g(f(x)) = (2x-5)^2+3.$$
Expanding gives:
$$g(f(x)) = 4x^2-20x+25+3 = 4x^2-20x+28.$$
Notice how the two answers are different. This is a common exam idea: always read the function order carefully.
Sometimes you are given a numerical value. For example, if $f(x)=2x-5$ and $g(x)=x^2+3$, then
$$f(g(2)) = f(7) = 2(7)-5 = 9.$$
First find $g(2)$, then use that result in $f$.
A good habit is to work step by step. This reduces errors, especially when the functions are polynomial, rational, exponential, or logarithmic.
Domain matters: when does a composite function exist?
Not every input works for every function. The domain of a composite function depends on both functions. This is one of the most important parts of composite functions in IB HL.
For $f(g(x))$ to be defined:
- $x$ must be in the domain of $g$,
- $g(x)$ must be in the domain of $f$.
That means the output of the first function must be allowed as the input of the second function.
Example: let
$$f(x)=\sqrt{x}$$
and
$$g(x)=x-4.$$
Then
$$f(g(x)) = \sqrt{x-4}.$$
For this to be defined, we need
$$x-4 \geq 0,$$
so the domain is
$$x \geq 4.$$
Now look at the opposite order:
$$g(f(x)) = \sqrt{x}-4.$$
Here the square root requires
$$x \geq 0,$$
so the domain is different.
This example shows why composite functions are not just about substitution. The domain can change dramatically depending on order. In real life, this matters when one process feeds into another, such as converting units and then applying a formula. π
For rational functions, restrictions are also common. If
$$f(x)=\frac{1}{x-2}$$
and
$$g(x)=x+1,$$
then
$$f(g(x))=\frac{1}{(x+1)-2}=\frac{1}{x-1}.$$
Here the domain requires
$$x-1 \neq 0,$$
so
$$x \neq 1.$$
Also, if the inside function produces a value that makes the outer function undefined, that input must be excluded too.
Composite functions in transformations and inverses
Composite functions are closely connected to transformations and inverse functions.
A transformation changes a graph or function. Composing with a simple function can create a shift, stretch, or reflection. For example, if $f(x)$ is a base function, then $f(x-3)$ shifts the graph right by $3$, while $f(x)+3$ shifts it up by $3$. These are examples of composition with input and output changes.
Think of a function as a process. If you first transform the input and then apply the function, you are building a composite expression. This is one reason function notation is so powerful.
Inverse functions also connect strongly to composite functions. If $f$ has an inverse $f^{-1}$, then the two functions undo each other:
$$f(f^{-1}(x)) = x$$
a nd
$$f^{-1}(f(x)) = x,$$
for all $x$ in the appropriate domains.
This is a special type of composite function. It means the result of one function is reversed by the other. For example, if
$$f(x)=3x+2,$$
then the inverse is
$$f^{-1}(x)=\frac{x-2}{3}.$$
Check:
$$f(f^{-1}(x))=3\left(\frac{x-2}{3}\right)+2=x-2+2=x.$$
In IB HL, you may be asked to show that two functions are inverses by proving that their compositions give the identity function. This is a clean way to test understanding of algebra and function notation.
Real-world examples and IB-style reasoning
Composite functions appear in many real-life situations where one process depends on another. For example, imagine a car rental company charges a base fee using one function and then adds tax using another. If one function calculates the pre-tax cost and another calculates the final total, the final price is a composite of the two processes.
Suppose the base cost is modeled by
$$c(x)=20x+50,$$
where $x$ is the number of days. If tax is applied by
$$t(x)=1.15x,$$
then the final cost is
$$t(c(x)) = 1.15(20x+50).$$
This gives the total price after tax. If you reverse the order, the meaning changes, and the answer is not the same. That shows why composition is more than a symbol exercise: it represents a real sequence of operations.
IB questions may ask you to find composite functions, simplify them, determine domains, or interpret them in context. You may also need to solve equations involving composites, such as
$$f(g(x)) = 7$$
or inequalities like
$$f(g(x)) \geq 0.$$
To solve these, first find the composite expression, then use algebra carefully. If the functions involve quadratics, rationals, exponentials, or logarithms, check the restrictions before finalizing your answer. For logarithmic functions, for instance, the input must be positive. If
$$f(x)=\ln(x)$$
and
$$g(x)=x-2,$$
then
$$f(g(x))=\ln(x-2),$$
which requires
$$x-2>0,$$
so
$$x>2.$$
This is exactly the kind of reasoning that connects composite functions to the broader topic of functions in IB Mathematics: Analysis and Approaches HL.
Conclusion
Composite functions are a fundamental tool for combining functions into one process. The notation $f(g(x))$ means apply $g$ first and then $f$, and the order matters because $f(g(x))$ is often different from $g(f(x))$. To work with composites correctly, students, you must pay close attention to substitution, simplification, and domain restrictions.
Composite functions also connect directly to inverses, transformations, and real-world modelling. They help describe sequences of actions, such as pricing, conversions, and physical processes. In IB HL, composite functions are not isolated skills; they are part of a bigger understanding of function behavior, algebraic structure, and mathematical modeling. β
Study Notes
- A composite function is formed by applying one function inside another, such as $f(g(x))$.
- The order matters: $f(g(x))$ is usually not equal to $g(f(x))$.
- To evaluate a composite, substitute the entire inside function into the outer function.
- The domain of $f(g(x))$ requires $x$ to be in the domain of $g$ and $g(x)$ to be in the domain of $f$.
- For inverse functions, the compositions satisfy $f(f^{-1}(x)) = x$ and $f^{-1}(f(x)) = x$ on the correct domains.
- Composite functions help model real situations where one process depends on another.
- In IB Mathematics: Analysis and Approaches HL, composite functions connect algebra, graph behavior, domain restrictions, and function notation.
