
# 1.3: Functions

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

A function $$y=f(x)$$ is a rule for determining $$y$$ when we're given a value of $$x$$. For example, the rule $$y=f(x)=2x+1$$ is a function. Any line $$y=mx+b$$ is called a linear function. The graph of a function looks like a curve above (or below) the $$x$$-axis, where for any value of $$x$$ the rule $$y=f(x)$$ tells us how far to go above (or below) the $$x$$-axis to reach the curve.

Functions can be defined in various ways: by an algebraic formula or several algebraic formulas, by a graph, or by an experimentally determined table of values. (In the latter case, the table gives a bunch of points in the plane, which we might then interpolate with a smooth curve, if that makes sense.)

Given a value of $$x$$, a function must give at most one value of $$y$$. Thus, vertical lines are not functions. For example, the line $$x=1$$ has infinitely many values of $$y$$ if $$x=1$$. It is also true that if $$x$$ is any number not 1 there is no $$y$$ which corresponds to $$x$$, but that is not a problem---only multiple $$y$$ values is a problem.

In addition to lines, another familiar example of a function is the parabola $$y=f(x)=x^2$$. We can draw the graph of this function by taking various values of $$x$$ (say, at regular intervals) and plotting the points $$(x,f(x))=(x,x^2)$$. Then connect the points with a smooth curve. (See figure 1.3.1.)

The two examples $$y=f(x)=2x+1$$ and $$y=f(x)=x^2$$ are both functions which can be evaluated at any value of $$x$$ from negative infinity to positive infinity. For many functions, however, it only makes sense to take $$x$$ in some interval or outside of some "forbidden'' region. The interval of $$x$$-values at which we're allowed to evaluate the function is called the domain of the function.

Figure 1.3.1. Some graphs

For example, the square-root function $$y=f(x)=\sqrt{x}$$ is the rule which says, given an $$x$$-value, take the nonnegative number whose square is $$x$$. This rule only makes sense if $$x$$ is positive or zero. We say that the domain of this function is $$x\ge 0$$, or more formally $$\{x\in R\mid x\ge 0\}$$. Alternately, we can use interval notation, and write that the domain is $$0,\infty)$$. (In interval notation, square brackets mean that the endpoint is included, and a parenthesis means that the endpoint is not included.) The fact that the domain of $$y=\sqrt{x}$$ is $$[0,\infty)$$ means that in the graph of this function (see figure 1.3.1) we have points $$(x,y)$$ only above $$x$$-values on the right side of the $$x$$-axis.