📐 Mathematics · Topic 98 of 200

Function Composition

Composing functions feeds the output of one into another.

Interactive labDrag the sliders and hover over the graph

About this topic

Composition feeds the output of one function into another: (f ∘ g)(x) = f(g(x)). You work from the inside out, so first apply g, then f. If f(x) = x + 2 and g(x) = 3x, then f(g(x)) = 3x + 2 but g(f(x)) = 3x + 6, so order matters.

Composition models chains of processes, such as converting units then applying a discount. The domain of the composition must respect restrictions on both functions.

Worked example: let f(x) = √x and g(x) = x − 4. Then f(g(x)) = √(x − 4), which only works when x is at least 4, so the domain shrinks even though g alone accepts every number. Reversed, g(f(x)) = √x − 4, with domain x at least 0. Same two functions, different answers. In a shop, g could subtract a 4 dollar coupon and f could apply a rule on the result; doing them in a different order changes the final bill.

Computer programs are built from composed functions, where one routine feeds the next, and the chain rule in calculus differentiates compositions. Students often multiply f and g instead of composing them. Remember that f(g(x)) means plug the whole expression g(x) in wherever x appears in f, with brackets, and then simplify. Check the domain by asking what g can accept and whether f accepts the result.

Key ideas

  1. (f∘g)(x) = f(g(x))
  2. Work from the inside out
  3. Order matters

Quick check

Use cases: where Function Composition helps

Number and algebra skills are used in science, engineering, budgeting and computing.

Frequently asked questions

What is Function Composition?

Composing functions feeds the output of one into another.

What will I learn in Function Composition?

(f∘g)(x) = f(g(x)). Work from the inside out. Order matters.

Is Function Composition part of Mathematics?

Yes. It is one of 200 Mathematics topics on LearnViz HighSchoolEdu, with 3 key ideas, a live animation and a quick check.

Does the Function Composition lab work on a phone or tablet?

Yes. The animation resizes to fit your screen and supports touch, so you can drag, tap and slide with your finger.

How should I study Function Composition?

Read the summary and key ideas first, play with the interactive lab to see the idea in motion, then answer the quick check. If you get a question wrong, go back to the key idea it tests.

Do I need an account, and is my progress saved?

No account is needed. Marking a topic as learned is saved in your own browser, so it stays on that device and is not sent to a server.

More in Mathematics