Composite Functions

Learn how to combine two functions to create a new function using composition.

Advanced25 minLesson

Definition

A composite function is created when one function is applied to the result of another function. We write this as (f∘g)(x)(f \circ g)(x) or f(g(x))f(g(x)), read as "f of g of x."
Key Idea: In f(g(x))f(g(x)), we first evaluate g(x)g(x), then use that result as the input for ff.
If f(x)=x2 and g(x)=x+3\text{If } f(x) = x^2 \text{ and } g(x) = x + 3
Then (f∘g)(x)=f(g(x))=f(x+3)=(x+3)2\text{Then } (f \circ g)(x) = f(g(x)) = f(x + 3) = (x + 3)^2
Important: Order matters! (f∘g)(x)≠(g∘f)(x)(f \circ g)(x) \neq (g \circ f)(x) in general.

Try it now

If f(x)=x+2f(x) = x + 2 and g(x)=3xg(x) = 3x, what is (f∘g)(1)(f \circ g)(1)?

Worked Examples

If f(x)=2x+1f(x) = 2x + 1 and g(x)=x2g(x) = x^2, find (f∘g)(3)(f \circ g)(3).

1

Understand the notation

(f∘g)(3)=f(g(3))(f \circ g)(3) = f(g(3)) → First find g(3)g(3), then apply ff

2

Evaluate the inner function

g(3)=32=9g(3) = 3^2 = 9 → g(3)=9g(3) = 9

3

Substitute into outer function

f(g(3))=f(9)=2(9)+1f(g(3)) = f(9) = 2(9) + 1 → f(9)=18+1f(9) = 18 + 1

4

Calculate final answer

18+1=1918 + 1 = 19 → (f∘g)(3)=19(f \circ g)(3) = 19

Common Mistakes

Confusing (f∘g)(x)(f \circ g)(x) with f(x)⋅g(x)f(x) \cdot g(x)

Why it's wrong: The circle notation ∘\circ means composition, not multiplication. (f∘g)(x)=f(g(x))(f \circ g)(x) = f(g(x)), which substitutes g(x)g(x) into ff.

Correct: (f∘g)(x)(f \circ g)(x) means apply gg first, then ff. Multiplication f(x)⋅g(x)f(x) \cdot g(x) is a completely different operation.

Getting the order backwards

Why it's wrong: In (f∘g)(x)(f \circ g)(x), you might think ff comes first because it appears first.

Correct: Read inside out: (f∘g)(x)=f(g(x))(f \circ g)(x) = f(g(x)) means gg is applied first, then ff.

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

Why it's wrong: Unlike multiplication, composition is NOT commutative in general.

Correct: Always check both orders. Usually (f∘g)(x)≠(g∘f)(x)(f \circ g)(x) \neq (g \circ f)(x).

Interactive Visual

Linear Function Explorer

y = x
Slope (m)1
Y-Intercept (b)0
b
run
rise

Interactive Sandbox

Interactive Grapher

Try these examples:

y = 2x + 1

m=2, b=1

Expression Calculator

Try these:

History

No calculations yet

Practice Problems

16 problems
Problem 1 of 16
Easy

If f(x)=x+2f(x) = x + 2 and g(x)=3xg(x) = 3x, what is (f∘g)(1)(f \circ g)(1)?

Why It Matters

Composite functions are essential for:
  • Modeling Complex Processes: A temperature conversion from Celsius to Fahrenheit, then to Kelvin, is a composition of two functions
  • Computer Science: Nested function calls like `print(len(str(x)))` are composite functions
  • Economics: Calculating total cost involves composing unit cost with quantity functions
  • Calculus: The Chain Rule for derivatives is based on understanding composite functions
Think of it like following GPS directions: first go to the store (function gg), then from the store go home (function ff). The order matters!

Real World Applications

Unit Conversion Chains

Converting between measurement units often requires composing multiple conversion functions.

Example:

To convert miles to meters: first convert miles to kilometers with g(x)=1.609xg(x) = 1.609x, then kilometers to meters with f(x)=1000xf(x) = 1000x. So (f∘g)(x)=1609x(f \circ g)(x) = 1609x meters.

1Try It Yourself

A European car speedometer shows kilometers per hour. You need to convert to meters per second. Function g(x)=1000xg(x) = 1000x converts km to m. Function f(x)=x3600f(x) = \frac{x}{3600} converts per hour to per second.

If a car travels at 90 km/h, what is its speed in m/s?

Step 1: Write the mathematical expression

Calculate (f∘g)(90)(f \circ g)(90):

Computer Programming

Nested function calls in programming are composite functions.

Example:

In Python, `len(str(n))` counts the digits of a number. Here g(n)=str(n)g(n) = \text{str}(n) converts to string, and f(s)=len(s)f(s) = \text{len}(s) counts characters.

2Try It Yourself

A program uses f(x)=x+10f(x) = x + 10 to add a bonus, and g(x)=2xg(x) = 2x to double a score. The composed function f(g(x))f(g(x)) first doubles, then adds bonus.

If a player's base score is 45, what is the final score after applying (f∘g)(f \circ g)?

Step 1: Write the mathematical expression

Calculate f(g(45))f(g(45)):

Key Takeaways

  • 1A composite function (f∘g)(x)=f(g(x))(f \circ g)(x) = f(g(x)) applies gg first, then ff to the result
  • 2Order matters: (f∘g)(x)(f \circ g)(x) is usually NOT equal to (g∘f)(x)(g \circ f)(x)
  • 3To evaluate, work from the inside out: first compute the inner function
  • 4Composition is different from multiplication: f∘g≠f⋅gf \circ g \neq f \cdot g

Frequently Asked Questions

Think "inside out." In f(g(x))f(g(x)), gg is inside, so it's applied first. Then ff is applied to that result. The function closest to xx goes first.
Think "inside out." In f(g(x))f(g(x)), gg is inside, so it's applied first. Then ff is applied to that result. The function closest to xx goes first.
The range (outputs) of the inner function must be in the domain (allowed inputs) of the outer function. For example, if f(x)=xf(x) = \sqrt{x} and g(x)=x−10g(x) = x - 10, then f(g(5))f(g(5)) is undefined because g(5)=−5g(5) = -5 and we can't take the square root of a negative number.
Yes! Simply substitute the entire expression for g(x)g(x) wherever you see xx in f(x)f(x). Then simplify the result.

Glossary

Composite function
A function formed by applying one function to the result of another, written (f∘g)(x)(f \circ g)(x) or f(g(x))f(g(x))
Inner function
In (f∘g)(x)(f \circ g)(x), the inner function gg is evaluated first
Outer function
In (f∘g)(x)(f \circ g)(x), the outer function ff is applied to the result of gg
Function composition
The operation of combining two functions where the output of one becomes the input of the other

More in This Topic