Every matrix in this course is about to become a function. When you see T(\mathbf v) = A\mathbf v a few chapters from now, T is exactly the same kind of object as f(x) = x^2 — an input goes in, one output comes out — just with a vector where a number used to sit. That reframe is the whole reason this review exists: the vocabulary of domain, codomain, and composition is about to get reused constantly, on inputs that no longer look like plain numbers, so it needs to be exact before that happens.
Think of a function as a one-way machine on a factory floor. The domain is the bin of parts it's built to accept. Feed it something outside that bin, like a screw when it wants a bolt, and it jams instead of running. The codomain is the label on the machine's output chute: "finished widgets come out here." That label holds even on a slow day, when the machine only ever produces a handful of the shapes the chute could technically hold. That handful is the range, what really comes out, versus what the chute was built to allow.
Composition is two machines bolted together on an assembly line. The first machine's output chute feeds directly into the second machine's input bin. The line only runs if whatever the first machine spits out is something the second machine can accept. A part the second machine would jam on breaks the whole line, even if the first machine ran fine on its own. Swapping which machine comes first almost always changes what comes off the end of the line. Sometimes the change is so large that reversing the order breaks the line entirely.
A function f: A \to B is a rule that assigns to every element of A exactly one element of B. The set A is the domain — everything the function is allowed to accept. The set B is the codomain — the set the function's outputs are declared to land in, fixed as part of the function's definition. The range (or image) is the smaller set of outputs the function actually produces: \{f(a) : a \in A\}. The range is always a subset of the codomain, but the two are not required to be equal — f(x) = x^2 can be defined with codomain \mathbb R, but its range is only [0, \infty), the non-negative reals, since a square is never negative.
Composition (g \circ f)(x) = g(f(x)) chains two functions: first apply f, then feed that output into g. For g \circ f to be defined at x, two things must hold — x must be in the domain of f, and f(x) must be in the domain of g. Composition is associative but not commutative in general: g \circ f and f \circ g are usually different functions, and one can even be defined where the other isn't.
Domain restrictions come from three places you already know: you can't divide by zero, you can't take an even root of a negative number, and you can't take the logarithm of a non-positive number. Composition just applies that same domain test twice in a row — once to get past the first function, once more to get past the second.
Chain two functions and watch the domain bite
Send each chip, -6, 0, 8, 12, through f(x)=\sqrt{x-4} then g(x)=\frac{1}{x-2} in turn. Watch for two different failure modes: a chip that never reaches g at all, and a chip that clears f only to hit a division by zero in g.
Loading interactive…
Reading that widget: x=-6 and x=0 both fail immediately — x-4 is negative, so f's square root box turns red and the chip never reaches g at all. x=8 clears f cleanly, giving f(8)=\sqrt4=2 — but that 2 is exactly the value that makes g's denominator zero, so the chip sails through box f only to turn box g red one step later. Only x=12 clears both: f(12)=\sqrt8\approx2.83, and since that's not 2, g(\sqrt8)=\frac{1}{\sqrt8-2} comes out as an ordinary real number.
Recipe Find the domain of a function Use when: the formula is built from pieces that each carry their own restriction — a square root, a fraction, a logarithm — and you need every input that survives all of them at once Goal: the domain written as one interval or union of intervals, guaranteed to satisfy every restriction the formula imposes, simultaneously
Quick recipe
-
1
Scan the formula for the three classic restriction sources: an even root (needs a non-negative radicand), a denominator (can't equal zero), a logarithm (needs a positive argument). List every one that appears — a formula can have zero, one, or several at once.
Example
h(x) = \dfrac{\sqrt{x+9}}{x-1} has two restriction sources: a square root (an even root, on x+9) and a denominator (on x-1). There's no logarithm here.
Why: missing even one restriction source produces a domain that's too big — an x that clears the restrictions you found gets reported as legal even though a restriction you missed would have rejected it.
-
2
For each source, write its condition and solve it by itself, without combining it with any other restriction yet: an even root needs (\text{inside}) \ge 0; a denominator needs (\text{denominator}) \ne 0; a logarithm needs (\text{argument}) > 0.
Example
Square root: x+9\ge0 \Longrightarrow x\ge-9. Denominator: x-1\ne0 \Longrightarrow x\ne1.
Why: each restriction is an independent condition on its own piece of the formula — solving two of them together too early is exactly how a boundary value or an excluded point gets lost.
-
3
The domain is every x that satisfies ALL of the restrictions at once, not any x that satisfies at least one of them.
Example
x\ge-9 intersected with x\ne1: since 1 lies inside [-9,\infty), it has to be explicitly removed, giving [-9,1)\cup(1,\infty).
- an excluded point from a \ne condition already falls outside the interval from a \ge or \le condition — that exclusion never mattered; no extra carve-out needed in the final answer.
- an excluded point from a \ne condition falls inside the interval from another condition — carve that single point out of the interval explicitly.
Why: a function only produces an output when it clears every one of its restrictions simultaneously — one restriction failing jams the whole formula, so combining restrictions can only shrink the domain, never grow it.
-
4
State the domain in interval notation, then substitute one of the boundary numbers back into the original formula to double-check whether it's correctly included or excluded.
Example
Check x=-9: \sqrt{-9+9}=0 is defined, and -9-1=-10\ne0, so x=-9 is correctly included. Check x=1: the denominator 1-1=0, so x=1 is correctly excluded — matching [-9,1)\cup(1,\infty).
Why: boundary points are exactly where a "\ge" gets mistyped as a strict ">," or an excluded point gets left sitting inside the interval by accident — substituting back in catches that whole class of error directly.
Common mistakes
- Taking the union of the restrictions instead of their intersection, which reports a domain that's too generous.
- Solving only the more visually obvious restriction (a square root) and missing a plain denominator elsewhere in the formula.
- Getting a boundary's inclusion or exclusion backwards — writing \ge where a strict > or \ne was needed, or the reverse.
- For a composed function, applying only the outer function's restriction and forgetting the inner function carries its own restriction too — the domain of g\circ f has to satisfy both f's domain and g's.
Check your understanding (counts toward your progress)
f(x) = \log(x+4) requires which restriction on its domain?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Flip the inequality — a logarithm needs a strictly positive argument, so x+4>0 gives x>-4, not x<-4.
The inequality must be strict: x=-4 gives \log(0), which is undefined, not x\ge-4.
This is a strict inequality over a whole interval, not just one excluded point like a denominator restriction would be.
Why
A logarithm's argument must be strictly positive: x+4>0 gives x>-4. Unlike a square root, the boundary itself (x=-4, giving \log(0)) is excluded too.
A logarithm is only defined when its argument is strictly positive -- set up that inequality for x+4.
Using the same f(x)=x+5 and g(x)=2x, write a simplified expression for (g\circ f)(x).
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Any equivalent form counts — 2x+3, 3 + 2·x, … Use the keypad below the field for fractions, roots, and other symbols.
Why
(g\circ f)(x) = g(f(x)) = g(x+5) = 2(x+5) = 2x+10 — different from (f\circ g)(x)=2x+5 found above, another confirmation that composition isn't commutative.
Correct answer
Also accepted:
Why
Composition (g\circ f)(x) means substitute the entire expression for f(x) everywhere x appears in g.
Let f(x) = x+5 and g(x) = 2x. Write a simplified expression for (f\circ g)(x).
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Any equivalent form counts — 2x+3, 3 + 2·x, … Use the keypad below the field for fractions, roots, and other symbols.
Why
(f\circ g)(x) = f(g(x)) = f(2x) = 2x+5.
Correct answer
Also accepted:
Why
Composition (f\circ g)(x) means substitute the entire expression for g(x) everywhere x appears in f.
Practice: Domain, codomain, and composition -- one more pass (6 problems · doesn’t affect your progress)
In the notation f: A \to B, what is B called? (For reference, the choices given are: The codomain; The domain; The range; The inverse.)
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
A, the set on the left of the arrow, is the domain — B is the set the arrow points into.
The range is the subset of B actually produced by f; B itself, before checking what's produced, is the codomain.
Nothing here is about an inverse function — this notation just names the input and target sets.
Why
f: A \to B reads as 'a function from A to B.' A is the domain (allowed inputs), and B is the codomain (the declared target set for outputs).
The codomain
What is the domain of f(x) = \dfrac{1}{x+7}? (For reference, the choices given are: All real numbers except x=-7; All real numbers except x=7; All real numbers; x \ge -7.)
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Solve x+7=0, not x-7=0 — the excluded value is -7, not 7.
A denominator of zero is never allowed; x=-7 makes the denominator zero here, so it can't be included.
This restriction isn't about a square root — there's no radical in f, so no inequality is involved, just one excluded point.
Why
The only restriction on a rational function is that its denominator can't equal zero. Setting x+7=0 gives x=-7, so that single value is excluded and every other real number is allowed.
All real numbers except x=-7
Let f(x)=3x-2 and g(x)=x^2. Find (f\circ g)(2). (Work through it specifically for f(x)=3x-2 and g(x)=x^2 and (f\circ g)(2).)
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Why
Apply g first: g(2)=2^2=4. Then apply f to that result: f(4)=3(4)-2=10.
Correct answer
Also accepted:
Why
Let f(x) = x+5 and g(x) = 2x. Write a simplified expression for (f\circ g)(x). (Work through it specifically for f(x) = x+5 and g(x) = 2x and (f\circ g)(x).)
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Any equivalent form counts — 2x+3, 3 + 2·x, … Use the keypad below the field for fractions, roots, and other symbols.
Why
(f\circ g)(x) = f(g(x)) = f(2x) = 2x+5.
Correct answer
Also accepted:
Why
Composition (f\circ g)(x) means substitute the entire expression for g(x) everywhere x appears in f.
For h(x)=\dfrac{\sqrt{x+2}}{x-4}, which value of x must be excluded from the domain even though it doesn't violate the square root's restriction? (For reference, the choices given are: x=4; x=-2; x=2; x=0.)
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
x=-2 is actually the boundary the square root allows (\sqrt{0}=0 is fine) — it's included, not excluded.
x=2 satisfies both the root condition (2+2\ge0) and the denominator condition (2-4\ne0) — it's a perfectly good input.
x=0 also satisfies both conditions and belongs in the domain.
Why
The square root requires x+2\ge0, i.e. x\ge-2, which x=4 satisfies. But the denominator x-4 equals zero exactly at x=4, so that single point must still be excluded — it's the denominator, not the root, doing the excluding here.
Even though the square root only restricts the numerator, check whether any value of x makes the denominator equal to 0.
x=4
f(x)=\sqrt{x} and g(x)=x-9. For which x is (f\circ g)(x) undefined? (For reference, the choices given are: x < 9; x > 9; x < 0; x \ne 9.)
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
That's backwards — g(x)=x-9 is non-negative, and so acceptable to f, when x\ge9, not when x>9 alone.
The restriction is on g(x), not on x itself — g(x)<0 happens when x<9, not when x<0.
x=9 itself is fine: g(9)=0 and \sqrt{0}=0 is defined. The trouble is a whole interval, not one excluded point.
Why
(f\circ g)(x) = \sqrt{x-9} needs its radicand non-negative: x-9\ge0, i.e. x\ge9. So the composition is undefined exactly when x<9.
First substitute g(x) into f, then figure out which values of x make the expression under the square root negative.
x < 9
Worked example
Find the domain of h(x) = \dfrac{\sqrt{x+9}}{x-1}
-
1even roots forbid negative inputs
This is the recipe above, run start to finish: two restrictions apply at once, so find each and intersect them (Steps 1–3). The square root needs a non-negative radicand: x + 9 \ge 0 \quad\Longrightarrow\quad x \ge -9
even roots forbid negative inputs
-
2division by zero is never allowed
The denominator can't be zero: x - 1 \ne 0 \quad\Longrightarrow\quad x \ne 1
division by zero is never allowed
-
3
Both conditions must hold together — take every x \ge -9 except the single point x=1: \boxed{[-9, 1) \cup (1, \infty)} Check: x=1 is excluded even though it satisfies x\ge-9, because the denominator condition rules it out on its own — the domain is the intersection of the two restrictions, not the union.
Loading interactive…
Worked example
Compose f(x) = x^2 - 3 and g(x) = \sqrt{x+1} both ways
-
1
Find (g \circ f)(2): apply f first. f(2) = 2^2 - 3 = 1
-
2so (g\circ f)(2) = \sqrt2
Feed that into g: g(1) = \sqrt{1+1} = \sqrt2
so (g\circ f)(2) = \sqrt2
-
3
Now find (f \circ g)(2) instead — apply g first this time: g(2) = \sqrt{2+1} = \sqrt3
-
4
Feed that into f: f(\sqrt3) = (\sqrt3)^2 - 3 = 3 - 3 = \boxed{0} Check: (g\circ f)(2) = \sqrt2 \approx 1.41 but (f\circ g)(2) = 0 — different answers confirm g\circ f \ne f\circ g at this input, exactly as the technical box above warned.
Loading interactive…
Where this goes next
Linear Transformations
Chapter 4 of this course defines a linear transformation T: \mathbb R^n \to \mathbb R^m — a function whose domain and codomain are entire vector spaces instead of subsets of \mathbb R, but every idea from this section still governs it exactly. T's domain is \mathbb R^n: every vector with n entries is a legal input, no exceptions, since matrix multiplication never divides or roots. T's codomain is the declared target \mathbb R^m, and its range — the vectors T actually hits — can be a much smaller subset of \mathbb R^m, called the column space, once this course gets there. And composing two transformations, T_2 \circ T_1, will turn out to be nothing more exotic than multiplying their two matrices together in the matching order — the same order-matters warning from the composition example above, made precise as matrix multiplication's own non-commutativity.
What's next
Domain, codomain, and composition were reviewed here as facts about ordinary functions of a number. The next section turns to a different kind of input entirely: a system of two equations, solved three separate ways, which is the last piece of readiness algebra before the vector language of Chapter 1 begins.