Goals:

- Describe the object we are going to use calculus on and how it appears in our everyday lives.
- Learn how to mathematically represent a function and manipulate them while avoiding common mistakes.

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?

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:

- $f(0)$
- $f(-1)$
- $f(-a)$
- $f(x + h)$
- $f(x + h) - f(x)$

**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:

- expand then combine like terms whenever you can
- use Fraction Law 5 to cancel factors if applicable
- multiply all fractional expressions together to write your answer as one fraction
- etc.

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)$

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:

- Assume the domain is $\mathbb{R}$.
- Look for numbers (call them
**problems**), when evaluated, result in something that is not a real number. Problems are - Plugging a number where you end up dividing by zero.
- Plugging a number where you end up taking the square root of a negative number.
- 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 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)$.