Back to the on-screen lesson ·

Functions: domain, image and composition

What a function is, the largest domain a formula allows, and why the order in a composite matters.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

By the end of this lesson you will be able to say what a function is with the domain counted as part of it, find the natural domain of a formula by listing what each operation refuses and intersecting the results, decide each endpoint on its own, form a composite in the right order and give its domain from both conditions rather than from the simplified formula. You will also be able to say why cancelling a common factor produces a different function, which is the fact the whole of the next unit is built on.

2. A function is a rule with a domain attached

A function $f : A \to B$ assigns to each element of $A$ exactly one element of $B$. Three words in that sentence are load-bearing: each (nothing in $A$ is left out), exactly one (no input has two outputs), and $A$ itself — the domain is part of the function, not an afterthought. $x^2$ on $\mathbb{R}$ and $x^2$ on $[0, \infty)$ are different functions, and the difference is the whole reason one has an inverse and the other does not.

$B$ is the codomain; the set of values actually reached, $f(A) = \{f(x) : x \in A\}$, is the image or range, and it may be smaller.

The natural domain. When a function is given by a formula with no domain stated, the convention is the largest set of real numbers on which the formula makes sense. Three operations do all the excluding:

OperationRequirementEndpoint
$\dfrac{1}{u}$$u \ne 0$the point removed
$\sqrt{u}$$u \ge 0$included
$\ln u$$u > 0$excluded

When more than one applies, intersect the requirements. A root in a denominator gets both the root's and the fraction's, and the strict condition wins.

Composition. $(g \circ f)(x) = g(f(x))$: the function written on the right acts first. Its domain is $\{x : x \in \operatorname{dom} f \text{ and } f(x) \in \operatorname{dom} g\}$ — two conditions, and reading the domain off the simplified formula is the standard way to lose the first one.

Another way: picture

Two boxes wired in series. $x$ goes into the $f$ box; whatever comes out is what the $g$ box receives. The composite is defined exactly when $x$ is something the first box accepts and the first box's output is something the second box accepts — a wire can be blocked at either end.

Another way: steps

To find a natural domain:

  1. List every denominator, every even root and every logarithm in the formula.
  2. Write the requirement each one imposes.
  3. Solve each as an inequality in $x$.
  4. Intersect them, and check every endpoint separately — the endpoints are where two requirements usually disagree.

3. The vertical line test, and what it is really testing

A curve in the plane is the graph of a function of $x$ exactly when no vertical line meets it more than once. That is not a separate fact; it is the phrase exactly one output drawn.

So the unit circle $x^2 + y^2 = 1$ is not the graph of a function of $x$: the line $x = 0$ meets it at $y = 1$ and $y = -1$. It is the union of two graphs, $y = \sqrt{1 - x^2}$ and $y = -\sqrt{1 - x^2}$, and choosing one of them is what "the upper semicircle" means. Later, implicit differentiation works with the whole relation without ever making that choice, which is exactly why it is worth having.

4. Piecewise functions are functions

$$|x| = \begin{cases} x & x \ge 0 \\ -x & x < 0\end{cases}$$ is one function, not two. The definition assigns exactly one output to each input; that the rule is written in two cases is a fact about the notation.

What matters later is what happens at the junction. Every case boundary is a point where continuity has to be checked by hand rather than inherited from the formulas, and a great many of the counterexamples in this course — a function continuous but not differentiable, a function with a jump, a function with a removable discontinuity — are built by putting an interesting junction into an otherwise dull piecewise definition.

5. Where this goes wrong

Reading the domain off a simplified formula. $\dfrac{x^2 - 1}{x - 1}$ simplifies to $x + 1$, and the two are not the same function: the first is undefined at $x = 1$ and the second is not. Cancelling changes the domain, and the point that disappears is exactly the point a limit question will ask about.

Composing in the wrong order. $g \circ f$ applies $f$ first. The notation reads right to left, like the nested brackets it stands for.

Substituting only part of the inner formula. $g(u) = 3u$ with $f(x) = x + 2$ gives $g(f(x)) = 3(x + 2) = 3x + 6$, not $3x + 2$. The whole of $f(x)$ goes in, brackets and all.

