Functions are a tool for describing the real world in mathematical terms. A function can be represented by an equation, a graph, a numerical table, or a verbal description.
Functions arise whenever one quantity depends on another. For example, the area of a circle depends on its radius, or the cost of mailing a package depends on its weight. To analyze these relationships, we must first have a precise definition of what constitutes a function.
.png)
A function $f$ is a rule that assigns to each element $x$ in a set $D$ exactly one element, called $f(x)$, in a set $E$.

It’s helpful to think of a function as a machine. If $x$ is in the domain of the function $f$, then when $x$ enters the machine, it’s accepted as an input and the machine produces an output $f(x)$ according to the rule of the function.
So we can think of the domain as the set of all possible inputs and the range as the set of all possible outputs.

Each arrow connects an element of $D$ to an element of $E$. The arrow indicates that $f(x)$ is associated with $x$, $f(a)$ is associated with $a$, and so on. Perhaps the most useful method for visualizing a function is its graph. If f is a function with domain $D$, then its graph is the set of ordered pairs.
$$ \{(x,f(x))|x\in D\} $$
In other words, the graph of $f$ consists of all points $(x,y)$ in the coordinate plane such that $y=f(x)$ and $x$ is in the domain of $f$.

<aside>
The graph of a function $f$. Find the values of $f(1)$ and $f(5)$ and the domain and range of $f$.

</aside>
<aside>
We see that the point $(1, 3)$ lies on the graph of $f$, so the value of $f$ at $1$ is $f(1) = 3$. When $x = 5$, the graph lies about $0.7$ units below the $x$-axis, so we estimate that $f(5)\approx -0.7$.
We see that $f(x)$ is defined when $0 < x < 7$, so the domain of f is the closed interval $[0, 7]$. Notice that $f$ takes on all values from $-2$ to $4$, so the range of $f$ is $[-2, 4]$.
</aside>