Functions |
Contents: This page corresponds to § 1.3 (p 103) of the text.
Suggested Problems from Text
p. 111 #1, 2, 6, 7, 9, 12, 14, 15, 20, 23, 25, 27, 29, 31, 38, 39, 41, 44, 45, 47, 48, 51, 55, 58, 60, 79
Function Notation
Domain and Range
Application: Cable Route
Example 1.
In Example 4 of the section Lines in the Plane, we were introduced to a sales clerk Joe whose monthly pay was a function of his monthly sales. If y = pay and x = sales, then
Equation 1:
y = 0.08 x + 1000.
The quantity y is a function of the quantity x because specifying a dollar amount for x determines the value of y.
It is often convenient to give functions names and use function notation. When we write
f(x) = 0.08 x + 1000,
we have named the function f and f(1600) = 0.08*1600+1000 = 1128.
f(1600) is a compact way of saying "the y value determined by x = 1600".
Example 2.
A lumber yard sells walnut for $5.25 per board foot when you order less than 100 board feet. If you order 100 board feet or more, then the price per board foot is $4.75.
Let x stand for the number of board feet in your order, and let c be the cost of your order. Clearly, c is a function of x, but the formula is not as simple as in Example 1. In fact, we need two formulae: one to use when x is less than 100 b.f., and another for orders of 100 b.f. or more. c is an example of a piece-wise defined function.
.
The cost of 65 b.f. of walnut is c(65) = 5.25*65 = 341.25.
The cost of 130 b.f. of walnut is c(130) = 4.75*130 = 617.50.
Note on Technology
Piecewise-defined functions can be specified with one formula in the Java Calculator and Java Grapher with the aid of the relational operators L (less than) and LE (less than or equal to).
In the calculators the expression x LE 3 has the value 1 when x is less than or equal to 3, and the value 0 when x is greater than 3. The expression x L 3 has the value 1 when x is strictly less than 3, and 0 when x is greater than or equal to 3.
The expression (5.25*x)*(x L 100) is equal to 5.25*x as long as x < 100, and it is 0 if x is greater than or equal to 100. This is "half" of the function c defined above! The other half of c is (4.75*x)*(100 LE x). Since the two halves have the value 0 when x is out of their range, we can add the two formulas together to get a single formula for c. So, the function c is represented in the calculators by
(5.25*x)*(xL100)+(4.75*x)*(100LEx).
You should convince yourself that this is true.
(a) Open the Java Calculator (link at top of page) and enter the formula above in the f text box (copy and paste will work). Notice that while we have named the function c, in the calculator it is called f because we entered it in the f text box. Now put the cursor in the calculator window and find the values f(65) and f(130) that we computed above. Note that these are really c(65) and c(130), respectively.
(b) Find f(100) and f(99). Clearly, it would not be a good idea to order 99 b.f. of walnut, because we would pay less for 100 b.f.! Experiment with the calculator to find the order size where you would start to save money by going up to 100 b.f.
Example 3.
Equation 2:
y2 = x
Equation 2 does not describe y as a function of x. When we solve Equation 2 for y we get two solutions:
y = sqrt(x) and y = -sqrt(x).
So, choosing a value for x does not determine a value for y. Let x = 1. Then x = 1, y = 1 is a solution for Equation 2, and x = 1, y = -1 is also a solution for Equation 2.
A function of an independent variable, x, is evaluated at a number by substituting the number for x in the function formula. Sometimes the need arises to substitute another formula for the independent variable.
Example 4.
Let f(x) = x2 - x + 1.
- f(-2) = (-2)2 -(-2) + 1 = 7.
- f(t) = t2 -t + 1. Here we are simply changing the name of the independent variable.
- f(3t - 1) = (3t - 1)2 - (3t - 1) + 1 = (9t2 -6t +1)-(3t - 1)+1 = 9t2 - 9t + 3.
- f( z2 ) = (z2 )2 - (z2 ) + 1 = z4 - z2 +1.
The domain of a function is the set of values that the independent variable (often x) may assume.
The range of a function is the set of values that the dependent variable may assume.
Occasionally the domain of a function is specified along with the formula.
Example 5.
The cost of producing x units of a certain product in a month is
C(x) = 10,000 + 3x, where 0 < x < 100,000.
Here the restrictions on x are made for practical reasons. The factory is not capable of producing more than 100,000 units in a month. Since x is the number of units produced, a negative value does not make sense.
It is more common for a function to be described by a formula and for the domain to be implied by the formula. This means we let the domain be the set of all values that make sense in the formula.
Example 6.
f(x) = 1/(x2 - 4).
There are two values of x that would make the denominator equal to 0, namely x = 2 and x = -2. Since division by 0 is not defined, 2 and -2 are not in the domain of f. The domain of f is the set of all numbers other than 2 and -2.
What is the domain of g(x) = sqrt( x - 1)? Note that the square root function is not defined for numbers less than 0, but sqrt(0)=0. Answer.
Example 7.
Let f(x) = x2 - 1. The formula makes sense for any number x, so the domain of f is the set of all real numbers. The range is the set of numbers that are function values. For example, f(0) = -1, so -1 is in the range of f. f(3) = 8, so 8 is in the range of f. The number -2 is not in the range of f, because there is no number a such that f(a) = -2. The reason for this is that x2 is always greater than or equal to zero (x2 >= 0); so, x2 - 1 is always greater than or equal to -1.
In general, finding the range of a function is more difficult than finding its domain. However, the graph of f provides useful information about the range, so we will talk more about range in the next section on graphs of functions.
We need to run a power line from point A on the north shore of a river to point B on the south shore. Point O is south of A, directly across the river and 900 meters from A, and B is 2000 meters east of O. (See the figure in the Cable Route applet below.)
The cost of running cable under the river is $12 per meter, and the cost of running cable on dry ground is $8 per meter. The plan is to run the cable under the river to point L on the south side, then extend to B. The problem is to find the location of L that is most economical.
Consider the two extreme cases:
1. If L is the same as O, then this is the path that requires the least amount of cable under water. The cost is $12 * 900 = $10800 to cross the river and $8 * 2000 = $16000 for the over land portion, so the total cost is $26800. In the Cable Route applet, drag the point L to point O to verify this calculation. Note that once you have clicked the mouse in the applet area to gain focus, the right and left arrow keys will also move point L
2. If L is the same as B, then all the cable is under water. The distance from A to B is
d(A,B) = sqrt(9002 + 20002).
So, the cost of this route is approximately $ 26318.05. Use the applet to verify this calculation.
Let x be the distance (in meters) from point L to point O. For example, in extreme case 1 above, x = 0, and in extreme case 2, x = 2000. If we choose a value for x, then that determines the location of L, and that determines the cost. Therefore, the total cost c is a function of x.
(a) Let d be the distance from A to L. Then d is a function of x. Find a formula that expresses d as a function of x. Answer
(b) Find a formula that expresses c as a function of x. Answer
(c) Find c(600) and c(850). Use the Cable Route applet to check your answers.(d) Use the applet to approximate the location of L that minimizes the cost.