Forgetting the inner domain. The domain of $f \circ g$ is never larger than the domain of $g$, however simple the composite looks after simplification.

6. Cancelling changes the function

$\dfrac{x^2 - 4}{x - 2} = x + 2$ is true for every $x$ where the left side is defined, and the left side is not defined at $x = 2$. So the equation is an identity on $\mathbb{R} \setminus \{2\}$ and not on $\mathbb{R}$, and the two sides are different functions with different domains. This is worth being fussy about now, because the next unit spends most of its time at exactly such a point: the whole reason $\lim_{x \to 2} \dfrac{x^2 - 4}{x - 2}$ is an interesting question is that the function has no value there, and the whole reason it has an answer is that the two sides agree everywhere else.

7. A domain with three restrictions at once

  1. $h(x) = \dfrac{\ln(x - 1)}{\sqrt{5 - x}}$. Take the restrictions one at a time.

    List, then intersect.

  2. The logarithm needs $x - 1 > 0$, so $x > 1$. The root needs $5 - x \ge 0$, so $x \le 5$. The root is also a denominator, so $5 - x \ne 0$, so $x \ne 5$.

    Three conditions from three operations.

  3. Intersecting: $1 < x < 5$, the open interval $(1, 5)$. Both ends open, and for different reasons — the left because a logarithm refuses zero, the right because a denominator does.

    The endpoints are decided separately.

8. Two composites of the same pair

  1. $f(x) = \sqrt{x}$, $g(x) = x - 4$. Then $(f \circ g)(x) = \sqrt{x - 4}$, with domain $[4, \infty)$.

    Inner first.

  2. And $(g \circ f)(x) = \sqrt{x} - 4$, with domain $[0, \infty)$.

    The other order.

  3. Different formulas, different domains, different images. Swapping the order of a composition changes the function in every way it can be changed.

9. Your turn: the domain of $\dfrac{\sqrt{x + 2}}{x - 3}$

  1. The root needs $x + 2 \ge 0$, so $x \ge -2$.

    First restriction.

  2. The denominator needs $x \ne 3$.

    Second restriction.

  3. Your turn: work this step out. Its working is at the end of the packet.

    Intersecting: $[-2, 3) \cup (3, \infty)$ — the ray from $-2$ with a single point punched out of it.

10. Guided practice

Match each function statement to the feature it describes.

DomainRangeThe graph is not a function of $x$$g\circ f$ is undefined at that input
Values allowed to enter $f$
Values $f$ actually produces
A vertical line meets a graph twice
Output of $f$ is rejected by $g$

11. Guided practice

Match each composition fact to its consequence.

Apply $f$ first, then $g$Apply $g$ first, then $f$Requires $x\geq1$Requires $x>2$
$(g\circ f)(x)$
$(f\circ g)(x)$
$\sqrt{\log x}$
$1/\sqrt{x-2}$

12. Practice

Match each formula feature to the restriction it places on real inputs.

Exclude $x=4$Require $x\leq2$Require $x>-3$Require $0<x\leq e$
$1/(x-4)$
$\sqrt{2-x}$
$\log(x+3)$
$\sqrt{1-\log x}$

13. Practice

Give the domain of $f(x) = \sqrt{x - 8}$ as an interval.

This task has no paper form; do it on a device.

14. Practice

Give the domain of $g(x) = \dfrac{1}{\sqrt{2 - x}}$ as an interval.

This task has no paper form; do it on a device.

15. Somewhere new

$f(x) = \sqrt{x}$ and $g(u) = u - 2$. Give the domain of $f \circ g$ as an interval.

This task has no paper form; do it on a device.

16. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

17. Test question

Match each operation with the condition that keeps it defined over the real numbers.

Require $u\ne0$Require $u\geq0$Require $u>0$
A denominator $u$
An even root $\sqrt{u}$
A logarithm $\log u$

18. What you can do now

You can find a natural domain with several restrictions, compose in the right order, and give the domain of a composite. Say in your own words why $\frac{x^2-4}{x-2}$ and $x+2$ are different functions. Next: injections, surjections and inverses.

Working for the steps left to you

9. Your turn: the domain of $\dfrac{\sqrt{x + 2}}{x - 3}$, step 3

Two pieces, because the excluded point is interior.