Domain of composite function explained simply

How to find the domain of f(g(x)): start with the domain of g, then drop inputs whose output falls outside the domain of f. Worked examples.

Domain of a Composite Function f(g(x))

You have f(g(x)) and a calculator that simplifies it to a cleaner expression. You write the domain for that cleaned version. That is the exact moment you lose points. The domain of a composite function is a precalc trap that catches students who simplify first. The domain of a composite function is the set of all x such that x is in the domain of g and g(x) is in the domain of f. Check both conditions, not just the final formula.

The Two-Step Rule

To find the domain of f(g(x)), apply two restrictions in order. First, find the domain of g. Exclude any x that makes g undefined. Second, take every output g(x) and require it to be in the domain of f. The intersection of these two sets is your answer.

OpenStax Precalculus 2e, section 3.2 states: 'The domain of a function includes all real input values that would not cause division by zero or an even root of a negative number.' Apply this to both functions in the composition. Paul's Online Math Notes gives the same method in its algebra examples: the domain of √(x-2)/(x-3) is [2,3)∪(3,∞); the square root forces x≥2 and the denominator forces x≠3.

Write the domain in interval notation. If the domain has two separate intervals, use the union symbol ∪. A single compound inequality like 'x≥2, x≠3' is not interval notation and will be marked wrong. The correct form is [2,3)∪(3,∞).

Why Simplifying First Gives The Wrong Domain

Your instinct is to simplify f(g(x)) into a single expression and find its domain directly. That expression, after algebraic manipulation, often has fewer restrictions than the original composition. A cancelled factor may remove a denominator restriction. A squared square root may lose its radicand condition. You get a domain that is too large.

Consider f(x)=1/x and g(x)=x². The composition f(g(x)) = 1/(x²). Simplified to 1/x², the domain excludes x=0 only. But the two-step rule gives the same answer here; g has domain all reals and g(x)=x² is never zero except at x=0. No trap. Now try f(x)=1/x and g(x)=√(x). The composition is 1/√(x). Simplified, it looks like 1 over a square root, so x>0. The two-step rule: g has domain [0,∞), and g(x)=√(x) must be in the domain of f, which excludes 0 since f(0) is undefined. So x>0. Same result. The trap appears when cancellation hides a denominator or a radicand restriction.

