Algebra

Compose functions and track the domain

Function composition feeds the output of one rule into another. The inner function acts first, and the final domain must satisfy both the inner rule and the outer rule at that output.

Author
VibeMath Editorial TeamOriginal AI-assisted lesson content edited for clarity, accessibility, and product-truth accuracy.
Math reviewer
VibeMath Math ReviewIndependent equation, example, substitution, units, scope, and accessibility checks; not a claim of individual human credentials.
Last reviewed

What you will learn

  • Read f composed with g as applying g first and f second.
  • Substitute an entire expression into the outer function without dropping grouping.
  • Determine which inputs survive both inner and outer domain requirements.

Build the idea

A composition is a two-stage machine. An input enters g, and the resulting output becomes the input of f. The written order f composed with g therefore reverses the chronological order of evaluation.

Substitution must replace every occurrence of the outer variable with the complete inner expression. Parentheses preserve the inner expression as one input and prevent distribution or exponent errors.

An input belongs to the composition only if g can accept it and f can accept the value g produces. This second condition can create restrictions that neither formula reveals when viewed alone.

Two connected function machines

An input card enters the g machine, its output card moves directly into the f machine, and only the final card exits. A gate before each machine rejects values outside that machine's domain.

Visual description: Flow diagram showing x entering g, g of x entering f, and f of g of x exiting, with domain gates at both stages.
Read as: f composed with g at x equals f evaluated at g of x.
Read as: The domain of f composed with g contains inputs in the domain of g whose g outputs lie in the domain of f.

Worked example

Problem

Let f of u equal the square root of the quantity u minus one, and let g of x equal two x plus three. Find f composed with g and its real domain.

Strategy

Insert the entire formula for g into the input slot of f, simplify the radicand, and require that radicand to be nonnegative.

  1. Step 1

    Replace u in the outer rule with two x plus three. Parentheses show that the whole inner output enters the square-root rule.

    Read as: f of g of x equals the square root of the quantity two x plus three minus one, end quantity.
  2. Step 2

    Combine the constants inside the radicand. The composed formula is the square root of two x plus two.

    Read as: f composed with g at x equals the square root of the quantity two x plus two, end quantity.
  3. Step 3

    A real square root needs a nonnegative radicand. Solving two x plus two greater than or equal to zero gives x greater than or equal to negative one.

    Read as: Two x plus two is at least zero, so x is at least negative one.

Answer and verification

The composition is the square root of two x plus two, with real domain x greater than or equal to negative one.

At x equals negative one, g produces one and f of one is zero, so the boundary is valid. At x equals negative two, g produces negative one and f would require the square root of negative two, so that input is excluded.

Common mistakes

  • Applying f first because its letter appears first in f composed with g.

    Read from the inside outward: g of x is formed first, and f then receives that output.

  • Declaring the domain to be all real numbers because g is linear.

    The inner formula is defined everywhere, but its output must also satisfy the square-root restriction imposed by f.

Try it yourself

Let f of u equal one divided by the quantity u minus four, end denominator, and let g of x equal x squared. Find f composed with g and its domain.

Show hint

Substitute x squared for u, then exclude inputs that make x squared minus four equal zero.

Show answer

The composition is one divided by the quantity x squared minus four, with x not equal to negative two or two.

Accessible lesson transcript

This reviewed reading order covers the lesson explanation, equations, example, and checks without claiming that a video exists.

  1. Part 1

    Lesson overview

    Function composition feeds the output of one rule into another. The inner function acts first, and the final domain must satisfy both the inner rule and the outer rule at that output. A composition is a two-stage machine. An input enters g, and the resulting output becomes the input of f. The written order f composed with g therefore reverses the chronological order of evaluation. Read f composed with g as applying g first and f second.

  2. Part 2

    Visual model and equations

    Substitution must replace every occurrence of the outer variable with the complete inner expression. Parentheses preserve the inner expression as one input and prevent distribution or exponent errors. An input card enters the g machine, its output card moves directly into the f machine, and only the final card exits. A gate before each machine rejects values outside that machine's domain. f composed with g at x equals f evaluated at g of x. The domain of f composed with g contains inputs in the domain of g whose g outputs lie in the domain of f.

  3. Part 3

    Worked example

    Let f of u equal the square root of the quantity u minus one, and let g of x equal two x plus three. Find f composed with g and its real domain. Insert the entire formula for g into the input slot of f, simplify the radicand, and require that radicand to be nonnegative. Replace u in the outer rule with two x plus three. Parentheses show that the whole inner output enters the square-root rule. Combine the constants inside the radicand. The composed formula is the square root of two x plus two. A real square root needs a nonnegative radicand. Solving two x plus two greater than or equal to zero gives x greater than or equal to negative one. The composition is the square root of two x plus two, with real domain x greater than or equal to negative one. At x equals negative one, g produces one and f of one is zero, so the boundary is valid. At x equals negative two, g produces negative one and f would require the square root of negative two, so that input is excluded.

  4. Part 4

    Checks, practice, and scope

    An input belongs to the composition only if g can accept it and f can accept the value g produces. This second condition can create restrictions that neither formula reveals when viewed alone. Applying f first because its letter appears first in f composed with g. Read from the inside outward: g of x is formed first, and f then receives that output. Declaring the domain to be all real numbers because g is linear. The inner formula is defined everywhere, but its output must also satisfy the square-root restriction imposed by f. Let f of u equal one divided by the quantity u minus four, end denominator, and let g of x equal x squared. Find f composed with g and its domain. Substitute x squared for u, then exclude inputs that make x squared minus four equal zero. The composition is one divided by the quantity x squared minus four, with x not equal to negative two or two. Composition order is controlled by nesting, so the inner function acts first. Parentheses protect the full inner expression during substitution. The composition domain checks both accepted inputs and accepted intermediate outputs. This lesson uses explicit real-valued formulas and does not address inverse relations, multivariable functions, or branch choices in complex analysis. A formula may simplify algebraically while retaining restrictions inherited from an earlier stage of the composition.

Scope and limitations

  • This lesson uses explicit real-valued formulas and does not address inverse relations, multivariable functions, or branch choices in complex analysis.
  • A formula may simplify algebraically while retaining restrictions inherited from an earlier stage of the composition.