Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Why this matters

A farmer has 40 metres of fencing and wants a rectangular pen against a long wall, so only three sides need fencing. How large can the pen be? Before we can answer, we need a precise way to say how the area depends on the width. Each width gives exactly one area, some widths make no sense at all (a negative width, or one that uses more than 40 metres of fence), and only some areas can actually occur.

Those three ingredients — a rule, the inputs it accepts and the outputs it produces — are what a function is. Almost everything in calculus is about functions: limits describe how their values behave, derivatives measure how fast they change, and integrals add up their values. This page fixes the vocabulary that the rest of the course uses, and in particular the exact meaning of “increasing”, which later results depend on.

Functions and their graphs

Think of a function as a machine: you feed it an input, and it returns exactly one output. The same input always gives the same output. Different inputs may give the same output.

In words. Every allowed input gets an output, and never more than one. The function is ff; the number f(x)f(x) is its value at one input xx. The graph is the curve y=f(x)y = f(x): the point above (or below) each input xx at height f(x)f(x).

Example. f ⁣:R→Rf\colon \R \to \R, f(x)=x2f(x) = x^2, is a function: each real xx has exactly one square. Different inputs can share a value (f(−2)=f(2)=4f(-2) = f(2) = 4); that is allowed.

Non-example. Assign to each x∈Rx \in \R the real numbers yy with y2=xy^2 = x. This is not a function from R\R to R\R, and it fails in both ways: x=4x = 4 gets two numbers, 2 and -2, and x=−1x = -1 gets none.

Because each xx has only one value, a vertical line x=cx = c meets the graph of a function at most once: at the point (c,f(c))(c, f(c)) if cc is an allowed input, and nowhere otherwise. This is the vertical line test: a curve in the plane is the graph of a function of xx exactly when no vertical line meets it twice (Figure 1).

Two coordinate planes side by side. On the left, the parabola y = x squared, with a dashed vertical line at x = 1.5 that meets it at exactly one point. On the right, the sideways parabola y squared = x, opening to the right, with a dashed vertical line at x = 2.5 that meets it at two points, one above and one below the x-axis.

Figure 1:The vertical line test. Left: the graph of y=x2y = x^2; every vertical line meets it exactly once. Right: the curve y2=xy^2 = x of the non-example; the vertical line x=2.5x = 2.5 meets it twice, so it is not the graph of a function of xx.

The set {f(x):x∈dom⁡f}\{f(x) : x \in \dom f\} is written in set-builder notation, and most domains and ranges below are intervals or unions of intervals; both are introduced in Real Numbers and Intervals.

In words. The domain is what you may put in; the range is what actually comes out. The codomain is only a set that is promised to contain every value, and it may be larger than the range. To find the range you must show two things: every value f(x)f(x) lies in the set you claim, and every element of that set is a value f(x)f(x) for some xx.

Example. For f(x)=x−1f(x) = \sqrt{x - 1}, the square root needs x−1≥0x - 1 \ge 0, so dom⁡f=[1,∞)\dom f = [1, \infty). Every square root is ≥0\ge 0, and each y≥0y \ge 0 is the value at x=y2+1x = y^2 + 1, because y2=y\sqrt{y^2} = y for y≥0y \ge 0 (see the remark on square roots). So ran⁡f=[0,∞)\ran f = [0, \infty).

Non-example. For g ⁣:R→Rg\colon \R \to \R, g(x)=x2g(x) = x^2, the codomain is R\R, but the range is not: -1 is not in ran⁡g\ran g, because no real xx has x2=−1x^2 = -1. Here ran⁡g=[0,∞)\ran g = [0, \infty).

Reading a graph. The domain is the shadow of the graph on the xx-axis: the set of xx that have a point of the graph directly above or below them. The range is the shadow on the yy-axis: the set of heights that the graph reaches (Figure 2). A sketch suggests the domain and range; the algebra above confirms them.

The graph of y = square root of (x minus 1): a curve that starts at the point (1, 0) and rises ever more slowly to the right. A shaded band on the x-axis runs from 1 to the right, and a shaded band on the y-axis runs from 0 upwards. Dashed lines join the point (5, 2) of the graph to 5 on the x-axis and to 2 on the y-axis.