Here is a real trap: f(x)=1/x and g(x)=(x-2)/(x-3). The composition f(g(x)) simplifies to (x-3)/(x-2). Simplify first and you get domain all reals except x=2. But the two-step rule: g has domain all reals except x=3. And g(x) must not equal 0; f(0) is undefined. Solve (x-2)/(x-3)=0 → x=2. So the domain excludes x=3 (from g) and x=2 (from f's restriction). The correct domain is all reals except 2 and 3. The simplified version missed x=3 entirely.

Worked Examples: Domain of f(g(x))

Example 1: Square Root of a Fraction

Let f(x)=√(x) and g(x)=1/x. Find the domain of f(g(x)).

Step 1: Domain of g(x)=1/x. Denominator cannot be zero, so x≠0.

Step 2: f(x)=√(x) requires its input to be ≥0. So g(x) ≥ 0. Solve 1/x ≥ 0. The fraction 1/x is positive when x>0. It is negative when x<0. There is no x where 1/x equals 0. So g(x) ≥ 0 requires x>0.

Intersection of x≠0 and x>0 gives x>0. In interval notation, (0,∞). Paul's Online Math Notes confirms the method: domain of √(x-2)/(x-3) is found by solving two restrictions independently and intersecting them.

Example 2: Fraction of a Root

Let f(x)=1/x and g(x)=√(x-4). Find the domain of f(g(x)).

Step 1: Domain of g(x)=√(x-4). Radicand must be ≥0: x-4 ≥0 → x≥4. Interval: [4,∞).

Step 2: f(x)=1/x excludes 0 in its domain. So g(x) ≠ 0. Solve √(x-4) = 0 → x=4. So x=4 is excluded.

Intersection: [4,∞) minus {4} gives (4,∞). OpenStax Precalculus 2e, section 3.2 notes that the domain of a function includes all inputs that would not cause division by zero or an even root of a negative number. Both conditions are applied here.

Example 3: Log of a Root

Let f(x)=ln(x) and g(x)=√(x-5). Find the domain of f(g(x)).

Step 1: Domain of g(x)=√(x-5) is x-5 ≥0 → x≥5. Interval: [5,∞).

Step 2: f(x)=ln(x) requires its input to be >0. So g(x) > 0. Solve √(x-5) > 0. The square root is zero at x=5 and positive for x>5. So the condition is x>5.

Intersection: [5,∞) and x>5 gives (5,∞). The endpoint x=5 is excluded; ln(0) is undefined.

Range of a Composite Function

The range of f(g(x)) is the set of all y-values produced by applying f to every output of g that lies in the domain of f. Finding it manually requires more work than the domain. Evaluate the possible outputs of g, then see what f does to them.

For the composition f(x)=√(x) and g(x)=x²+1, g(x) outputs numbers from 1 to ∞. f then takes the square root of those numbers, giving outputs from √1=1 to ∞. The range is [1,∞). This is straightforward; g is continuous and f is monotonic. For compositions involving rational functions or piecewise definitions, the range may require checking endpoints, asymptotes, and crossing behavior.

A common failure: assuming the range of f(g(x)) is the same as the range of the simplified expression. It is not. The range depends on which g(x) values actually occur. If g(x) never produces a value that f needs to cover its full range, the composite range will be a subset.

Domain Comparison: Simplifying Vs. Two-Step Rule
Composition f(g(x))Simplified DomainTwo-Step DomainDifference
f(x)=1/x, g(x)=(x-2)/(x-3)x≠2x≠2, x≠3x=3 missed by simplification
f(x)=√(x), g(x)=x²-4x²-4≥0 → x≤-2 or x≥2SameNo cancellation, no trap
f(x)=1/x, g(x)=√(x-4)x>4x>4No cancellation, no trap
f(x)=ln(x), g(x)=√(x-5)x>5x>5No cancellation, no trap

Practice Set: Domain of Composition of Functions Domain

Find the domain of each composition using the two-step rule. Write answers in interval notation.

1. f(x)=√(x), g(x)=x/(x-1). Domain of f(g(x)).

2. f(x)=1/(x-3), g(x)=√(x+2). Domain of f(g(x)).

3. f(x)=ln(x), g(x)=1/(x-4). Domain of f(g(x)).

4. f(x)=√(x), g(x)=x²-9. Domain of f(g(x)).

5. f(x)=1/x, g(x)=x²-4. Domain of f(g(x)).

Answers: 1: (1,∞). 2: [-2,3)∪(3,∞). 3: (4,∞). 4: (-∞,-3]∪[3,∞). 5: all reals except x=±2.

Common Questions

What is the domain of f(g(x)) if g(x) is a fraction?

Start with the domain of g: exclude x-values that make the denominator zero. Then require that g(x) itself be in the domain of f. If f also has a denominator, exclude x-values that make g(x) equal to zero. Write the intersection in interval notation.

Why does simplifying first give the wrong domain for composite functions?

Algebraic simplification can cancel factors that hide restrictions. A cancelled denominator in g, or a cancelled factor that makes g(x) equal to a forbidden value for f, will be lost. The simplified expression's domain is a superset of the actual domain.

How do I find the domain of f(g(x)) when f is a square root?

Find the domain of g first. Then solve the inequality g(x) ≥ 0; the input to a square root must be non-negative. Intersect that solution with the domain of g. Write the result in interval notation.

What if the composition involves a logarithm?

Apply the same two-step rule. Find the domain of g. Then require g(x) > 0; the argument of a logarithm must be positive. Intersect the two sets. Remove any endpoint where g(x)=0; log(0) is undefined.

Does the range of a composite function always match the range of the simplified expression?

No. The composite range is determined by the actual outputs of g that are fed into f. If g's output set is smaller than the domain of f, the composite range will be a subset of f's range. Evaluating the simplified expression alone can give a misleadingly large range.