Domain and Range
Once we can write a rule with
function notation, a
natural question follows: which inputs are allowed, and which outputs can come out?
Those two collections have names.
-
The domain is the set of all inputs the function will accept — every
x you are allowed to feed in.
-
The range is the set of all outputs the function can produce — every
f(x) that can come out.
Picture the machine again: the domain is the pile of inputs that fit through the slot, and
the range is the pile of outputs that land in the tray.
Why some inputs are not allowed
For many functions, every real number works — the domain is "all real numbers". But some
rules break for certain inputs, and those inputs are quietly thrown out of the domain. Two
classic troublemakers:
-
Division by zero. In f(x) = \dfrac{1}{x} the
input x = 0 is forbidden, because dividing by zero is
undefined. The domain is every real number except 0.
-
Square roots of negatives. In g(x) = \sqrt{x}
you cannot take the root of a negative, so the domain is x \ge 0.
Pick a rule below and slide the input. When the input is outside the domain, the machine
flashes a warning instead of an output.
Reading them off a graph
On a graph the domain is the spread of the curve left-to-right (its shadow
on the x-axis), and the range is its spread
up-and-down (its shadow on the f(x)-axis). The
parabola f(x) = x^2 stretches across every x,
but it never dips below 0 — so its range is
f(x) \ge 0.
Writing it down: interval notation
We describe a stretch of allowed values with interval notation. A square
bracket [\;] includes the endpoint; a round bracket
(\;) excludes it. The symbol \infty
("infinity") always gets a round bracket, because you never actually reach it.
x \ge 0 \;\Longleftrightarrow\; [\,0,\ \infty)
-2 < x \le 5 \;\Longleftrightarrow\; (-2,\ 5\,]
Khan Academy introduces domain and range here: