Composite Function Calculator

Build f(g(x)) or g(f(x)) step by step. Get simplified composition, chain rule derivative, domain hints, and interactive graph.

Chain rule reminder: (f ∘ g)'(x) = f'(g(x)) · g'(x)

Function of x
Function of x
sin(x²) (sin x)² e^(x²) √(x²+1) cos(2x) ln(x²+1) (2x-1)³ (g∘f?)
Computing symbolic composition...

Understanding Composite Functions (In‑depth)

A composite function is created when the output of one function becomes the input of another. Notation: (f ∘ g)(x) = f(g(x)). This operation is fundamental in calculus, physics, and mathematical modeling.

Chain rule – the derivative of a composite function

(f ∘ g)'(x) = f'(g(x)) · g'(x)

“Derivative of the outer function (evaluated at the inner) times derivative of the inner.”

1. Domain and range considerations

For h(x) = f(g(x)) to be defined:

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

Example: f(x)=√x, g(x)=x-2. Domain of f∘g is x ≥ 2 because g(x) ≥ 0.

2. How to decompose a function

1 Identify the inner function (the first operation applied).
2 The outer function acts on the result of the inner.
3 Example: h(x) = e^(3x+1) → inner g(x)=3x+1, outer f(u)=e^u.

3. Algebraic properties

  • Associative: f ∘ (g ∘ h) = (f ∘ g) ∘ h (when defined).
  • Not commutative: f ∘ g is generally different from g ∘ f. (e.g., sin(x²) ≠ sin²(x)).
  • Identity function: f ∘ id = f and id ∘ f = f where id(x)=x.

4. Common composite functions and their derivatives (table)

Composite Derivative (chain rule)
sin(kx) k·cos(kx)
e^(ax+b) a·e^(ax+b)
(p(x))ⁿ n·(p(x))ⁿ⁻¹ · p'(x)
ln(g(x)) g'(x)/g(x)
√(g(x)) g'(x)/(2√(g(x)))

5. Real‑world applications

  • Physics: harmonic motion sin(ωt+φ) — angular frequency ω inside.
  • Economics: compound interest as repeated composition of growth factors.
  • Machine learning: activation functions composed with linear layers (e.g., σ(Wx+b)).
  • Engineering: signal processing — modulation cos(2πft).

Why use this calculator? It performs symbolic composition and differentiation, handles trigonometric, exponential, logarithmic, and polynomial functions, and displays the chain rule step. Perfect for homework check or conceptual understanding.

Frequently Asked Questions

The calculator will show an error. Check domain restrictions: denominator ≠ 0, argument of log > 0, square root argument ≥ 0, etc.

We use nerdamer's symbolic differentiation on the composite expression, then apply algebraic simplification. The result is the exact derivative, not a numerical approximation.

This tool handles two functions directly. For triple compositions, compose two first, then use the result as a new function with the third.

We apply algebraic expansion, trigonometric simplifications, and collect like terms. It gives a cleaner form of the composite function.