2.1: Functions

Goals:

Functions All Around Us


The word function describes a dependence of one quantity on another. For example:

Functions should be thought of as a machine.

For example, when you input time, you get out the current temperature. Any temperature app you have uses this idea.

Notice that at a single time point, only one output is returned. This leads us to the mathematical definition of a function.

A function $f$ is a rule that assigns to each element $x$ in a set $A$ to exactly one element, called $f(x)$ in a set $B$.
What are some examples of functions you can think of?

Evaluating a Function


A simple way to mathematically represent input-output is with the notation $f(x)$.

Here, the $x$ between the parenthesis is your input variable, and $f(x)$ is your output.

A function is defined by the formula \[f(x) = x^2 - 2\] Evaluate the following:

Beware: everything between the parenthesis must be treated as input.

From now on, when instructed to perform something, like "evaluate $f(x + h)$" you must fully simplify.

For example, this can mean:

A function is defined by \[g(x) = x^2 - x\] Evaluate the following:

Domain of a Function


The domain of a function is the set of all inputs you can input to get out a valid real number.

The notation for this is $f : \mathbb{R} \rightarrow \mathbb{R}$

When finding domain, follow three steps:

  1. Assume the domain is $\mathbb{R}$.
  2. Look for numbers (call them problems), when evaluated, result in something that is not a real number. Problems are
  3. Remove the problems from $\mathbb{R}$ and write your answer in interval notation.

What is the domain of $g(x) = \sqrt{x}$?
What is the domain of $g(x) = \dfrac{1}{x-4}$?
What is the domain of $g(x) = \dfrac{1}{x^2 - x}$?
What is the domain of $g(x) = \dfrac{x}{\sqrt{x + 1}}$?

Piecewise Functions


Piecewise functions are functions where you have multiple different functions on different parts of the domain.

For example, \[f(x) = \begin{cases} x^2 & x \leq 1 \\ 2x + 1 & x > 1\end{cases}\] is a piecewise function.

Here's how to read this: If your input $x$ is less than or equal to 1, then you need to plug it into $x^2$.

If your input $x$ is strictly greater than 1, plug it into $2x + 1$.

For the above function, evaluate $f(0), f(1)$ and $f(2)$.
Suppose \[f(x) = \begin{cases} 39 & 0 \leq x \leq 2 \\ 39 + 15(x - 2) & x > 2 \end{cases}\] Evaluate $f(-1), f(0), f(1)$ and $f(2)$.