2. Functions

Composite Functions

Composite Functions

students, imagine you have two machines in a row 🤖➡️🤖. The first machine changes a number, and the second machine changes the result again. A composite function does exactly that in mathematics. In IB Mathematics: Applications and Interpretation HL, composite functions help you model situations where one process depends on the output of another, such as converting units, calculating travel costs, or applying tax after a discount.

What a Composite Function Means

A composite function is made by putting one function inside another. If $f$ and $g$ are functions, then the composite function is written as $f(g(x))$ and read as “$f$ of $g$ of $x$.” This means you first apply $g$ to $x$, and then apply $f$ to the result.

In symbols:

$$f(g(x))$$

This is not the same as $f(x)g(x)$, which means multiplying two function values. The order matters because the output of one function becomes the input of the next function. If $g(x)$ gives a value that $f$ can use, then the composite is defined. If not, the composite does not exist for that $x$.

For example, if $g(x)=2x+1$ and $f(x)=x^2$, then

$$f(g(x))=f(2x+1)=(2x+1)^2$$

and

$$g(f(x))=g(x^2)=2x^2+1$$

These are usually different, so $f(g(x)) \neq g(f(x))$ in general. This is an important idea in Functions because the order of operations changes the result.

Why Composite Functions Matter in Real Life

Composite functions are useful whenever a quantity passes through more than one rule. students, this happens all the time in real-world situations 📈.

Example 1: Shopping and tax

Suppose a jacket costs $x$ dollars. A store gives a $20$% discount first, then adds $5$% sales tax. Let the discount function be

$$g(x)=0.8x$$

and the tax function be

$$f(x)=1.05x$$

If the discount happens first and the tax second, the final price is

$$f(g(x))=1.05(0.8x)=0.84x$$

So the final price is $84$% of the original price.

If the order were reversed, the result would be

$$g(f(x))=0.8(1.05x)=0.84x$$

In this specific case, the result is the same because both functions are multiplication by constants. But that is not always true.

Example 2: Temperature conversion and scaling

Suppose a scientific calculation first converts Celsius to Fahrenheit, then adjusts the result by a calibration rule. If a function converts temperature and another function modifies it, the composite function describes the full process. This is common in lab work, engineering, and data analysis.

How to Find a Composite Function

To find $f(g(x))$, replace the input of $f$ with the entire expression $g(x)$. Think of it as substitution.

Step-by-step method

  1. Identify the inner function, $g(x)$.
  2. Identify the outer function, $f(x)$.
  3. Substitute $g(x)$ into every place where $x$ appears in $f(x)$.
  4. Simplify carefully.

For example, let

$$f(x)=3x-4$$

and

$$g(x)=x^2+2$$

Then

$$f(g(x))=3(x^2+2)-4$$

which simplifies to

$$f(g(x))=3x^2+2$$

Now reverse the order:

$$g(f(x))=(3x-4)^2+2$$

Expanding gives

$$g(f(x))=9x^2-24x+18$$

So the two composites are clearly different.

Common mistake

A very common error is writing

$$f(g(x))=3x^2+2$$

without showing the substitution process. Another mistake is forgetting to square the entire expression in $g(f(x))$. Always use brackets to keep track of what is being substituted.

Domains and Composite Functions

Not every composite function works for every input. The domain of $f(g(x))$ must satisfy two conditions:

  • $x$ must be in the domain of $g$.
  • $g(x)$ must be in the domain of $f$.

This is one of the most important ideas in composite functions.

Example with restrictions

Let

$$f(x)=\sqrt{x}$$

and

$$g(x)=x-3$$

Then

$$f(g(x))=\sqrt{x-3}$$

For this to be defined, the expression inside the square root must be non-negative:

$$x-3\geq 0$$

so

$$x\geq 3$$

That means the domain of $f(g(x))$ is all real $x$ such that $x\geq 3$.

Now reverse the functions:

$$g(f(x))=\sqrt{x}-3$$

For this, we need

$$x\geq 0$$

because the square root must be defined. The domain is different, which shows why domain checks are essential.

Graphs and How Composition Changes Shape

Composite functions can create new graphs from old ones. When you substitute one function into another, the graph can shift, stretch, reflect, or become more complicated.

If $f(x)$ is a simple graph and $g(x)$ transforms the input before $f$ acts, then $f(g(x))$ changes the horizontal behavior of the graph. This is often harder to see than vertical transformations because the input is being changed first.

For example, if

$$f(x)=x^2$$

and

$$g(x)=x-2$$

then

$$f(g(x))=(x-2)^2$$

This is the graph of $y=x^2$ shifted $2$ units to the right. That is because the input must be $2$ larger before the output matches the original square.

Similarly,

$$f(x+3)$$

shifts the graph of $f(x)$ left by $3$ units, while

$$f(x-3)$$

shifts it right by $3$ units. In composite functions, these shifts come from putting one expression inside another.

Composite Functions in Modelling and Technology

In IB AI HL, technology is often used to explore function behaviour, and composite functions appear naturally in modelling relationships. Software or graphing calculators can help you compare $f(g(x))$ and $g(f(x))$, estimate domains, and visualize transformations.

For instance, suppose a company uses one function to model the number of customers after advertising and another function to model income from customers. If the number of customers is

$$g(x)=50+10x$$

and income is

$$f(x)=25x$$

then total income after advertising becomes

$$f(g(x))=25(50+10x)$$

which simplifies to

$$f(g(x))=1250+250x$$

This says that the final income depends on the advertising level $x$ through two connected processes.

Technology can also show the graph of a composite function and help check whether your algebra is correct. However, you still need to understand what each function means in context. A graph may show the shape, but interpretation explains the real-world story behind it.

Interpreting Composite Functions in Context

When students reads a composite function in a word problem, focus on the sequence of actions.

Ask:

  • What does the inner function do first?
  • What does the outer function do second?
  • Does the input stay within the allowed domain?
  • What does the final output represent?

Example: Water tank process

Suppose the volume of water in a tank after $t$ hours is modeled by

$$g(t)=100-8t$$

where $g(t)$ is in liters. Then a quality test measures chlorine concentration using

$$f(V)=0.02V$$

where $V$ is the volume in liters. The composite function

$$f(g(t))=0.02(100-8t)$$

gives chlorine concentration as a function of time:

$$f(g(t))=2-0.16t$$

This tells us how concentration changes as the tank empties. The composite function helps connect two stages of the same process.

Conclusion

Composite functions are one of the clearest examples of how Functions can describe connected real-world processes. They show what happens when one function’s output becomes another function’s input. In IB Mathematics: Applications and Interpretation HL, you should be able to calculate composites, check domains, compare $f(g(x))$ and $g(f(x))$, and interpret results in context. students, if you understand the idea of “one rule after another,” composite functions become much easier to use ✅.

Study Notes

  • A composite function is written as $f(g(x))$ and means apply $g$ first, then $f$.
  • The order matters: usually $f(g(x)) \neq g(f(x))$.
  • To find a composite, substitute the entire inner function into the outer function.
  • Always check the domain of the inner function and make sure its output is valid for the outer function.
  • Composite functions are useful in modelling real-life processes like pricing, conversions, and scientific measurements.
  • Graphs of composite functions may show shifts, stretches, or other transformations.
  • Technology can help visualize and verify composites, but interpretation is still essential.
  • In context, ask what each function represents and what the final output means.

Practice Quiz

5 questions to test your understanding