Functions

Lesson · Beginner

Algebra

Definition

A function assigns exactly one output to each input.

f:A→Bf:A\to B

If

y=f(x),y=f(x),

then x is the input and y is the output.

Domain and Range

The domain is the set of all allowed inputs.

Domain⁡(f)={x:f(x) is defined}\operatorname{Domain}(f)=\{x:f(x)\text{ is defined}\}

The range is the set of all outputs actually produced by the function.

Range⁡(f)={f(x):x∈Domain⁡(f)}\operatorname{Range}(f)=\{f(x):x\in\operatorname{Domain}(f)\}

For example,

f(x)=x−2f(x)=\sqrt{x-2}

has

Domain⁡(f)=[2,∞)\operatorname{Domain}(f)=[2,\infty)

and

Range⁡(f)=[0,∞).\operatorname{Range}(f)=[0,\infty).
Function mapping from domain A to codomain B
Domain⁡(f)={1,2,3,4}\operatorname{Domain}(f)=\{1,2,3,4\}
Range⁡(f)={a,b,d}\operatorname{Range}(f)=\{a,b,d\}

One-to-One Functions

A function is one-to-one (injective) if different inputs always give different outputs.

x1≠x2⟹f(x1)≠f(x2)x_1\ne x_2\quad\Longrightarrow\quad f(x_1)\ne f(x_2)

Equivalently,

f(x1)=f(x2)⟹x1=x2.f(x_1)=f(x_2)\quad\Longrightarrow\quad x_1=x_2.

Horizontal Line Test

A function is one-to-one exactly when every horizontal line intersects its graph at most once.

This is called the horizontal line test.

Horizontal line test for one-to-one functions

Inverse Functions

If f is one-to-one, we can reverse the correspondence between inputs and outputs.

The resulting function is called the inverse function and is denoted by

f−1.f^{-1}.

If

f(a)=b,f(a)=b,

then

f−1(b)=a.f^{-1}(b)=a.

Thus,

Domain⁡(f−1)=Range⁡(f)\operatorname{Domain}(f^{-1})=\operatorname{Range}(f)

and

Range⁡(f−1)=Domain⁡(f).\operatorname{Range}(f^{-1})=\operatorname{Domain}(f).

Finding an Inverse

To find f−1f^{-1}:

1. y=f(x)y=f(x)

2. Interchange xx and yy

3. Solve for yy

4. Replace yy by f−1(x)f^{-1}(x)

For example, if

f(x)=3x+5,f(x)=3x+5,

then

y=3x+5y=3x+5

Interchange x and y:

x=3y+5x=3y+5

so

y=x−53.y=\frac{x-5}{3}.

Therefore,

f−1(x)=x−53f^{-1}(x)=\frac{x-5}{3}

Composition of a Function and Its Inverse

A function and its inverse undo each other:

f−1(f(x))=xf^{-1}(f(x))=x

and

f(f−1(x))=xf(f^{-1}(x))=x

whenever the expressions are defined.

Graph of an Inverse

The graphs of ff and f−1f^{-1} are reflections of each other across the line

y=xy=x

because if

f(a)=b,f(a)=b,

then

f−1(b)=a.f^{-1}(b)=a.

Thus, if (a,b)(a,b) is a point on the graph of ff, then (b,a)(b,a) is a point on the graph of f−1f^{-1}.