7.2
What is a function?
As we have seen above, a line y = 3x + 4 sets up a relation between x, y so that for every value of x there is an associated well defined value of y, namely 3x + 4. We may give a name to this expression and write y = f (x) where f (x) = 3x + 4. We wish to generalize this idea.
Definition of a function. Given two variables x, y we say that y is a function of x on a chosen domain D if for every value of x in D, there is a well defined value of y. Often this is rephrased as “for every value of x in D, there is a well defined value of y” which means the same thing.
Sometimes we can give a name to the procedure or formula which sets up the value of y and write y = f (x).
We often describe x as the independent variable and y as the dependent variable related to it by the function.
The chosen set of values of x, namely the set D is called the domain of the function. 2
The range of the function is the set of all “values” of the function. Thus for the the function y = x2 with domain ℜ, the range is the set of all non negative real numbers
or the interval [0, ∞). Some books use the word “image” for the range. Be aware that some books declare this range as the intended set where the
y-values live; thus, for our y = x2 function, the whole set of reals could be called the
range. We prefer to call such a set “target” and reserve the term “range” for the actual set of values obtained.
In other words, a target of a function is like a wish list, while the range is the actual success, the values taken on by the function as all points of the domain are used. It is often difficult to evaluate the range.
We will not, however, worry about these technicalities and explain what we mean if a confusion is possible.
1. Polynomial functions. Let p(x) be a polynomial in x and let D be the set of all real numbers ℜ. Then y = p(x) is a function of x on D = ℜ.
It is known that for any odd degree polynomial,the range is ℜ, while for any even degree polynomial, the range is an interval of the form [a, ∞) or (−∞, a] for some a ∈ ℜ. We don’t have enough tools yet to prove it.
The polynomials p(x) = x + 1 and p(x) = x2+ 1 respectively illustrate this.
If we take a polynomial with real or complex coefficients we can also take a larger domain for it, namely C the field of complex numbers. The target is
2Technically, this domain must be a part of our concept. We get a different function if we use a
different domain.
Thus, the function defined by y = 3x+ 4 where D = ℜ -the set of all reals and the function defined by y = 3x + 4 where the domain is ℜ+ -the set of positive real numbers are two different functions.
118 CHAPTER 7. FUNCTIONS
then taken as the field of complex numbers.
It is an amazing fact that the range for a complex polynomial function can be completely described. If the polynomial is just a constant c (i.e. has degree zero) then the range is just the single number c, but it is always equal to C in all other cases. In other words, if f (x) is a polynomial of degree at least 1 with complex coefficients and k is any complex number, then k is in the range of the function f or explicitly the equation f (x) = k has at least one solution! This is known as the Fundamental Theorem of Algebra.
2. Rational functions. Let h(x) = x − 1
(x − 2)(x − 3). Then y = h(x) has a well defined value for every real value of x other than x = 2, 3. There is a convenient notation for this set, namely ℜ \ {2, 3}, which is read as “reals minus the set of 2, 3”. Let D = ℜ \ {2, 3}. Then y = h(x) is a function of x on D.
3. Piecewise or step functions. Suppose that we define f (x) to be the integer n where n ≤ x < n + 1. It needs some thought to figure out the meaning of this function. The reader should verify that f (x) = 0 if 0 ≤ x < 1; f(x) = 1 if 1 ≤ x < 2 and so on. For added understanding, verify that f(−5.5) = −6, f (5.5) = 5, f (−23/7) = −4 and so on.
This particular function is useful and is denoted by the word floor, so instead of f (x) we may write f loor(x).
There is a similar function called ceiling or ceil for short. It is defined as ceil(x) = n if n − 1 < x ≤ n.
In general, a step function is a function whose domain is split into various intervals over which we can have different definitions of the function.
A natural practical example of a step function can be something like the following:
Shipping Charges Example.
A company charges for shipping based on the total purchase.
For purchases of up to $50, there is a flat charge of $10. For every additional purchase price of $10 the charge increases by $1 until the net charge is less than $25. If the charge calculation becomes $25 or higher, then shipping is free!
7.2. WHAT IS A FUNCTION? 119
Purchase price Shipping charge Comments
x ≤ 0 0 No sale!
0 < x ≤ 50 10 Sale up to $50
50 < x < 200 10 + ceil( x − 5010 ) Explanation below.
200 ≤ x 0 Free shipping for big customers!
The only explanation needed is that for x > 50 the calculation of shipping charges is 10 dollars plus a dollar for each additional purchase of up to 10 dollars.
This can be analyzed thus: For x > 50 our calculation must be $10 plus the extra charge for (x − 50) dollars. This charge seems to be a 10-th of the extra amount, but rounded up to the next dollar. This is exactly the ceil function evaluated for (x − 50)/10.
This calculation becomes 25 = 10 + 15 when x = 200 and ceil((200 − 50)/10) = 15.
Finally, according to the given rule we set S(x) = 0 if x ≥ 200.
About graphing. It is often recommended and useful to make a sketch of the graph of a function. If this can be done easily, then we recommend it. The trouble with the graphical representation is that it is prone to errors of
graphing as well as calculations. The above example can easily be graphed, but would need at least a dozen different pieces and then reading it would not be so easy or useful. On the other hand, curves like lines and circles and other conics can be drawn fairly easily, but if one relies on the graphs, their
intersections and relative positions are easy to misinterpret.
In short, we recommend relying more on calculations and less on graphing! 4. Real life functions. Suppose that we define T (t) to be the temperature of some
chemical mixture at time t counted in minutes. It is understood that there is some sensor inserted in the chemical and we have recorded readings at, say 10 minute intervals for a total of 24 hours.
Clearly, there was a definite function with well defined values for the domain 0 ≤ t ≤ (24)(60) = 1440. The domain might well be valid for a bigger set. We have, however, no way of knowing the actual function values, without access to more readings and there is no chance of getting more readings afterwards.
What do we do?
Usually, we try to find a model, meaning an intelligent guess of a mathematical formula (or several formulas in steps), based on the known data and perhaps
120 CHAPTER 7. FUNCTIONS
known chemical theories. We could then use Statistics to make an assertion about our model being good or bad, acceptable or unacceptable and so on. In this elementary course, we have no intention (or tools) to go into any such analysis. In the next few sections, we explain the beginning techniques of such an analysis; at least the ones which can be analyzed by purely algebraic
methods.