1 00:00:00,000 --> 00:00:04,197 Functions are going to be the main star of the course. 2 00:00:04,197 --> 00:00:09,960 So we should be building up in sort of a repertoire or library of functions that 3 00:00:09,960 --> 00:00:15,368 we might be interested in studying. Here's the first function in our library 4 00:00:15,368 --> 00:00:18,071 f(x) = x, the identity function. 5 00:00:18,071 --> 00:00:22,269 Whatever you plug in, this function outputs that same thing. 6 00:00:22,269 --> 00:00:25,400 Here's another function, a constant function. 7 00:00:25,400 --> 00:00:28,316 You pick some number c, c stands for constant. 8 00:00:28,316 --> 00:00:30,974 Alright? And you can define this function, 9 00:00:30,974 --> 00:00:34,992 f(x) = c. Whatever you plugin for x, f just ignores 10 00:00:34,992 --> 00:00:37,780 that and then outputs the original value, c. 11 00:00:38,900 --> 00:00:44,212 Here's a function, f(x) = 3x + 2. And if you're thinking about stuff like 12 00:00:44,212 --> 00:00:49,145 that, why not stuff like this? Pick two numbers, a and b, and then you can define 13 00:00:49,145 --> 00:00:56,102 a function like this, f(x) = ax + b. You can think about fifth f(x) = x^5 or 14 00:00:56,102 --> 00:01:00,150 nth power, f(x) = x^n for some fixed value of n. 15 00:01:00,150 --> 00:01:05,020 And about polynomials, like this complicated looking polynomial, f(x) = 16 00:01:05,020 --> 00:01:09,977 2x^3 + 5x^2 - 2x + 1. If you're thinking about polynomials, you 17 00:01:09,977 --> 00:01:13,851 might want to think about roots, f(x) equals, say the square root of x. 18 00:01:13,851 --> 00:01:18,217 You might remember the absolute value function f(x) equals the absolute value 19 00:01:18,217 --> 00:01:21,221 of x. You might have some experience with trig 20 00:01:21,221 --> 00:01:24,660 functions, like sines, cosines, and tangents, 21 00:01:24,660 --> 00:01:29,009 or with other transcendental functions like logarithms and exponentials. 22 00:01:29,009 --> 00:01:31,909 So now we've got our small library of functions, 23 00:01:31,909 --> 00:01:35,716 the identity function, constant functions, polynomials, some trig 24 00:01:35,716 --> 00:01:37,891 functions, and I want more functions. 25 00:01:37,891 --> 00:01:42,845 I, I want some way to be able to take two functions and produce a new function out 26 00:01:42,845 --> 00:01:43,630 of them. Okay. 27 00:01:43,630 --> 00:01:47,799 So in this setup I've got a conveyor belt and I've got two functions, 28 00:01:47,799 --> 00:01:52,149 a function here and a function here. Let's pick out what these functions 29 00:01:52,149 --> 00:01:55,230 should be. Maybe the first function I'll call f and 30 00:01:55,230 --> 00:01:59,290 f(x) would be 2X + 1. So I'll call this function f and maybe 31 00:01:59,290 --> 00:02:03,537 the second function I'll call g and g will take its input and square it, so 32 00:02:03,537 --> 00:02:06,191 g(x) will be x^2. So I'll label this function, g. 33 00:02:06,191 --> 00:02:10,437 And now here, I've got a number 3 and I am going to run that number through the 34 00:02:10,437 --> 00:02:14,418 first function and whatever comes out of the first function, I'm going to plug in 35 00:02:14,418 --> 00:02:16,913 to the second function to see what comes out. 36 00:02:16,913 --> 00:02:20,576 So let's take that number 3, let's start moving the conveyor belt. 37 00:02:20,576 --> 00:02:27,851 It's going to go through the function f, f(3) is 2 * 3 + 1 to 6 + 1, which is 7. 38 00:02:27,851 --> 00:02:34,072 So now we've got a 7 right there. So the 3 went into the function and came 39 00:02:34,072 --> 00:02:38,169 out as a 7. Now I'm going to take the output to f and 40 00:02:38,169 --> 00:02:44,212 put it in to the input of g. So g(7), well it's going to be 7^2 and 41 00:02:44,212 --> 00:02:48,885 that'll be 49. So here now, coming out of the function 42 00:02:48,885 --> 00:02:54,086 g, is the number 49. And I could have written this in a little 43 00:02:54,086 --> 00:03:00,170 bit a little bit of a shorthand way. I could have just written g(f(4)), 44 00:03:00,170 --> 00:03:07,910 right, f(3) is 7 and g(7) is 49. So once I've got this sort of conveyor 45 00:03:07,910 --> 00:03:13,735 belt metaphor going on in my head, I could do the following trick. 46 00:03:13,735 --> 00:03:19,283 I can take two functions. I can take the output to the first 47 00:03:19,283 --> 00:03:24,738 function and plug it in to the input of the second function. 48 00:03:24,738 --> 00:03:25,478