Figure 2:Domain and range as shadows, for f(x)=x−1f(x) = \sqrt{x - 1}. The shadow of the graph on the xx-axis is dom⁡f=[1,∞)\dom f = [1, \infty), and its shadow on the yy-axis is ran⁡f=[0,∞)\ran f = [0, \infty). The point (5,2)(5, 2) of the graph casts 5 into the domain and 2=f(5)2 = f(5) into the range.

Sketching a graph. For a first sketch, find the domain, compute a few values (including any points where the formula changes, and where the graph crosses an axis), plot them, and join them in order of increasing xx, leaving gaps where xx is not in the domain. Where the formula changes, compare the heights that the two pieces give there before you join across that point: if they differ, the graph jumps, and no segment is drawn across the jump. For example, the function that is 0 for x<0x < 0 and 1 for x≥0x \ge 0 has domain R\R, but its graph is two horizontal pieces, with no segment from (−1,0)(-1, 0) to (0,1)(0, 1).

Symmetry and monotonicity

Two kinds of shape recur throughout calculus. Some graphs look the same after a reflection: the graph of y=x2y = x^2 is unchanged by reflection in the yy-axis. Some functions only ever go up (or only ever go down) as xx moves to the right. Both properties save work: a symmetric graph needs to be sketched only for x≥0x \ge 0, and a function that always goes up (one that is strictly increasing, in the words of the definition below) takes each value at most once.

In words. An even function takes the same value at xx and at −x-x, so its graph is symmetric under reflection in the yy-axis. An odd function takes opposite values at xx and −x-x, so its graph is symmetric under a half-turn about the origin: if (x,y)(x, y) is on the graph, so is (−x,−y)(-x, -y). Both need a domain that is symmetric about 0, so a function whose domain is not symmetric is neither even nor odd. The condition on the values must hold for every xx in the domain; one xx where it fails is enough to show that a function is not even (or not odd).

Example. x↦x4−3x2x \mapsto x^4 - 3x^2 is even and x↦x3x \mapsto x^3 is odd. The names come from these examples: a polynomial with only even powers of xx is even, and one with only odd powers is odd.

Non-example. f(x)=x2+xf(x) = x^2 + x is neither even nor odd: f(1)=2f(1) = 2 and f(−1)=0f(-1) = 0, so f(−1)≠f(1)f(-1) \ne f(1) and f(−1)≠−f(1)f(-1) \ne -f(1). Most functions are neither even nor odd.

In words. Increasing means “never goes down” as you move right through SS; strictly increasing means “always goes up”. A strictly increasing function is increasing, but not the other way round: a function that is increasing may stay level for a while. The definition compares any two points of SS, not just neighbouring ones.

Example. f(x)=2x+1f(x) = 2x + 1 is strictly increasing on R\R: if x1<x2x_1 < x_2, then 2x1+1<2x2+12x_1 + 1 < 2x_2 + 1. A constant function on a set SS with at least two points is both increasing and decreasing on SS, but neither strictly increasing nor strictly decreasing on SS. (On a set with only one point there are no x1<x2x_1 < x_2 to compare, so every function is strictly increasing and strictly decreasing there.) The function

g(x)={0,x<0,x,x≥0,g(x) = \begin{cases} 0, & x < 0, \\ x, & x \ge 0, \end{cases}

is increasing on R\R but not strictly increasing, because g(−2)=g(−1)=0g(-2) = g(-1) = 0 (Figure 3).

Two graphs side by side. On the left, a graph that runs along the x-axis at height 0 from x = -3 to x = 0 and then rises in a straight line to the point (3, 3). On the right, the cubic curve y = x cubed from x = -1.5 to x = 1.5, which rises everywhere and flattens out briefly near the origin without becoming level.

Figure 3:Left: the function gg above is increasing on R\R but not strictly increasing: it stays level for x<0x < 0. Right: x↦x3x \mapsto x^3 is strictly increasing on R\R (Exercise 13 proves it). Its graph is very flat near 0, but no two points of it are at the same height.

Non-example. h(x)=x2h(x) = x^2 is not monotone on R\R: −1<0-1 < 0 with h(−1)>h(0)h(-1) > h(0), but 0<10 < 1 with h(0)<h(1)h(0) < h(1). It is strictly decreasing on (−∞,0](-\infty, 0] and strictly increasing on [0,∞)[0, \infty), which is why we always say where a function is increasing.

Worked examples

Common mistakes

Rigorous track

Summary

Exercises

Where this leads

These topics build on this one:

Found an error on this page? Report it (the form opens with this page filled in).