1 00:00:00,000 --> 00:00:04,845 [MUSIC] Calculus study functions and this course is no exception. 2 00:00:04,845 --> 00:00:09,093 We're going to be studying functions in this course, alright? 3 00:00:09,093 --> 00:00:14,385 Functions like f of x or the sine function or the square root function. 4 00:00:14,385 --> 00:00:19,156 And that raises a question what are functions?If If we're going to be 5 00:00:19,156 --> 00:00:22,734 studying functions, we should know what they are. 6 00:00:22,734 --> 00:00:27,504 And that question is pretty metaphysical. I mean what are numbers? 7 00:00:27,504 --> 00:00:31,332 What are numbers for? I mean that question doesn't make a lot 8 00:00:31,332 --> 00:00:34,443 of sense does it? I, you know, it's not like a number four 9 00:00:34,443 --> 00:00:38,969 is a physical object that I can go look at it and see if it's got polka dots or 10 00:00:38,969 --> 00:00:40,779 it's striped or something, right? 11 00:00:40,779 --> 00:00:43,381 But I know four objects when I see them, right? 12 00:00:43,381 --> 00:00:47,906 I sort understand what numbers do more than what they are in some metaphysical 13 00:00:47,906 --> 00:00:50,112 sense. The same is true about functions, 14 00:00:50,112 --> 00:00:52,545 right? I'm not really going to tell you what a 15 00:00:52,545 --> 00:00:55,147 function is. What I'm going to tell you is what a 16 00:00:55,147 --> 00:00:57,579 function does. This is what a function does. 17 00:00:57,579 --> 00:01:01,200 A function assigns to each number in its domain another number. 18 00:01:01,200 --> 00:01:05,788 And this definition doesn't say anything about how the function does that 19 00:01:05,788 --> 00:01:08,068 assignment. Let's see an example. 20 00:01:08,068 --> 00:01:13,168 Just make up some example. Suppose I've got some function, I'll call 21 00:01:13,168 --> 00:01:17,888 it f, f for function. Maybe this function assigns to the number 22 00:01:17,888 --> 00:01:23,673 two, the number four. So, I'll write f(2) is 4 or f(3) is 9 Or 23 00:01:23,673 --> 00:01:28,545 f(4) is 16 of f(5) is 25. I'm just making this up. 24 00:01:28,545 --> 00:01:32,380 This is a function. And I'm telling you what number it 25 00:01:32,380 --> 00:01:34,170 assigns to each number, right? 26 00:01:34,170 --> 00:01:36,701 f assigns the number two, the number four. 27 00:01:36,701 --> 00:01:40,529 f(3) is 9, right? So, f assigns to the number three, the 28 00:01:40,529 --> 00:01:41,887 number nine. Well, look, 29 00:01:41,887 --> 00:01:45,900 I'm not going to just list off every single assignment that f makes. 30 00:01:45,900 --> 00:01:51,539 So instead, one way to talk about these assignments is to use a rule, like f(x) = 31 00:01:51,539 --> 00:01:56,443 x^2. And this single rule explains how all of 32 00:01:56,443 --> 00:01:58,968 these assignments are made, alright? 33 00:01:58,968 --> 00:02:03,062 This rule said that f assigns to the number x, the number x^2. 34 00:02:03,062 --> 00:02:07,644 So in particular, f assigns the number five, five squared or 25, or f assigns 35 00:02:07,644 --> 00:02:12,287 the number four, four squared which is sixteen or f assigns the number three, 36 00:02:12,287 --> 00:02:16,685 three squared which is nine, alright? So, a lot of times, when you actually 37 00:02:16,685 --> 00:02:21,451 want to talk about how these assignments are being made, use some sort of rule 38 00:02:21,451 --> 00:02:25,850 like this: and you write f of x is something, to compute the output value, 39 00:02:25,850 --> 00:02:29,000 right? So, a function assigns to each number in 40 00:02:29,000 --> 00:02:33,110 its domain another number. One way to do that is with a rule. 41 00:02:33,110 --> 00:02:37,700 Of course, this definition of function involves another word, domain. 42 00:02:37,700 --> 00:02:41,103 What is a domain? Unless, I say otherwise, the domain 43 00:02:41,103 --> 00:02:44,774 consists of all numbers for which the rule makes sense, 44 00:02:44,774 --> 00:02:47,911 right? A function assigns to each number in its 45 00:02:47,911 --> 00:02:52,272 domain another number. And the domain is just the numbers that I 46 00:02:52,272 --> 00:02:55,852 can plug in. Let's take a look to see what I mean by 47 00:02:55,852 --> 00:02:59,846 this. Suppose I've got a function f(x) = 1 / x. 48 00:02:59,846 --> 00:03:04,942 So, that's a function given by a rule. It takes an input x and produces the 49 00:03:04,942 --> 00:03:06,595 output 1 / x, right? 50 00:03:06,595 --> 00:03:09,762 It assigns the number x, the number 1 / x. 51 00:03:09,762 --> 00:03:12,930 But this rule doesn't always make sense, right? 52 00:03:12,930 --> 00:03:15,435 I'm dividing by x, alright? 53 00:03:15,435 --> 00:03:22,080 And to divide by x, what do I need? Well, 54 00:03:22,080 --> 00:03:30,175 I must have that x is not zero, not permitted to divide by zero. 55 00:03:30,175 --> 00:03:34,855 So, I can plug in any number for x except for zero. 56 00:03:34,855 --> 00:03:41,970 And that's when this rule makes sense. So, I'll summarize that by saying that 57 00:03:41,970 --> 00:03:48,042 the domain of f is all real numbers except zero. 58 00:03:48,042 --> 00:03:51,416 So, a function takes some input and produces some output. 59 00:03:51,416 --> 00:03:55,091 That's what it does. But how is that supposed to make us feel, 60 00:03:55,091 --> 00:03:57,802 you know? How are we supposed to imagine that? 61 00:03:57,802 --> 00:04:02,741 Well, here's one metaphor that you could use to try to think about what a function 62 00:04:02,741 --> 00:04:06,657 is actually doing, right? You could imagine a, a conveyor belt with 63 00:04:06,657 --> 00:04:07,982 the function, you know, 64 00:04:07,982 --> 00:04:10,633 And you could imagine the numbers coming in. 65 00:04:10,633 --> 00:04:13,404 Boom. Being hit by the function and then going 66 00:04:13,404 --> 00:04:17,260 out transformed somehow, by whatever the rule is of the function. 67 00:04:17,260 --> 00:04:21,594 Here's what I'm talking about. I've got a conveyor belt here, I got this 68 00:04:21,594 --> 00:04:24,769 big box, and imagine if that big box is the function. 69 00:04:24,769 --> 00:04:28,127 And in here, I've got the input, imagine the number five. 70 00:04:28,127 --> 00:04:30,569 Let's see what this machine is going to do. 71 00:04:30,569 --> 00:04:36,247 Maybe this is the function f(x) = x^2 + x and I've got this number five here. 72 00:04:36,247 --> 00:04:40,765 And I'll start the conveyer belt going so the number five starts moving through the 73 00:04:40,765 --> 00:04:45,283 machine and when the machine is done processing it, it comes out the other 74 00:04:45,283 --> 00:04:48,370 side and now, it's the number 30, alright. 75 00:04:48,370 --> 00:04:56,090 Because f(5) is 5^2 + 5, which is 25 + 5 is 20. 76 00:04:57,980 --> 00:05:02,610 So, we have seen how you can write down a function by using a, a rule involving 77 00:05:02,610 --> 00:05:04,510 these, these mathematical symbols, right? 78 00:05:04,510 --> 00:05:08,250 x^2 + x. You can also write down a function just 79 00:05:08,250 --> 00:05:12,140 using English words. So, let's see an example of that, just 80 00:05:12,140 --> 00:05:16,986 make up a new function here. I'll call it R(x) and I'll define · R(x) 81 00:05:16,986 --> 00:05:21,354 to be thrice, that means three times, thrice the square root of x. 82 00:05:21,354 --> 00:05:25,995 And here, I've computed some, some values of the function, you know, like the 83 00:05:25,995 --> 00:05:28,861 function that four is six. Well, why is that? 84 00:05:28,861 --> 00:05:34,389 Well, R(4) would be three times the square root of four, which is three times 85 00:05:34,389 --> 00:05:37,459 two which is six. Okay. Now, of course, when I do the 86 00:05:37,459 --> 00:05:41,974 calculation this way, you know, it's not too surprising that instead of writing 87 00:05:41,974 --> 00:05:44,636 this out in words, thrice the square root of x, 88 00:05:44,636 --> 00:05:48,456 I mean I could have just written three times the square root of x. 89 00:05:48,456 --> 00:05:51,002 So, maybe you're not too impressed with this. 90 00:05:51,002 --> 00:05:55,285 The point is that you can define a function just by writing down what the 91 00:05:55,285 --> 00:05:58,005 function is supposed to do using English words. 92 00:05:58,005 --> 00:06:02,635 So, we've seen an example of a function that we defined just in terms of algebra, 93 00:06:02,635 --> 00:06:07,023 f(x) = x^2 + x. I've also seen an example of a function 94 00:06:07,023 --> 00:06:10,070 that I define entirely with just English words. 95 00:06:10,070 --> 00:06:12,769 We can kind of combine those two things, alright? 96 00:06:12,769 --> 00:06:17,044 We can use the English to sort of pick out different kinds of of algebra. 97 00:06:17,044 --> 00:06:21,902 Let's see an example of that now. So, here's another function I just made 98 00:06:21,902 --> 00:06:25,136 up. g(x) is x^22 if x is bigger than or equal 99 00:06:25,136 --> 00:06:28,446 to five. And twice x if x is less than five. 100 00:06:28,446 --> 00:06:33,220 The point here is that I'm using just a little bit of English. 101 00:06:33,220 --> 00:06:37,608 So, this word, if, in order to select based on how big x is, 102 00:06:37,608 --> 00:06:42,795 a different algebraic rule for calculating the function and this is a 103 00:06:42,795 --> 00:06:46,612 little abstract. Let me just do with some calculations and 104 00:06:46,612 --> 00:06:50,053 that might convince you, you know, how, how this notation is, 105 00:06:50,053 --> 00:06:53,870 this so-called piecewise notation works. So, what is g(1)? 106 00:06:53,870 --> 00:06:58,581 Well, let's take a look. One is less than five so that means I use 107 00:06:58,581 --> 00:07:03,656 this second rule for calculating g, so it's two times one which is two. 108 00:07:03,656 --> 00:07:08,005 What's g of, say, four? Well, four is still less than five so I 109 00:07:08,005 --> 00:07:12,790 use the second rule again. Twice the input, two times four and that 110 00:07:12,790 --> 00:07:16,502 means the output is eight. But what is, say, g(5)? 111 00:07:16,502 --> 00:07:18,853 Ooh. Five is not less than five. 112 00:07:18,853 --> 00:07:24,466 Five is greater than or equal to five. So, this if is telling me to use the 113 00:07:24,466 --> 00:07:30,382 first of the two rules for calculating g so I'm going to use five squared as the 114 00:07:30,382 --> 00:07:33,442 output and that will be 25. Or g(10). 115 00:07:33,442 --> 00:07:38,708 Well, ten is definitely bigger than or equal to five and it's bigger than five. 116 00:07:38,708 --> 00:07:43,907 So, I again use the first rule and the output to this function is computed as 117 00:07:43,907 --> 00:07:47,350 ten squared or 100. So, this is, you know, really more 118 00:07:47,350 --> 00:07:50,523 complicated than just using some algebra, right? 119 00:07:50,523 --> 00:07:55,857 I'm using these if statements to select which of these two rules g will use to 120 00:07:55,857 --> 00:07:59,669 compute its output. in principle, functions can be really 121 00:07:59,669 --> 00:08:02,359 complicated. I mean, all the examples we've seen are 122 00:08:02,359 --> 00:08:05,893 just doing various kinds of algebra. I mean, maybe different algebra, 123 00:08:05,893 --> 00:08:08,424 depending upon which value of x I'm plugging in. 124 00:08:08,424 --> 00:08:11,958 But it's all, you know, adding, subtracting, multiplying, dividing that 125 00:08:11,958 --> 00:08:14,648 sort of thing. But you can do really complicated things 126 00:08:14,648 --> 00:08:18,234 with, with functions. let's see an example of something that is 127 00:08:18,234 --> 00:08:21,241 you know really different than doing straight up algebra. 128 00:08:21,241 --> 00:08:23,034 I'll do a much crazier example. Alright. 129 00:08:23,034 --> 00:08:26,990 C(x) is the number of even digits in the number x, when x is a whole number. 130 00:08:26,990 --> 00:08:30,411 It is zero if x isn't a whole number, so otherwise. 131 00:08:30,411 --> 00:08:33,832 And it is a really different and crazy function, right? 132 00:08:33,832 --> 00:08:36,296 So, C of, say, 7236 is two, and why is that? 133 00:08:36,296 --> 00:08:40,333 This is a whole number so I use the first part of the rule. 134 00:08:40,333 --> 00:08:43,412 And the number of even digits in this number, 135 00:08:43,412 --> 00:08:45,396 well, I count them. That's odd, 136 00:08:45,396 --> 00:08:46,012 even, odd, 137 00:08:46,012 --> 00:08:49,023 even. So, two and six are the two even digits. 138 00:08:49,023 --> 00:08:53,917 The value of that function is two. Well, let's take a look at this number 139 00:08:53,917 --> 00:08:57,160 here, 60,202. That again is a whole number, so the 140 00:08:57,160 --> 00:09:01,620 value of the function at 60,202 is the number of even digits in x. 141 00:09:01,620 --> 00:09:06,822 And this number has how many even digits? One, two, three, four, five, they're all 142 00:09:06,822 --> 00:09:10,926 even digits so that value is five. Here's another example. 143 00:09:10,926 --> 00:09:13,220 Here's another 5-digit number. 53,531. 144 00:09:13,220 --> 00:09:17,932 Again, it's a whole number so I use the first part of the rule, the number of 145 00:09:17,932 --> 00:09:20,970 even digits. I count how many of these digits are 146 00:09:20,970 --> 00:09:23,016 even. Five is odd, odd, odd, odd, odd. 147 00:09:23,016 --> 00:09:27,108 There are no even digits. So, the value of this function is zero at 148 00:09:27,108 --> 00:09:29,984 this point. Now, if I plug in a number that's not a 149 00:09:29,984 --> 00:09:34,203 whole number like this, this is not a whole number, then I use the otherwise 150 00:09:34,203 --> 00:09:37,722 part of the definition. And the function at that point is just a 151 00:09:37,722 --> 00:09:39,885 zero. So, we can use English to define a 152 00:09:39,885 --> 00:09:43,710 function but you got to be careful, alright? Sometimes, when you write 153 00:09:43,710 --> 00:09:47,986 another definition of a function, you might write down something that's more 154 00:09:47,986 --> 00:09:51,755 ambiguous than, than you intended. So, let's try to define a function. 155 00:09:51,755 --> 00:09:55,355 Just making this stuff up, I'll call the function B(x) for bad. 156 00:09:55,355 --> 00:09:59,800 And I'll say that the value of B(x) is some rearrangement of the digits of x. 157 00:09:59,800 --> 00:10:02,376 And it's okay that I'm using English to define my functions. 158 00:10:02,376 --> 00:10:06,531 There's nothing wrong with that. But this definition is too ambiguous to 159 00:10:06,531 --> 00:10:11,678 be the definition of a function. here's a definition of what goes wrong. 160 00:10:11,678 --> 00:10:16,755 What is the function's value at 352? Well, the function takes its input and 161 00:10:16,755 --> 00:10:21,902 rearranges the digits somehow, alright? So, you might think that the functions 162 00:10:21,902 --> 00:10:26,144 value at 352 is 325. Because 325 is some rearrangement of the 163 00:10:26,144 --> 00:10:31,152 digits of 352, right, I took the five and the two, swapped their positions. 164 00:10:31,152 --> 00:10:36,229 But then, the functions value at 352 should also be 235 because 235 is also a 165 00:10:36,229 --> 00:10:40,871 rearrangement of 352. The function's value with 352 should also 166 00:10:40,871 --> 00:10:45,872 be 532 because 532 is some rearrangement of the digits of 352. 167 00:10:45,872 --> 00:10:48,021 This is terrible, alright? 168 00:10:48,021 --> 00:10:56,854 A function is suppose to take its input and produce unambiguously a single output 169 00:10:56,854 --> 00:11:01,701 value. But this so-called function takes this 170 00:11:01,701 --> 00:11:09,348 single input value and purportedly produces all these possible outputs. 171 00:11:09,348 --> 00:11:13,010 This thing here is not a function, alright? 172 00:11:13,010 --> 00:11:18,504 A function takes one input and produces one output. 173 00:11:18,504 --> 00:11:19,366 [MUSIC]