2.3 Concept of a Function

1. Definition of a Function

Let us formally introduce the notion of the function $f: X \rightarrow Y$.

A function $f$ from a set $X$ to a set $Y$ assigns to each element $x$ of $X$ a unique element $y$ of $Y$.

  • We say: $f$ maps $x$ to $y$ (or $y$ is the image of $x$ under $f$).
  • We write: $f(x) = y$ or $f: x \mapsto y$.

2. Mapping Diagrams

We can visualize functions using mapping diagrams, representing our sets as two ellipses and tracking the assignments with arrows.

EXAMPLE 1: A Valid Function (One-to-One)

Let $X=\{1,2,3\}$ and $Y=\{a,b,c,d\}$. In this example, every element in $X$ has a unique image in $Y$.

Set X Set Y 1 2 3 a b c d
  • $f(1) = a \quad \text{or} \quad 1 \mapsto a$
  • $f(2) = b \quad \text{or} \quad 2 \mapsto b$
  • $f(3) = d \quad \text{or} \quad 3 \mapsto d$

EXAMPLE 2: A Valid Function (Many-to-One)

We do not mind if two elements of $X$ have the same image! As long as each element in $X$ only has one arrow leaving it, this is perfectly valid.

1 2 3 a b c d
  • $f(1) = a \quad \text{or} \quad 1 \mapsto a$
  • $f(2) = b \quad \text{or} \quad 2 \mapsto b$
  • $f(3) = b \quad \text{or} \quad 3 \mapsto b \quad \color{#2e7d32}{\text{[Valid!]}}$

EXAMPLE 3: Not a Function (Missed Element)

Notice that the following is not a function. We specified that the rule applies to "each $x$ of $X$". Here, the element $3$ has no image, which breaks the definition.

1 2 3 a b c d
  • $1 \mapsto a$
  • $2 \mapsto b$
  • $3 \mapsto \text{? (Nothing!)} \quad \color{#d32f2f}{\text{[FAILS RULE: Element missed in domain]}}$

EXAMPLE 4: Not a Function (One-to-Many)

Similarly, the following is not a function. The definition states that an element $x$ maps to a unique element $y$. Here, the element $1$ maps to multiple outputs.

1 2 3 a b c d
  • $1 \mapsto a$ AND $1 \mapsto b \quad \color{#d32f2f}{\text{[FAILS RULE: One input, multiple outputs]}}$
  • $2 \mapsto c$
  • $3 \mapsto d$

3. Domain and Range

For a function $f: X \rightarrow Y$:

  • DOMAIN: The set of all $x$'s involved. We usually denote it by $D_f$.
  • RANGE: The set of all $y$'s involved (only the actual images!). We denote it by $R_f$.

The range is not necessarily the whole set $Y$ (the codomain), it may be just a part of $Y$.

The Standard Picture

DOMAIN (X) CODOMAIN (Y) RANGE x f(x) Function f

4. Types of Functions

We classify functions based on how their domain elements map to their codomain elements.

1. One-to-One (Injective)

A function is one-to-one if every element in the domain maps to a unique and distinct element in the codomain. No two elements in $X$ map to the same element in $Y$.

2. Onto (Surjective)

A function is onto if every element in the codomain $Y$ is mapped to by at least one element in $X$. In this case, the Range = Codomain.

3. One-to-One Correspondence (Bijective)

A function is a one-to-one correspondence if it is both injective and surjective. Every element in $X$ pairs perfectly with exactly one element in $Y$, leaving no elements unmapped in either set.

EXAMPLE 5

We have already studied the graphs of linear and quadratic functions. For example:

$x$ $-2$ $-1$ $0$ $1$ $2$
$y = 2x$ $-4$ $-2$ $0$ $2$ $4$
$y = x^2$ $4$ $1$ $0$ $1$ $4$
y = 2x y = x² O x y
For the linear function $f(x) = 2x$: $$ \displaystyle D_f: x \in \mathbb{R} $$ $$ \displaystyle R_f: y \in \mathbb{R} $$
For the quadratic function $f(x) = x^2$: $$ \displaystyle D_f: x \in \mathbb{R} $$ $$ \displaystyle R_f: y \in [0, +\infty) $$

EXAMPLE 6 (Piecewise Function)

Consider the function:

$$ \displaystyle f(x) = \begin{cases} x^2, & -2 \le x \le 0 \\ x, & 1 \le x \le 5 \end{cases} $$
-2 1 5 1 4 5

Clearly, looking at the graph boundaries:

$$ \displaystyle D_f: x \in [-2, 0] \cup [1, 5] $$ $$ \displaystyle R_f: y \in [0, 5] $$

5. Specific Points on a Graph

For $y = f(x)$, there are several key coordinate points to identify. Notice how this geometrically precise curve intersects the axis to form distinct roots:

x y               y-intercept max max min x-intercepts (Roots)
  • y-intercept: We set $x = 0$ and find $y$.
  • x-intercepts (roots): We solve the equation $f(x) = 0$.
  • Local max-min: Peak and valley turning points as shown above.

When we have two graphs $y=f(x)$ and $y=g(x)$, it is also useful to know the intersection points of the two graphs. These are found by solving the equation $f(x) = g(x)$ to obtain $x$, and plugging it back in for $y$.

EXAMPLE 7

Consider the functions $f(x) = (x-3)^2 - 4$ and $g(x) = x - 5$.

  • y-intercept (for f): Set $x=0$, we obtain $y = 5$.
  • x-intercepts (for f): Solve $(x-3)^2 - 4 = 0 \Rightarrow (x-3)^2 = 4 \Rightarrow x-3 = \pm 2$. Hence $x = 5$ or $x = 1$.
  • max-min (for f): This quadratic opens up, so it only has a minimum. The min is at the vertex $(3, -4)$.
  • Intersection points of f and g:
    $f(x) = g(x) \Rightarrow (x-3)^2 - 4 = x - 5 \Rightarrow x^2 - 6x + 9 - 4 = x - 5 \Rightarrow x^2 - 7x + 10 = 0$.
    Solving gives $x = 2$ or $x = 5$. By plugging these into $g(x)$, we find $y = -3$ and $y = 0$.
    The curves intersect exactly at points $(2, -3)$ and $(5, 0)$.
    (2, -3) (5, 0) x y

6. Solving Equations and Inequalities by using Graphs

We can solve equations $f(x) = g(x)$ and inequalities $f(x) > g(x)$ using GDC Graph mode.

METHOD A: Find intersection points of individual graphs

  • Graph $y_1 = f(x)$ and $y_2 = g(x)$.
  • Solutions of $f(x) = g(x)$: the x-coordinates of the intersection points.
  • Solutions of $f(x) > g(x)$: the intervals where curve $y_1$ is geometrically above $y_2$.

METHOD B: Find roots of the combined graph

  • Graph the single combined function $y_1 = f(x) - g(x)$.
  • Solutions of $f(x) - g(x) = 0$: the roots (x-intercepts) of this new graph.
  • Solutions of $f(x) - g(x) > 0$: the intervals where this new graph is positive (above the x-axis).

EXAMPLE 8

Consider again the functions $f(x) = (x-3)^2 - 4$ and $g(x) = x - 5$. Solve $f(x) = g(x)$ and $f(x) > g(x)$.

Method A (Intersections)
        x=2 x=5
Method B (Combined Roots)
        x=2 x=5

Using either method:

$$ \displaystyle \textbf{Equation } f(x)=g(x) \text{ has solutions: } x=2 \text{ and } x=5 $$ $$ \displaystyle \textbf{Inequality } f(x)>g(x) \text{ is true for: } (-\infty, 2) \cup (5, +\infty) $$

EXAMPLE 9

Solve the equation $2^x = 2x + 3$ and inequality $2^x < 2x + 3$.

We graph $y_1 = 2^x$ and $y_2 = 2x + 3$. The exponential curve mathematically drops below the straight line exclusively between the two calculated intersection points.

    y = 2x+3 y = 2^x     -1.30 3.25

Using the GDC intersection function yields the solutions to the equation:

$$ \displaystyle x \approx -1.30 \quad \text{and} \quad x \approx 3.25 $$

Consequently, the solution to the inequality $2^x < 2x + 3$ is exactly:

$$ \displaystyle -1.30 < x < 3.25 $$