When a Composite Function Exists

The range of g has to fit inside the domain of f.

Where fg can fail

fg(x) means f(g(x)): x goes into g first, and the output of g goes into f. So every output g can give must be a number f accepts.

Take f(x) = √x, whose domain is x ≥ 0, and g(x) = x − 3, which accepts every number. At x = 1, g gives 1 − 3 = −2, and f(−2) = √(−2) is not a real number. As written, fg does not exist.

The condition

fg exists exactly when the range of g lies inside the domain of f: range of g ⊆ domain of f.

Only the range of g matters, not its domain: f never sees the x values, only what g makes of them.

To make fg exist here, restrict g. On x ≥ 3, g(x) = x − 3 gives every value y ≥ 0, and every one of those is in the domain of f.

domain of frange of g, for x ≥ 3−4−3−2−101234

The range of g on x ≥ 3 is y ≥ 0. It starts at the same point as the domain of f and runs the same way, so it lies inside it.

The domain and range of fg

With g restricted, fg(x) = √(x − 3). Its domain is the domain of g, x ≥ 3, because x goes into g first.

Its range comes out of f: as x runs from 3 upward, x − 3 runs from 0 upward, and so does its square root. The range of fg is y ≥ 0.

The other order

gf(x) = g(f(x)) = √x − 3. Now the outputs of f go into g. The range of f is y ≥ 0, and g accepts every number, so gf exists on the whole domain of f, x ≥ 0.

Its range is y ≥ −3: √x starts at 0, and g takes 3 away. One composite can exist while the other does not, so check each order separately.

A composite that always exists

Take f(x) = √x again and g(x) = x² + 1. The range of g is y ≥ 1, which lies inside x ≥ 0, so fg(x) = √(x² + 1) exists for every x.

With g(x) = x² + k, the range of g is y ≥ k, and fg exists for f(x) = √(x − a) when k ≥ a.

The usual slips

Reading the domain of √(x − a) as x ≥ −a. The expression under the root must be at least 0, so x − a ≥ 0 and x ≥ a.

Checking the domain of g instead of its range. What reaches f is the outputs of g.

Mixing up the order. fg feeds g into f and needs the range of g inside the domain of f; gf needs the range of f inside the domain of g.

Practice When a Composite Function Exists in the app