 Welcome to the screencast, which is the first in a couple of screencasts where we're going to think about comparing two functions. In this screencast, we're working towards a rigorous understanding of what it means for two functions to be equal to each other. So to do that, let's first remind ourselves what five basic ingredients everything that we consider to be a function needs to have. First of all, everything that we want to be a function needs to have a well-defined set of objects that we wish to change. We now know that by the name domain. Every time I give a function I just specify explicitly what the domain is. Every function also needs to have a well-defined process that carries out or describes how to carry out the changes I wish to bring into effect on the domain. That could be a formula, it could be a set of verbal directions or a picture, something that tells me how to change stuff in the domain to something else. And then we have to have a set that holds the outcomes of the process that we just described. And we now call that the co-domain of the function. We also have these other two properties down here that every valid input needs to produce some kind of outcome. There is no point in the domain that simply doesn't compute to anything. And then any valid input needs to produce only one output, so we don't have a splitting of one input into two outputs. What we're going to do here to compare two functions is really focus on these three ideas up here of the domain, co-domain, and process. And when we compare two functions, we're going to compare those three things. Now let's take a look at a couple of examples, each of which consist of two similar but possibly different functions here. So here's the first pair. F is a function that goes from the real numbers to the real numbers. So notice I've already specified the domain, which is the real numbers, and also the co-domain is the real numbers. And so now I can tell you what the process is. The process of change here is when I'm given a point in the domain, I'm simply adding two to it and that's my output. So this is a very easy function to understand. In fact, I'm going to start setting up a table over here for this function just to kind of record some outputs here. So let's go 0, 1, 2, 3, 4, for example. And this is really simple, f of 0 is 2, f of 1 is 3, 4, 5, and 6. A very simple linear function. Now look at the second function, g. It has a slightly different domain here. This is the set of all real numbers except 2. So on a real number line, it would look like this. Not the whole real number line, but find 2 and just subtract it out. So everything, every real number except 2 is in the domain of this function, r minus the set containing 2. The co-domain is also the real numbers, just like it was for f. And here's the formula for this. Now let's just use that formula straight and make a little table for it. So if I put in 0 for this formula, I would have 0 squared minus 4 divided by 0 minus 2. That would be 2. If I put in 1 for x here, I'd have 1 minus 4, 1 squared minus 4, which is 1 minus 4, over 1 minus 2. That's a negative 3 divided by negative 1, that's 3. If I chose to put in 2, I would be mistaken because I cannot choose to put in 2. 2 is out of the domain, so I'm going to put dne for it does not exist. 2 is not an eligible candidate to be put into this function. I've specifically removed it from the domain here. That's important, so hold on to that thought. If I put in x equals 3, let's see, I would have 9 minus 4, which is 5, over 3 minus 2, which is 1, so I'd have a 5 right here. And if you put in x equals 4, there would be 16 minus 4 up here, divided by 4 minus 2, and that is 6. So what I notice here about these two functions is that a lot of the time, they have the very same output, here, here, not here, but 3 and 4. And if you know, if you're doing a little algebra in your head, you're seeing something here. If I just look at the formula for g, x squared minus 4 over x minus 2, you know, the top is a difference of 2 perfect squares, so I can factor. And I can divide out the x minus 2s if, this is a big, big if, if x is not equal to 2. And that division does not always work. I can't divide out x minus 2 if that x minus 2 equals 0. So that division, that cancellation process is only valid if x is not equal to 2. And that is actually specified here in my domain, but just realize algebraically, this fraction is not totally, totally the same as x plus 2. It's only equal to x plus 2 when x itself is not equal to 2. And we can't just always divide off variables like that. So are these two functions the same or are they different? That's the main question we're dealing with here. And a lot of points there are the same. Every single point except for 2, we found they have the same output. And in fact, algebraically, I can prove that as long as x is not equal to 2, these two functions really do have the same formula. Okay, but they're not totally equal to each other either. And there's one reason why. The number 2 can be put into one of these functions, but not the other. Okay, in other words, this function has a certain domain, and this function has a different domain. Okay, so the fact that domains are different, means that the functions themselves are different in some fundamental way. We would not consider these two functions to be equal, because one function, you can plug 2 into it, and the other one, you can't, very simply. So let's look at another example here of two functions, also called f and g, but defined differently. These two functions both go from the integers to the integers. So they both have the same domain and the same co-domain. Now take a look at the formulas here. The first function's formula is really simple. Anything you put into it gets sent to zero. So let's again make a little table down here just to kind of hold some of the outputs, an n and f of n. This is going to be the easiest table you ever made here. I'm just going to put in five values, negative 2 through positive 2, and everything you put in for f is zero. So you don't have to do any math whatsoever on this. Now looking at g, though, we do have a little bit of a difference here. So g takes n, and first of all, computes n cubed minus n, and then finds the least non-negative residue, mod 3. So let's try to play with that and make our little table here. So let's start in the middle of the table because that seems easiest. So when n is zero, this is going to be zero minus zero, mod 3, that's zero. When n is equal to one, that's going to be one cubed minus one, mod 3, that is also equal to zero. When n is equal to minus one, let's do a little math on that. When n is cubed, n is minus one, or negative one. I have negative one cubed minus negative one. This is negative one plus one. That's identically zero. So if I reduce mod 3, it's still zero. Let's try one of the more interesting ones, like 2. If I put in 2, I get 2 cubed minus 2. That is equal to 8 minus 2, which is 6. Now 6, of course, is not equal to zero, but it is congruent to zero mod 3. And you'll find the same thing happens if you put in negative 2. So now these two functions also seem to have the same output everywhere. It seems to be identically zero no matter what I put in. Even though the formulas are different, I'm noticing they have the same domain, the same co-domain, and what seems to be the same output at every single point. And in fact, I can prove it's not just, this isn't going to happen just for these five points, that you can prove as a lemma, and I will encourage you to prove this as a lemma, that n cubed minus n is congruent to zero mod 3 for every integer n. This is a true fact, and so you should try to prove that. It basically boils down to, if you factored this cubic polynomial over here, you would have n times n plus 1 times n minus 1. That's three consecutive integers there, 1, 2, 3, and one of those has to be divisible by 3. So this lemma is actually true, and n cubed minus n is congruent to zero mod 3 for every single n. So that would prove that these two functions have three things that line up with each other. They have the same domain, they have the same co-domain, and although the formulas look different, they always produce the same output no matter what the input is. So those two functions, although they're superficially different, we might want to consider to be the same. So that leads us up to our big definition here. The functions f and g are equal if three things happen. First of all, the domain of f has to equal the domain of g. The co-domain of f has to equal the co-domain of g. And then for every x in the domain of f, f of x has to equal g of x. So this is what happened with our last example. The domains were equal for those two functions, going from the integers to the integers. The co-domains were equal, and at every point in the domain of f, the functions agreed with each other. So here's a concept check to see how well you're acquiring these ideas. And I want you to really think about this. So let's consider the function f that goes from the real numbers to the real numbers, given by f of x equals the square root of x squared. And this x squared is entirely underneath the radical sign here. So to which of the following functions, as you say is, type over there, is f equal? To which of the following functions is f equal? I'll tell you that this f is equal to at least one of these guys here. So take a look at these four possibilities here. Play with them for a few minutes as you pause the video, and then come back and make your selection. And the correct selection here is going to be only one thing, and that is b, all right? So let's see why b is true, but why a and c and d are not equal to f. Well, first of all, b and f are equal, the function b and the function f are equal, because the domain of b and the domain of f are the same, the co-domain of b and the co-domain of f are the same. And we have this property that we know from algebra that the square root of x squared is equal to the absolute value of x for all x in the real numbers. This is a basic notion of absolute value. So we know that the absolute value function is going to produce the same thing as square root of x squared for all real numbers x, okay? So those two functions b and f have the same domain, have the same co-domain, and they produce the same outputs everywhere. Now, why aren't all the other ones true? Well, it's really easy to get rid of c and d. And d and f are not the same because the domains are different. This one has a domain of the natural numbers, and f doesn't. Okay, there are things that I can plug into f that I can't plug into c. d is not going to be the right one because the co-domain is different. This is the interval 0 to infinity. That's the set of all x's that are bigger than or equal to 0. And that's not the same thing as the co-domain of f, which includes all real numbers. So those two functions are not equal to each other. Finally, function a is not equal to function f. Even though they have the same domain and the same co-domain, they don't always produce the same outputs. For example, a of negative 2 is negative 2. But f of negative 2 would be equal to positive 2, and you can check that out. So they don't always produce the same output on every single input in their domains. So to recap, two functions are equal if and only if their domains are equal, like b and f, their co-domains are equal and they produce the same output at every point. And that's what it means for two functions to be equal. Thanks for watching.