Hi, everyone. Welcome to our lecture on functions. First of all, let's define what these things actually are. We will say that a function is a rule that assigns each element in a set to a unique element in another set. These are just rules, are sets that we're going to work with. Are usually sets or subsets of the real numbers. We can think about it as a rule or machine sometimes where you give me a number and I will manipulate it, I will change it, I will do something to it. A very simple example of a function, we've seen the formula for the area of a circle, A equals pi r squared. You give me a radius 1, I'll give you back the area. If the radius is 1, I square it, multiply it by pi, 1 squared of course is 1 times pi is pi. You can give me two, and I'll square it to get four times it by pi, and I'll get 4 pi. You can compute this function, you can evaluate this function by plugging in different numbers of r. Often time there's a picture you can think of numbers going in to the machine. Here's your function calculator, and then it spits out the answer. As I plug in a number for r, let's say r is two, the function this machine takes two, and it does the arithmetic, it does all the manipulations that you want. Of course here the area is pi r squared. R square, get 4, times it by pi and I output, the machine outputs the number 4 pi. This rule, this machine is what we're after when we talk about functions. now, if we start with two related variables, we can identify one as the first variable and the other as the second variable, and then we can consider these pairs containing their variable, containing their corresponding value. If the set of ordered pairs satisfies the function definition, then we can say that the second variable is a function of the first. In this example, we can say that r is a function of a. I don't have to use r, I don't want to use a. Oftentimes you'll see f, x, y, or using Greek letters. Just be comfortable with any variables that you see. The variable that's used in the formula is called your independent variable. In this case here, r is the independent variable and the variable corresponding to the name of the function is our dependent variable. A would be our dependent variable. Here is another example of a function, let's keep using geometric examples. If I have a square with side s and then the area of that square, of course, is side squared. In this example, the formula for area depends on the side. So our dependent variable becomes the A and our independent variable, the one that's used in the formula is our s for side. We can write formulas down all day, but often we want to visualize these formulas via their graphs, and we want to know what the graph looks like. What are the geometric shapes that we're playing with, that we are manipulating when we work with these functions? When we're given a graph, we can check to see if that graph satisfies the definition of a function. We have to make sure that the uniqueness part of the definition is satisfied. Which means that if I give you an x value, there's only one y value that corresponds to it. These criteria is known as the vertical line test, often abbreviated as VLT. It says the following; a graph is the graph of a function if and only if there is no vertical line, no up-down line that crosses the graph more than once. A couple of things about this notation, if you haven't seen this before, this iff is if and only if, this is an abbreviation, please don't tell me I spelled if wrong. If and only if means that if one sort of a sentence is true, the other side is true as well. So if and only if, iff for abbreviation. To use the vertical line test, you'll often be given a graph. For example, if I give you a circle, or I give you the parabola, or I give you something a little more fancy, maybe this one, what you do is you look at the graph and you ask yourself, can I draw a vertical line in such a way that I cross more than once, twice is fine, or just more, but vertical has to be straight up and down. As you notice, if I draw the vertical line all the way to the left, then sure, I don't actually cross the graph. Of course, you want to draw it on the graph, and when you do this, you cross the graph more than once. This is not the graph of a function by the VLT. If I have the parabola and you start drawing vertical lines, you'll quickly realize that you only cross the graph once, no matter what vertical line you draw. Yes, this is the graph of a function. Pause the video for a second and try the third one. Is this graph that's given, again, I don't have a formula for it, just look at the graph, is this graph given the graph of a function, use the vertical line test. When you do this, if you start drawing vertical lines, you'll see that the graph only crosses the axis once. Once again, yes, this passes our tests, this passes the vertical line test. This is in fact the graph of a function. When we have our function again, think of it as a machine. I input some variable in, I do some manipulation to that variable and the machine outputs a new number or new expression. Number in, number out, expression in, expression out, whatever it's doing. With any machine, you have to be careful what you feed the machine. Now, with this function, with this idea of a function as a machine, we're going to define the domain. The domain will be the set of numbers, often a subset of the reals, that are allowed to be used in the function. The set of numbers that are allowed, and I say, well, wait a minute, what do you mean allowed? Like I can't use the number seven? Maybe, it depends. For example, if I talk about a radius of a circle, so if I say A equals Pi r squared, it doesn't make sense to talk about a circle of negative radius. That just doesn't make sense when we think about a circle and what radius represents, it's a distance from the center. You might even want to say, having a circle of radius zero is silly, just a single point, but maybe you want to argue that or not. Our domain in this example, let's just make it positive. We'd say the domain is all real numbers that are positive. I don't want zero, that's the world's worst circle, and I don't want negative, that doesn't make sense for a radius, so my domain will be r greater than zero. This is the subset of the real numbers that are allowed in my function. Let's do another example. What if I said y is one over x? So take the reciprocal of a number. If you give me seven, I return 1/7, if you give me nine, I return 1/9, that's my domain. What numbers am I allowed to take the reciprocal? One over a number is like division. Now I'm allowed to take the reciprocal of every number or divide by a real number except x equals 0. My domain, I got to throw that one away. I'm going to say x is not equal to 0. Let's do one more. What if I said y equals x squared? Am I allowed to square any numbers? Are there any numbers that you're not allowed to square? Think about this for a minute. I can take a negative number and square it, that's fine. Zero squared is just zero. A positive number squared is positive. In this case, the domain here would be all real numbers. When we can write that using our set notation, this is the R. This means all real numbers from minus infinity to infinity. But some functions you're allowed to throw everything in, and some functions you got to be careful about what you throw in to the domain. The domain captures what is allowed. The range of numbers is then your set of outputs of the function. If I give you a graph and you're looking at a graph, this would be the set of y values. Just as a quick example, let's look at our last example here y equals x squared. This is the graph of the parabola. I'm allowed to square anything I want. Of course, the domain here is all reals. But if you take a negative number and square it, you get back a positive number. If you take zero and square it you get back zero. You take a positive number and square it, you get back a positive number. The y-values that you get here, the range is all y greater than or equal to zero. You will never get a negative number if you square a real number. Now we're going to start talking about function notation. If we call the function, usually we use f for function, f is our machine. We have functioned numbers in our domain. We feed those numbers into my machine and the machine outputs values in the range. We usually write this using parentheses. Now this gets a little confusing sometimes. For example, let's just say two is going in and five is going out. This function whatever it does turns a two into a five. Maybe it adds three to every number, who knows. When I write that, the function itself, we use f and then parentheses, and we'll use x here. We would read this as saying, f of 2 would be 5 when I evaluate or plug-in for x and say this function takes in two an outputs five. Let's make it official and say that this function takes a number and adds three. Another example, what happens if I feed three to this function? If three is going to the machine and the machine adds three, then all of a sudden f of 3 becomes 6. We would read this as saying, f of 3 is 6. The confusion that a lot of students have is they see parentheses and they think I'm multiplying or something here, but this is important, you're not multiplying. Think of the parentheses as the mouth of the machine, you're feeding the function in. This is not multiplication. What's interesting is well where we're going is eventually we're not going to throw in numbers all the time. I can certainly throw in anything I want. These functions are dumb. They just do whatever you tell them. It says I'll add three. If I throw in smiley face into my function, this will say, okay, this is smiley face plus 3. It doesn't really think too hard about what it's allowed to do and eventually where we're going of course is not throwing smiley faces but we're going to throw in expressions. Like what happens if I take a minus 1 and throw that into the function. Well, this will say, okay, no problem. I'll take a minus 1 and I'll just add 3, which we can simplify to get of course, a plus 2. What's going to happen is we're going to start to throw and not just numbers but expressions into these function. Look for this letters of the functions and parentheses and just realize it is not multiplication. Our goal in this video is really to study linear functions. Linear functions are defined to be very special functions. They're of the form f of x equals ax plus b, where a and b are some real numbers, there are some constants, and this is called a linear function. The reason why it's called a linear function, is because if I write the equation y equals ax plus b, then of course I get a line. The graphs of these things are lines. The slope of the line is given by the first variable, often called m but we will use a here and the intercept of the line is given by b. Linear functions are graphs that are straight line, and any non-vertical straight line is the graph of a linear function. We've seen these before, so our practice now is just to get used to this using function notation. Let's do an example. Find the slope of the line 2x minus 3y is 3. Remember the slope is the coefficient against the x, when I write this function in its standard form, in the form ax plus b. The problem is as I write 2x minus 3y is 3, I am not in that form, I have to solve for y, so let's do that now. Let's move the 2 actually other side, I get negative 3y is minus 2x plus 3. Let's divide everything by negative 3, I get y is positive 2/3x and then minus 1. The slope in this particular example, the coefficient on the x will be positive 2/3. Often the most important property, even more so than the y-intercept is the slope of the line. I wanted the x-intercept, I want to know where this graph crosses the x-axis, you set the y-value equal to 0. When I set the y-value equal to 0, I get 0 equals 2/3x minus 1, and then of course I solve for x. Let's add 1 to both sides, you get 2/3x equals 1, and so of course x is 3/2. The intercept is 3/2, 0. If you get asked for the y-intercept, well, then of course we're going to set x equal to 0, appreciate there for a minute, when x equals 0 is the point where the graph crosses the y-axis. When I set x equal to 0, I get y equals 2/3 times 0 minus 1. The point that is the y-intercept is then 0, minus 1. Oftentimes you'll be given a graph of a line and you know that there are 2 points that go through it. You have x1 and y1, some specific point where the number's given, you have another point, x2, y2, and they ask you to find the equation of the line that passes through these two given points. Often that means you're going to want to calculate slope so you can find slope and put it into your equation. The slope is defined, this is usually denoted as m, our slope is defined as the change of y over the change of x. Sometimes people call this rise over run. The formula for this is the difference between the y values, y2 minus y1, and the difference between the corresponding x value. It's important that whatever points you use first, you line them up accordingly. As a quick example, let's find the slope of a line that passes through 2, 3 and negative 4, 0. What's the slope? Remember the slope is the change of y over the change of x, so I take my y-values, 3 minus 0, over 2 minus, minus 4, watch that double negative, you get 3/2 plus 4, which is 3/6, better known as 1/2. Now, sometimes students get confused, they say, wait a minute, what if I pick a different point? What if I start with the other point or write this backwards? Does it matter which number I call x1 or x2? Let's do it again, but switch the values. In this example over here, I called the first point y1, but now let's switch it. What if I started and called the 0, y1? I would do 0 minus 3, but now I have to do the corresponding x-value, so I have minus 4, minus 2. What if I had chosen this one, do I get a different answer? Let's see, so 0 minus 3 is negative 3, minus 4, minus 2 is negative 6, and it turns out, after you simplify and cancel the negatives, you get 1/2 again. Of course it doesn't matter which order, as long as you are consistent, the equation of a line through the points is the same whether you start with the first point or the second point. Just to bring this all the way through to completion, if I wanted the equation of a line, I already have m here, so why don't we write it as y equals mx plus b. I'm going to replace my m with my 1/2, that I just found, and now the question is, how do I get b? Let's pick any point we want, how about we pick 2 and 3, and I'll plug those in for x and y. When y is 3, I get 1/2x, which is going to be 2, so times 2 plus b and I get 3 is 1 plus b, so of course b has equal 2. You can use any point you want to plug in for x and y and you get equation of only b. My final equation for this line is y equals 1/2x plus 2. The final check, you can certainly plug in the other point that you didn't use and say, well what happens if I plug in x is negative 4, you're going to get negative 4 divided by 2, which is negative 2, and then add 2, you get 0. This other point does satisfy the equation of this line, this nice, linear function. We have different ways to present the equation of a line, a line with slope m, and through a given point, x1, y1 has the point-slope equation. Y minus y_1 is m, x minus x_1. It's named after the things that you have. If I have a point and I have a slope, I'm going to use the point-slope equation, and this will give me the equation of a line. You can always rearrange this equation and put it into different forms. You can put it into the form y equals mx plus b, but it's usually common to get a point and a slope and write it in this form. Just a couple of things that we should keep in mind. If I have parallel lines, then I have the same slope, whatever the two lines are, they'll have the same slope. In your head, imagine two parallel lines, their rate of change is exactly the same, they have two slopes. If you have perpendicular lines, these are lines that meet at a right angle. Let's draw two different perpendicular lines here. Then the slope of one turns out to be the negative reciprocal of the slope of the other. Just some things to keep in mind, if your graph goes up, if your line has a nice increase in quality to it, your slope is going to be positive. If your line is coming down, you're going down the hill, your slope is going to be negative, and if your line is nice and flat and boring, then we say that m is zero, we'll have zero slope. Vertical line has no slope. This point-slope equation compared to last one is different than the y equals mx plus b that we saw. But you can certainly change formulas, and rearrange, and put it into that form. That formula that we saw, the y equals mx plus b, its official name is the slope-intercept equation of a line. This is the formula that you know and love, y equals mx plus b. Again y, because I'm given the slope, I can see it, I can use it, and now instead of another point, I'm actually given the specific point that is the intercept. Again, these names of these formulas, they come from the fact that you can see you have all the pieces that build it, and this point-slope equation of a line I have the slope m, I have the intercept of the line, b, and the linear function that's described by this equation would just be, if I write it in function notation, f of x equals mx plus b. Just as a specific case, if the slope m is zero, then my function simplifies a little bit, and I get f of x equals b, just b, the constant. This is a horizontal line with slope equal zero going right through point (0,b). This constant linear function is a very special case that I don't want to throw out, but I don't want to forget about it either. It's a very simple form. F of x equals seven, or Pi, or whatever constant you want. These are nice horizontal lines, very special linear functions. Let's do one example and then let you go off and try some on your own. Let's find a line that passes through the (3,1), and we'll say is perpendicular to the line y equals 2x minus 1. Here we go. I want the equation of a line that passes through (3,1) and is perpendicular to the line y equals 2x minus 1. First, what can I grab from this? If I'm perpendicular to a certain line that I know the slope of this line is going to be 2. But the slope that I want then is the negative reciprocal. I negate and flip, two-step process. The slope that I want is negative 1, and I also know that I go through the point (3,1). I have a point, and I have a slope. Well, now it makes sense to use the point-slope formula. This is y minus y_1, is mx minus x_1. Let's plug in all the things I have. I have y minus 1 is equal to the slope x minus. Let's clean this up a little bit and put it in a different form. We have y minus 1 is negative 1.5 x plus 3/2. Distribute the 1.5 to both pieces. Then let's add the 1 to both sides. I get negative 1.5 x plus 5/2. This is our good old slope-intercept form, y equals negative 1.5 x plus five. If they had asked me for parallel, I would've used just 2, because parallel lines have the same slope. I can put this, of course, in any form that they ask. Be ready to work with these variables, x or y. F of x are different letters, Greek letters. Why not pick your favorite scary variables, and be ready to work with any equations of lines. Of course, always graph these things. Just realize when you're pushing the symbols around a page, and really manipulating lines in the x, y form. All right, great job on this video. The next video we'll study quadratic functions. We'll start to add more pieces and more complexity to these linear functions. I'll see you there.