Example 1 — Polynomial with linear inside
\(f(x)=x^{2}\), \(g(x)=2x+3\). Then \((f\circ g)(x)=f(g(x))=(2x+3)^2=4x^2+12x+9\). \((g\circ f)(x)=2x^2+3\) (different expression; order matters).
Composition of Functions Calculator two functions instantly. Enter f(x) and g(x) to see f∘g and g∘f with simplified expressions and clear steps displayed.
x as the variable. Built-ins: sin, cos, exp, log, sqrt, etc.
Multiplication may need * (e.g., 2*x).
x. Powers use ^ (e.g., x^2).
No extra fields needed—just f(x) and g(x).
Given f(x)=2*x+3, g(x)=x^2 → (f∘g)(x)=f(g(x))=2*(x^2)+3, (g∘f)(x)=g(f(x))=(2*x+3)^2
f(x) and g(x). Evaluation at a point is optional in many tools, so we omit it.(f∘g)(x)=f(g(x)) and (g∘f)(x)=g(f(x)), then simplify.log(x) requires x>0).A Composite Function Calculator constructs and simplifies function compositions such as \((f\circ g)(x)=f(g(x))\) and \((g\circ f)(x)=g(f(x))\). Composition lets you apply one function’s output as another function’s input, enabling multi-stage models: unit conversions, nested transformations, and chained operations in algebra, calculus, and data pipelines. The calculator returns a simplified expression, evaluates numerically at specified \(x\)-values, and emphasizes the domain of the composite, which may be stricter than the individual domains. It can also compare \((f\circ g)\) vs. \((g\circ f)\) to highlight that order matters, and—when enabled—checks inverse relationships \((f\circ f^{-1})(x)=x\) on valid domains. Clear, step-by-step working helps students follow substitution, distribute exponents, rationalize radicals, and combine like terms.
The tool parses \(f(x)\) and \(g(x)\), substitutes carefully, and simplifies using algebraic identities (powers, factoring, trig identities) while tracking restrictions such as denominators \(\neq0\), even roots requiring nonnegative radicands, and logarithms needing positive arguments. It supports symbolic constants and parameters, detects removable vs. essential discontinuities, and can produce piecewise composites when inputs are piecewise-defined. To support calculus workflows, it optionally previews the derivative of the composite via the chain rule and provides numerical checks at sample points. If an inverse function is supplied, the calculator verifies compositions reduce to the identity on the intersection of their domains.
Definition of composition: \[ (f\circ g)(x)=f(g(x)),\qquad (g\circ f)(x)=g(f(x)). \]
Domain of a composite: \[ \operatorname{Dom}(f\circ g)=\{\,x\in\operatorname{Dom}(g)\mid g(x)\in\operatorname{Dom}(f)\,\}. \]
Chain rule (derivative preview): \[ \frac{d}{dx}\big[f(g(x))\big]=f'\!\big(g(x)\big)\cdot g'(x). \]
Inverse check (when exists): \[ (f\circ f^{-1})(x)=x \ \text{on }\operatorname{Dom}(f),\qquad (f^{-1}\circ f)(x)=x \ \text{on }\operatorname{Dom}(f^{-1}). \]
\(f(x)=x^{2}\), \(g(x)=2x+3\). Then \((f\circ g)(x)=f(g(x))=(2x+3)^2=4x^2+12x+9\). \((g\circ f)(x)=2x^2+3\) (different expression; order matters).
\(f(x)=\sqrt{x}\), \(g(x)=x-1\). \((f\circ g)(x)=\sqrt{x-1}\) with domain \(x\ge1\). \((g\circ f)(x)=\sqrt{x}-1\) with domain \(x\ge0\).
\(f(x)=\ln x\) (domain \(x>0\)), \(g(x)=\sin x\). \((f\circ g)(x)=\ln(\sin x)\) defined when \(\sin x>0\). \((g\circ f)(x)=\sin(\ln x)\) defined when \(x>0\).
They’re usually different; composition is not commutative. Always check order and domains.
Start with \(\operatorname{Dom}(g)\) and keep only \(x\) such that \(g(x)\in\operatorname{Dom}(f)\); combine all restrictions.
Yes. It composes each piece and merges results while carrying the appropriate interval conditions.
Algebraic manipulation can hide restrictions (e.g., cancelled factors). The tool preserves original domain constraints explicitly.
The chain rule differentiates composites: \((f\circ g)'= (f'\circ g)\cdot g'\). The preview helps in calculus problems.