Lecture 10: Wat is a Function, definition, piecewise defined functions, difference quotient, domain of a function A function arises wen one quantity depends on anoter. Many everyday relationsips between variables can be expressed in tis form. Example 1 We ave already seen examples of functions in our lecture on lines. For example, if a car leaves Matville at 1:00 p.m. and travels at a constant speed of 60 miles per our for two ours, ten te distance in miles traveled by te car after t ours(d) (assuming it as not stopped along te way or canged speed) depends on te time, or is a function of time (t) = t ours: D = D(t) = 60t for 0 t 2 We can use tis general formula to calculate ow far te car as traveled at any given time t. For example after 1/2 our (t = 1/2) te car as traveled a distance of D = 60 1 = 30 miles. 2 Here is anoter everyday example of a function. Example Consider te volume of a cylindrical glass wit radius = 1 inc. We ave a formula for te volume; V = πr 2 = π in 3, were is te eigt of te glass in inces and r = 1 is te radius. We see tat te value of te volume depends on te eigt, ; V is a function of. We sometimes indicate tat te value of V depends on te value of, by writing te formula as V () = π in 3. Wen = 2, V = V (2) = and wen = 3, V = V (3) = In tis section, we will examine te definition and general principles of functions and look at examples of functions wic are more complex tan lines. Definition of a Function A function is a map or a rule wic assigns to eac element x of a set A exactly one element called f(x) in a set B. Example Te rule wic assigns to eac real number its square is a function. We ave A = (, ) or te set of all real numbers. Since te square of a real number is a real number, we ave B is also te set of real numbers. If x is an element of A, tis rule assigns te element f(x) = x 2 in B to x. If x = 2, te f( 2) = ( 2) 2 = 4. In sort, tis is te map or rule wic sends x to x 2. We will focus on functions were te sets A and B are sets of real numbers. Te symbol f(x) is read as f of x or f at x and is called te value of f at x or te image of x under f. Te possible values of x vary ere since x can take any value from te set A, ence x is a variable. We call x te independent variable. We may replace te symbol x by any oter symbol ere, for example t or u, in wic case te symbol for our function canges to f(t) or f(u) respectively. Likewise we can replace te name of te function, f, by any oter name in te definition, for example or g or D. So if u denotes our independent variable and D is te name of our function, te values of te function are denoted by D(u). 1
Te set of numbers (or objects) to wic we apply te function, A, is called te domain of te function. Te set of values of B wic are equal to f(x) for some x in A is called te range of f. We ave range of f = {f(x) x A} In te example sown above were f(x) = x 2, we see tat te values of f(x) = x 2 are alwys 0. Furtermore, every positive number is a square of some number, so te range of f ere is te set of all real numbers wic are 0. If we can write our function wit a formula (or a number of formulas), as in te above example were f(x) = x 2, ten we can represent te function by an equation y = f(x). In our example above, we migt just describe our function wit te equation y = x 2. Here y is also a variable, wit values in te range of te function. Te value of y depends on te given value of x and ence y is called te dependent variable. Note tat writing a function in tis way allows us to draw a grap of te function in te Cartesian plane. It is elpful to tink of a function as a macine or process tat transforms te number you put troug it. If you put in te number x, ten te macine or process canges it and gives back f(x). Anoter way to visualize a function is by using an arrow diagram as sown below (for te example f(x) = x 2 above). A = Real Numbers B = Real Numbers x!x 2 9 3 2 1 0-1 4 1 0-2 -3 For every element, x, in te domain of te function we ave exactly one arrow leaving te point representing tat element, indicating tat te function can be applied to any element in te domain and we get exactly one value in B wen we apply te function to x. On te oter and, an element in te set B can ave 0, 1 or more tan one arrow pointing towards it. If te element is not in te range, it as no arrows arriving at it, if it is in te range it as at least one arrow arriving at it. Note tat in our example, we ave two arrows arriving at 4 in te set B because te values of f at ( 2) and 2 are bot 4, i.e. f( 2) = f(2) = 4. Example Lets summarize wat we know about our example above were our function is te rule wic send any value x from te real numbers to te value x 2. As pointed out above, we can give a formula for f(x), namely f(x) = x 2. We can use tis formula to calculate te value of te function for any given value of x. For example f( 1) = ( 1) 2 = 1, f(0) = 0 2 = 0, f(1/2) = (1/2) 2 = 1/4. 2
Te domain is te set of all real numbers and te range is te set {y R y 0}. We can represent tis function by an equation y = x 2. Here x is te independent variable wic can take any values of x in te real numbers (te domain) and y is te dependent variable wose values will be in te range. Representing a function We saw above tat tere are a number of ways to represent a function. We can represent it by 1. A verbal description 2. an algebraic representation in te form of a formula for f(x) (possibly not just a single formula). 3. an equation of te form y = f(x), wic we can grap on te Cartesian plane 4. an arrow diagram or a table (especially if we ave a finite number of points in te domain). We will focus on using te algebraic description and te grapical description of a function. Te Cartesian plane allows us to translate te results we derive algebraically to a grapical interpretation and vice-versa. Evaluating a function Here we will focus on deriving and using te algebraic description of some examples of functions. Example Let f(x) = x 2 + 2. Evaluate te following f( 2), f(0), f(3/2), f(10). Piecewise Defined Functions Not every function can be defined wit a single formula (suc as te absolute value function), sometimes we may need several lines/formulae to describe a function. Tese are called Piecewise Defined Functions. Example Te cost of (sort-term) parking at Sout Bend airport depends on ow long you leave your car in te sort term lot. Te parking rates are described in te following table: First 30 minutes Free 31-60 minutes $2 Eac additional our $2 24 our maximum rate $13 3
Te Cost of Parking is a function of te amount of time te car spends in te lot. If we are to create a formula for te cost of parking = C, in terms of ow long our car stays in te lot = t, we need to give te formula piece by piece as follows: C(t) = $0 0 t 0.5 r. $2 0.5 r. < t 1 r. $4 1 r. < t 2 r. $6 2 r. < t 3r. $8 3 r. < t 4 r. $10 4 r. < t 5 r. $12 5 r. < t 6 r. $13 6 r. < t 24 r. $13 + cost of towing t > 24 r. If you were figuring out ow muc you needed to pay using tis description of te function, you would first figure out wic category you were in (ow long you ad parked for) and ten note te cost for cars in tat category. We proceed in te same way if we are given te formula for any piecewise defined function. Example Let Evaluate te following g(x) = x + 1 if x > 1 x 2 if 1 x 1 4 if x < 1 g( 2), g(0), g(3/2), g(10). Te Difference Quotient Wen we wis to derive general formulas in matematics, we ave to use general variables to represent values in a function so tat we can prove a result for all values in te domain. Tis means tat we often ave to evaluate te function at some combination of abstract values, suc as a, a +, like te ones sown below as opposed to evaluating te function at concrete values suc as 1, 0 etc.... Here are some examples of suc calculations. Te difference quotient f(a + ) f(a) is particularly important wen learning about derivatives. 4
Example Let f(x) = x 2 + 2 and let a be any real number and a real number were 0. Evaluate 1. f(a) 2. f( a) 3. f(a 2 ) 4. f(a + ) 5. f(a+) f(a) Evaluate f(a+) f(a) wen a = 2 Evaluate f(a+) f(a) wen = 0.1 Evaluate f(a+) f(a) wen a = 2 and = 0.1. Example Let k(x) = 2x+1. Evaluate were 0. k(a + ) k(a) were a is any real number and a real number Example Let g(x) = x + 1 if x > 1 x 2 if 1 x 1 4 if x < 1 (a) Evaluate g(0 + ) g(0) for values of for wic < 1 and 0. 5
(b) Evaluate g(1 + ) g(1) for values of wic are greater tan 0. (c) Evaluate g(1 + ) g(1) for values of wic are greater tan 1 and less tan 0. Te Domain of A Function Recall tat te domain of a function f(x) is te set of values of x to wic we can apply te function. Sometimes we explicitly state wat te domain of a function is (see Example A below) and sometimes we just give a formula for te function (see Example B below). In te latter case, it is implicitly assumed tat te domain of te given function is te set of all real numbers wic make sense in te formula. Example A Let f(x) = x 3, 0 x 1 Here we ave explicitly stated tat te domain is te values of x in te interval [0, 1]. Example B Let g(x) = 1 x 2 Here it is assumed tat te domain of tis function is all values of x wic make sense in te formula, tat is te set of all real numbers except 2. Domain of g = {x R x 2} Note Keep in mind wen calculating domains for functions tat we cannot ave 0 as te denominator of a quotient and tat we can only evaluate square roots (or nt roots for n even) for numbers greater tan or equal to zero. Example Find te domain of te following function: f(x) = 5 x 2 6
Example Find te domain of te following function: x 1 R(x) = x 2 Example Find te domain of te following function: x2 + 11 R(x) = x 2 + 3x 10 Domains of common functions It is good to keep te domains of te following functions in mind: Function Domain x n, n N all x R 1, n N {x R x 0} xn n x, n N, n even {x R x 0} n x, n N, n odd all x R 7
Modeling wit functions Example: Income Tax In a certain country, income tax T is assessed according to te following function of income x: 0 if 0 x 10, 000 T (x) = 0.08x if 10, 000 < x 20, 000 1600 + 0.15x if 20, 000 < x (a) Find T (5, 000), T (12, 000) and T (25, 000). (b) Wat do your answers in part (a) represent? 8