Chapter 2 Functions
Functions, Names, Domain, Range
For example, if
denotes the length of the side of a square and the function
denotes the area of such a square, then it makes sense to state that the domain of the function A(x) is the set of nonnegative real numbers, even though the
formula
makes perfect sense for negative
also.
Another example of a function without a formula is the one where the domain is a set of people and the function associates the chosen first name to each person. Here neither the domain nor the values of the function are real numbers and we don't expect any formulas. Fortunately, our functions would usually be about real numbers.
Graphs of Functions
Given a value of x, a function has to give you only one value of y. Thus, vertical lines are not graphs of functions. For example, the line x=1 fails the test in two ways. If we take
, then both (
) and (
) are on the graph, so the vertical line hits in more than one point. (Actually it hits infinitely often.) Also, if we take any other value, say
, then the vertical line does not hit the graph at all! So, we have a failure of the condition, if our domain contains at least one more point besides
.
code for above diagrams
Natural Domains, Assymptotes, Independant and Dependant Variables
We have seen that the domain of a function is a matter of choice, as long we stick to points for which the function can be uniquely evaluated. Given a mathematical formula, it makes sense to think about a `` natural domain '', that is the largest set of real numbers which can be in the domain without violating the definition.
For example, the square-root function
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
natural
domain of this function is
.
We often use a more precise notation which is:
The domain of the function
is {
:
}
Alternately, we can use interval notation, and write that the domain is [
). (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
is [
) means that in the graph of this function (see above) we have points (
) only above x-values on the right side of the x-axis. We may often drop the word ``natural'' and say that it is ``the domain'' of the given function.
In a story problem, often letters different from x and y are used. In using a computer it is not uncommon to denote variables by entire words. For example, the volume V of a sphere is a function of the radius r, given by the formula
=
. Also, letters different from f may be used. For example, if y is the velocity of something at time t, we write
with the letter v (instead of f) standing for the velocity function (and t playing the role of x).
In using a computer system, it might make more sense to write
=
. The computer can do the calculations in either symbolism with equal ease, but it is easy to recall your own reasoning after many days, if you use the long notations.
The letter playing the role of
is called the
independent variable
, and the letter playing the role of
is called the
dependent variable
(because its value ``depends on'' the value of the independent variable). In story problems, when one has to translate from English into mathematics, a crucial step is to determine what letters stand for variables. If only words and no letters are given, then you have to decide which letters to use. Some letters are traditional. For example, almost always, t stands for time.
Example 2.1 (Open-top box)
Solution
Here the box we get will have height
, and rectangular base of dimensions
by
. Thus,
=
.
Here a and b are constants, and V is the variable that depends on x, i.e., V is playing the role of y. Note that for the problem to make sense, the constants a,b have to be positive!
This formula makes mathematical sense for any
, but in the story problem the domain is much less. In the first place, x must be positive. In the second place, it must be less than half the length of either of the sides of the cardboard. Thus, the domain is { x : 0<x<
and 0<x <
}. In interval notation, we write: the domain is the interval (0,
).
We now give more examples of the domain of a purely mathematical function.
Example 2.2: Circle of Radius r centered at Origin.
The equation for this circle is usually given in the form
.
To write the equation in the form
we solve for
, obtaining y = +/-
. But this is not a function, because when we have an x it does not give us a
value of y but rather
(provided that x is between
and
). To get a function, we must choose one of the two signs in front of the square root. If we choose the positive sign, for example, we get the upper semicircle
=
. The domain of this function is the interval
, i.e., x must be between -r and r (including the endpoints). If x is outside of that interval, then
is negative, and we cannot take the square root. In terms of the graph, this just means that there are no points on the curve whose x-coordinate is greater than
or less than
.
Note that it is equally possible to take the negative square root and then the graph is that of the lower semicircle. This is a different function with domain
.
code for above diagrams
Find the domain of
=
.
Solution
To answer this question, we must rule out the x-values that make
negative (because we cannot take the square root of a negative) and also the x-values that make
zero (because if
, then when we take the square root we get 0, and we cannot divide by 0). In other words, the domain consists of all x for which
is strictly positive. We give three different methods to find out when
.
First method.
Factor
as
. The product of two numbers is positive when either both are positive or both are negative, i.e., if either
and
, or else
and
. The latter alternative is impossible, since if
is negative, then
is greater than 4, and so cannot be negative. As for the first alternative, the condition
can be rewritten (adding x to both sides) as
, so we need:
and
(this is sometimes combined in the form 4 > x > 0, or, equivalently, 0 < x < 4). In interval notation, this says that the domain
is the interval (0,4).
Second method.
Write
as
, and then complete the square, obtaining - (
) =
. For this to be positive we need
, which means that
must be less than 2 and greater than -2:
. Adding 2 to everything gives
.
Third method.
Again factor
as
. Thus the product is zero when
or
. Mark these two points on a usual number line. This yields three pieces of the number line which, in interval notation, are:
,
,
Our function
must keep a constant sign on each of these intervals. We can test the signs easily by testing any convenient point in each interval. For example, in
, try
and consider
. In
, try x=1 to get
and in
, try
to get
. So the needed interval is
. Since we need to avoid the zeros of our function, the answer is
=(0,4). In general, you will have to investigate the endpoints separately.
Piecewise Functions, Fuzzy Functions and Philosophy
A function does not always have to be given by a single formula. For example, suppose that
is the velocity function for a car which starts out from rest (zero velocity) at time
; then increases its speed steadily to 20 m/sec, taking 10 seconds to do this; then travels at constant speed 20 m/sec for 15 seconds; and finally applies the brakes to decrease speed steadily to 0, taking 5 seconds to do this. The formula for
is different in each of the three time intervals. The graph of this function is shown below, along with the three formulas:
code for the above diagrams
Not all functions are given by formulas. A function can be given by an experimentally determined table of values. For example, the population y of the U.S. is a function of the time t: we can write
. This is a perfectly good function --- you could graph it if you had data for various t --- but you couldn't find an algebraic formula for it.
Another inportant point is that this is a fuzzy function! Its mathematical form, once written down, gives a good function, but whether it is ``really equal'' to the actual function being discussed is always in doubt and subject to disputes and opinions. Even though the function may exist and be well defined,
it is impossible for anyone to claim to know it completely or to be able to prove the claim!
This raises an interesting philosophical question. Does a function exist if its description seems to make sense, but nobody can ever determine all its function values - or even a formula for it! The uncertainty principle of Physics makes this problem even more intriguing, since it states that it is impossible to precisely determine both the time and the position of a moving particle. In Mathematics, we don't have to worry about such uncertainties!
Shifts and Expansions
Many functions in applications are built up from simple functions by inserting constants in various places. It is important to understand the effect such constants have on the appearance of the graph.
Horizontal Shifts
If you replace x by x-C everywhere it occurs in the foumula for f(x), then the graph shifts over C to the right.
(If C is negative, then this means that the graph shifts over
to the left.)
For example, the graph of
is the parabola
shifted over to have its vertex at the point 2 on the x-axis. The graph of
is the same parabola shifted over to the left so as to have its vertex at
on the x-axis.
If you have to do such sketches by hand, often the trick is to draw the original parabola
and then just shift the y-axis to the desired new location. Think why you must shift the y-axis for an apparent shift in x values. Also, you should remember that to shift a curve to the left is the same as shifting the y-axis to the right by the same amount.
Vertical Shifts
If you replace y by
, then the graph moves up D units.
(If D is negative, then this means that the graph moves down
units.) If the formula is written in the form
and if y is replaced by
to get
, we can equivalently move D to the other side of the equation and write
. Thus, this principal can be stated: to get the graph of
, take the graph of
and move it D units up. For example, the function
=
can be obtained from
(see the last paragraph) by moving the graph 4 units down. The result is the
-parabola shifted 2 units to the right and 4 units down so as to have its vertex at the point (
).
Just as explained above, this can also be accomplished by shifting the x-axis accordingly. It is of course, much easier to redraw the axes in a different location than to redraw the whole curves.
Warning:
Do not confuse
and
. For example, if
is the function
, then
is the function
, while f(x+2) is the function
. To sketch
, the graph of
has to be pushed up by 2 units; but to sketch the graph of
, the same graph has to be pushed to the left by two units.
An important example of the above two principles is the circle
. This is the circle of radius r centered at the origin. (As we saw, this is not a single function
, but rather two functions y=+-
put together; in any case, the two shifting principles apply to equations like this one which are not in the function form
.) If we replace
by
and replace
by
--- getting the equation
--- the effect on the circle is to move it C to the right and D up, thereby obtaining the circle of radius r centered at the point (C,D). This tells us how to write the equation of any circle, not necessarily centered at the origin.
We will later want to use two more principles concerning the effects of constants on the appearance of the graph of a function.
Horizontal Expansion
If A is positive and x is replaced by x/A in a formula, then the effect on the graph is to expand it by a factor of A in the x-direction (away from the y-axis).
This wording supposes that A>1. If A is between 0 and 1, then ``expand by a factor of A'' means ``contract by a factor of 1/A.'' For example, replacing x by
has the effect of contracting toward the y-axis by a factor of 2.
If A is negative, then we expand by a factor of
and then flip about the y-axis. Thus, replacing x by -x has the effect of taking the mirror image of the graph with respect to the y-axis. For example, the function
, which has domain
, is obtained by taking the graph of
and flipping it around the y-axis into the second quadrant.
Vertical expansion:
If B is positive and y is replaced by
in a formula, then the effect on the graph is to expand it by a factor of B in the vertical direction, away from the x-axis.
Note that if we have a function
, replacing y by
is equivalent to multiplying the function on the right by
:
. The effect on the graph is to expand the picture away from the x-axis by a factor of
if
, and to contract it toward the x-axis by a factor of
if 0<
<1. If
<0, then as before the operation is to expand by
a
nd then flip about the x-axis.
As above, we can avoid redrawing the graph in the case of vertical or horizontal expansions. We simply choose an appropriate new scale on the axes, keeping our original curve in tact. While this may be convenient, it may not be the best visual illustration. As we will illustrate below, we can declare a circle to be an ellipse or an ellipse to be a circle by a simple change of scales on the axes. Thus, if we want comparable scales on the two axes, then this trick is not available. See the illustrations below.
code for the above diagrams
Example: (Ellipses)
A basic example of the two expansion principles is given by an
ellipse
of
semimajor axis
a
and
semiminor axis
b . We get such an ellipse by starting with the unit circle --- the circle of radius 1 centered at the origin, the equation of which is
--- and stretching it by a factor of
a
horizontally and by a factor of
b
vertically. To get the equation of the resulting ellipse, which crosses the x-axis at +-a
and crosses the y-axis at +-b, we replace
by
and
by
in the equation for the unit circle. This gives
Finally, if you want to analyze a function that involves both shifts and expansions, it is usually necessary to deal with the expansions first, and then the shifts. For instance, if you want to expand a function by a factor of
in the x-direction and then shift
to the right, you do this by replacing x first by
and then by
in the formula. As an example, suppose that, after expanding our unit circle by a in the x-direction and by b in the y-direction to get the ellipse in the last paragraph, we then wanted to shift it a distance
to the right and a distance
upward, so as to be centered at the point (
). The new ellipse would have equation
A concrete example might be the function
. Naturally, you want to start with the model parabola
. Then you should first do the vertical expansion
, either by just renaming the scale or preferably by sketching the curve again in the new formula. The resulting curve can then be shifted horizontally and vertically as needed. You should experiment with changing the order of these operations and see what trouble you get into.