Functions and Graphs

2.2 Functions

Relations Versus Functions

A relation can pair inputs and outputs in many ways. A function is stricter: each input gets exactly one output.

Definition: Relation and Function

A relation is any set of ordered pairs.

A function is a relation where each input $x$ is paired with exactly one output $y$.

Fact: Vertical Line Test

A graph represents a function if and only if every vertical line intersects the graph at most once.

Example: Decide if a mapping is a function

Consider the pairs

$${(-1,4),(0,1),(2,1),(2,5)}. $$

Is this a function?

Show Solution

No. The input $x=2$ is paired with two outputs, $1$ and $5$.

That violates the function rule.

MyOpenMath: Practice: function or not a function (placeholder)

Function Notation and Evaluation

Function notation helps us read expressions as outputs of a rule.

Definition: Function Notation

If a function is named $f$, then $f(x)$ means the output at input $x$.

Example: Evaluate a polynomial function

Let

$$f(x)=x^2-3x+1.$$

Find $f(4)$ and $f(-2)$.

Show Solution

Substitute directly:

$$f(4)=4^2-3(4)+1=16-12+1=5,$$ $$f(-2)=(-2)^2-3(-2)+1=4+6+1=11.$$

Example: Evaluate a piecewise function

Let

$$ f(x)= \begin{cases} 2x+1, & x<0,\ x^2, & x\ge 0. \end{cases} $$

Find $f(-3)$ and $f(2)$.

Show Solution

Since $-3<0$, use $2x+1$:

$$f(-3)=2(-3)+1=-5.$$

Since $2\ge0$, use $x^2$:

$$f(2)=2^2=4.$$

MyOpenMath: Practice: function notation and evaluation (placeholder)