2.1: Functions
Goals:
- Describe what a function is.
- Learn how to mathematically represent a function and manipulate them while avoiding common mistakes.
Functions All Around Us
The word function describes a dependence of one quantity on another. For example:
- The current room temperature is a function of time.
- After a flight takes off, the total distance a plane travels is a function of time since takeoff.
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)$:
everything inside the parentheses must be treated as the input.
A function is defined by the formula \[f(x) = x^2 - 2\]
Evaluate the following:
- $f(0)$
- $f(-1)$
- $f(-a)$
- $f(x + h)$
Hint Everything inside the parentheses is "$x + h$".
- $f(x + h) - f(x)$
From now on, when given a directive, like "evaluate $f(x + h)$" you must fully simplify.
The word "simplify" was was defined in Section 1.4.
A function is defined by \[g(x) = x^2 - x\] Evaluate the following:
- $g(0)$
- $g(-1)$
- $g(-a)$
- $g(x + h)$
- $g(x + h) - g(x)$
Domain of a Function
domain
The domain of a function is the set of all possible inputs, when evaluated, gives you a real number.
Suppose $f(x) = \sqrt{x}$. Show that $x = 0$ is in the domain and $x = -1$ is not.
When finding domain, follow two steps:
- Look for problems (these are numbers, when evaluated, result in something that is not a real number). Problems can be found by
- Setting "denominators" $= 0$ and solving.
- Setting "inside square roots" $< 0$ and solving.
- 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^2-4x}$?
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} 1 & x \geq 0 \\ 0 & x < 0 \end{cases}\]
Evaluate $f(-2), f(-1), f(-0.01), f(0), f\left(\dfrac{1}{100}\right), f(1)$ and $f(2)$.