algebra calculators

Function Composition Calculator

Compute the composite function (f∘g)(x) for two linear functions and evaluate it at any point x. Perfect for precalculus students learning how function composition works.

About this calculator

Function composition means applying one function to the output of another. Written as (f∘g)(x), it means f(g(x)) — first evaluate g at x, then feed that result into f. For two linear functions f(x) = a·x + b and g(x) = c·x + d, the composition is: (f∘g)(x) = a·(c·x + d) + b = ac·x + ad + b. This calculator uses the formula: f_coeff_a × (g_coeff_a × x + g_coeff_b) + f_coeff_b. Note that composition is generally not commutative: (f∘g)(x) ≠ (g∘f)(x). Understanding composition is foundational for calculus topics like the chain rule and inverse functions.

How to use

Let f(x) = 3x + 1 and g(x) = 2x + 4, and evaluate at x = 5. Enter f_coeff_a = 3, f_coeff_b = 1, g_coeff_a = 2, g_coeff_b = 4, eval_point = 5. First compute g(5) = 2(5) + 4 = 14. Then compute f(14) = 3(14) + 1 = 43. Using the formula directly: (f∘g)(5) = 3 × (2 × 5 + 4) + 1 = 3 × 14 + 1 = 43. So (f∘g)(5) = 43.

Frequently asked questions

What is the difference between function composition and function multiplication?

Function composition (f∘g)(x) means f applied to the output of g — it is a chaining of functions, not arithmetic. Function multiplication (f·g)(x) simply means f(x) × g(x). For example, if f(x) = x + 1 and g(x) = 2x, then (f∘g)(x) = 2x + 1, while (f·g)(x) = x(x+1) = x² + x. The two operations yield completely different results and have different algebraic properties.

Why is function composition not commutative in general?

Commutativity would require (f∘g)(x) = (g∘f)(x) for all x, but this is rarely true. For f(x) = 3x + 1 and g(x) = 2x + 4, (f∘g)(x) = 6x + 13, while (g∘f)(x) = 6x + 6 — clearly different. The order matters because you are nesting functions: the inner function transforms the input before the outer function sees it. Only in special cases, like when both functions are inverses of each other, does the order not matter.

How does function composition relate to the chain rule in calculus?

The chain rule in calculus is essentially the derivative rule for composed functions. If h(x) = f(g(x)), then h′(x) = f′(g(x)) · g′(x). Understanding composition is therefore a prerequisite for differentiation of nested expressions. For example, differentiating sin(x²) requires recognizing it as f(g(x)) with g(x) = x² and f(u) = sin(u), then applying the chain rule to get 2x·cos(x²).