Class 5 Notes I. Lines A. Graphing a Line B. Slopes and Intercepts C. Intercepts D. Slope-Intercept Form E. Practice Problems II. Finding Equations of Lines A. Finding the Equation from a Point and Slope B. Point-Slope Form C. Finding the Equation from Two Points D. Practice Problems III. Relations Between Lines A. Parallel Lines B. Perpendicular Lines C. Practice Problems IV. Finding Intersections of Lines A. Substitution B. Elimination In this class we will cover the simplest sort of function: lines. I. Lines A. Graphing a Line A linear function is just a function that describes something that increases or decreases at a constant rate. As an example, suppose that a man has to take a $20 train ride to get to work, and gets paid $10 per hour. Let's compute the net amount he makes per hour he works. A function for this is f(x) = 10x - 20, where x is the number of hours he works. To see why this is called a linear function, let's make a plot of what it looks like. x | f(x) = y 0 | -20 1 | -10 2 | 0 3 | 10 4 | 20 5 | 30 6 | 40 7 | 50 8 | 60 etc. When plotting linear function, we often refer to f(x) with the letter y. What we have here is a set of (x,y) pairs. Well, we can graph each of these points. (Draw graph) Note that if we connect these points, we get a straight line! That's the deep relationship between algebraic equations and graphs I was referring to earlier. A line describes a certain type of relationship between two quantities, x and y. An equation involving two unknowns, x and y, also describes a certain type of relationship. We can represent that relationship either as a graph or an equation. In some sense, a graph and an equation are really the same thing! So if I ask what we mean by a line, one possible answer is "A certain type of equation." The distinguishing characteristic of the equation of a line is that it is of the form (or can be put into the form) y = mx + b where m and b are any numbers. B. Slopes We can boil the description of a line down to two concepts: its slope and its intercepts. The slope of a line is a measure of its steepness and of whether its headed uphill or downhill. We define the slope of the line connecting any two points as the change in the y coordinate divided by the change in the x coordinate. A useful mnemonic for this is the "rise over the run" (on board) m = delta y / delta x = (y2 - y1) / (x2 - x1) = rise / run For reasons I've never understood, we usually use m to represent the slope of a line. Let's consider an example of this: Find the slope of the line between the points (-3,-2) and (4,1). To find the slope, we just use the formula. m = (y2 - y1) / (x2 - x1) = (1 - (-2)) / (4 - (-3)) = 3/7 That's it. If we want to see what we're doing, we can just draw the graph. (draw graph) As you can see from the graph, we're just taking the change in height, the rise, divided by the horizontal distance, the run. If we're given a line as an equation, one way of finding the slope is just finding any points on that line, then finding the slope between them. For example: Find the slope of the line 3x - 2y = -1. We first pick any two points: (let class pick x values and find the corresponding y values) (plug into formula to get slope of -3/2) If we graph this line, we can see what it looks like. (draw graph) We can at this point note a couple of trends: first, a positive slope indicates a line headed uphill, while a negative slope indicates one headed downhill. Second, the bigger the slope is (in the sense of absolute value), the steeper the line is. C. Intercepts Slope is the first key quantity for a line. The second is the intercepts. The y intercept is what we call the point where the line crosses the y axis. The x intercept is what we call the point where the line crosses the x axis. Let's consider the line we just worked with: 3x - 2y = -1 We want to know where this line crosses the y axis, the y intercept. We could just guess this by looking at the graph, but we can in fact find it exactly from the equation. Remember that a graph, or an equation, is a rule for giving us an x given a y, or vice-versa. The y intercept occurs where the graph crosses the y axis. If we look at this point, we immediately know what its x coordinate is. What is the x coordinate of this point? It clearly has to be zero. But if we know the x coordinate, we can easily get the y coordinate from the equation. -2y = -1 y = 1/2 So the y intercept is (0, 1/2), or just 1/2. Finding the x intercept is exactly the same procedure. We know that where the line crosses the x axis, that point must have y coordinate zero. So we just plug that in to get x: 3x = -1 x = -1/3 So the x intercept is (-1/3, 0) or just -1/3. That's all there is to finding intercepts. C. Slope-Intercept Form (10) It is possible to write the equation of a line so that the slope and one of the intercepts are apppearant, and we can just read them off. This proves to be very convenient. We said before that a line is an equation of the form (on board) Ax + By = C Let's take a concrete example: (on board) 3x - 2y = 1 Let's take this equation and rearrange it to get y by itself. (Let class walk through this.) (on board) 3x - 2y = 1 -3x -3x -2y = -3x + 1 y = (3/2) x - 1/2 There are two things we can notice here. First, suppose we plug in x = 0, to get the y intercept. In this case, the equation just becomes: (on board) x = 0: y = -1/2 So the last number there, the -1/2, is the y intercept. When we write the equation in this form, with y by itself, the pure number on the right side gives us the y intercept. Next, let's calculate the slope of this line. How do we do this? (let class walk through it.) We need two points. We have one point, (0, -1/2). If w take x = 1, we get a second point: (1, 1) So the slope is (on board) m = delta y / delta x = (-1/2 - 1) / (0 - 1) = (-3/2) / (-1) = 3/2 So the slope is 3/2, which is just the coefficient of x. When the equation is written in this form, the slope is just the coefficient of x. We therefore call this form of the equation for a line "slope-intercept form", since it lets us just read off the slope and the y intercept. We usually write this form of the equation (on board) y = mx + b where m is the slope and b is the y intercept. II. Finding Equations of Lines We just learned how to plot lines, how to go from an equation to a graph. As we discussed, though, the graph and the equation really represent the same thing -- so it must be possible to go from graphical information back to an equation. That's the first thing we're going to talk about today: how to find the equation of a line given information about it. A. Finding the Equation from a Point and Slope If we know the slope and intercept of a line, we know everything about it. More generally, if we know the slope and any point on the line, we know everything about it. It's easy to see this intuitively: by telling you a point, I tell you where the line starts. By telling you the slope, I tell you which direction it goes. Thus, if I give you a point and a slope, I've told you where to start and which way to go, which is all there is to a line. So all we need to do is take the intuitive information and turn it into a method for finding the equation. Let's consider an example: (on board) Find the equation of a line passing through the point (-1,2) with slope -1. We'll begin by trying to find the equation in slope-intercept form, which we saw last time is the most convenient form in general. (on board) y = mx + b Recall tht this equation describes a generic line, with m and b as the slope and y intercept. We need to "fill in" m and b in this equation so that it describes our line. The value of m is easy enough to fill in: we know that the slope is -1, and m is just the slope. Thus: (on board) m = -1 We can get b almost as easily. We know that the point (-1,2) is on the line, meaning that if we put in -1 for x and 2 for y, the equation has to come out true. We can just plug in (-1,2) into our y = mx+b form, and that will tell us what b is. (on board) y = mx + b y = -x + b 2 = -(-1) + b 2 = 1 + b b = 1 So we just plug in the point we've been given for x and y, and then solve for b. Thus, the equation for this line is y = -x + 1. To be sure, let's plot this: x Equation y 0 y = -(0) + 1 1 1 y = -(1) + 1 0 -1 y = -(-1) + 1 2 2 y = -(2) + 1 -1 -2 y = -(-2) + 1 3 (draw graph) As we can see from looking at the graph or the table, the line does indeed pass through the point (-1,2). The slope is downhill, as it should be for a negative slope, and it has the right steepness. So this works. Let's try another example. (on board) Find the line through the point (2,3) with slope 1/2. We start with the equation (on board) y = mx + b What do we do first? (let class answer) We immediately know that m = 1/2. What next? (let class answer) Then we plug in x and y to get b: (on board) y = 1/2 x + b 3 = 1/2 (2) + b 3 = 1 + b b = 2 So the equation is (on board) y = 1/2 x + 2 So the approach we have is very simple: (on board) 1. Write down y = mx + b. 2. The slope is m. 3. Plug in the point for x and y, and solve for b. B. Point-Slope Form (10) There is a slight variation on this method which your book uses to find the equation of a line from a point and a slope. I personally think it's fairly silly, since the method we just used is so simple, but let's talk about it for a moment anyway. Consider the following way of writing the equation of a line: (on board) y - y1 = m(x - x1) where x1, y1, and m are just some numbers. The first thing to notice here is that this is the equation of a line. We could easily re-arrange it into the form something times x plus something times y equal some number. The key ingredients are there: a number times x, a number times y, and other pure numbers. Why would we choose to write the equation of a line in this somewhat bizarre form? Here's why: if we're given a point and a slope, we can plug them directly into this form. Let's consider our last problem: (on board) Find the equation of the line that passes through (2,3) with slope 1/2. Now let's write down the point-slope formula: (on board) y - y1 = m (x - x1) Let's fill in the slope for m, and put in (2,3) for x1 and y1. Then we get: (on board) y - 3 = 1/2 (x - 2) How can we simplify this into y = mx + b form? (let class answer) (on board) y - 3 = 1/2 x - 1 y = 1/2 x + 2 Notice that's the same equation we got before. So this is another method of finding the equation given a point and a slope: (on board) 1. Write down y - y1 = m (x - x1). 2. The slope is m. 3. Plug in the point for x1 and y1. 4. Simplify. C. Finding the Equation from Two Points We can extend this a step further. Suppose we have two points. (draw two points on the board) It's pretty clear that there's only one straight line we can draw between these two points. (draw a line through the points) So there must be a way to go from the coordinates of two points to the equation of the line joining them. In fact, the way is really simple. Recall from last week that we know how to find the slope between two points. To find the equation of the line through two points, then, all we have to do is find the slope between them and use our method for finding the equation given a point and a slope. Let's do an example: (on board) Find the equation of the line through (2,3) and (-2,1). OK, first we find the slope. Who remembers how to do that? (let class answer) (on board) m = delta y / delta x = (y2 - y1) / (x2 - x1) = (1 - 3) / (-2 - 2) = -2 / (-4) = 1/2 Now we just find the equation using the slope and one of the points -- it doesn't matter which one, as they'll both give the same answer. How do we do this? (let class answer) (on board) y = 1/2 x + b 3 = 1/2 (2) + b 3 = 1 + b b = 2 So the equation of the line is (on board) y = 1/2 x + 2 Just to verify, let's try plugging in the other point: (on board) y = 1/2 x + b 1 = 1/2 (-2) + b 1 = -1 + b b = 2 So we get the same equation: (on board) y = 1/2 x + 2 Let's graph this. (on board) x Equation y 0 y = 1/2 (0) + 2 2 1 y = 1/2 (1) + 2 5/2 -1 y = 1/2 (-1) + 2 3/2 2 y = 1/2 (2) + 2 3 -2 y = 1/2 (-1) + 2 1 (draw graph) As you can see, this line does indeed pass through both the given points. So finding the line through two points is very simple: just find the slope, then find the line using the point and slope with either point. D. Practice Problems Practice problems to do as time permits: 1. Plot the points (-3,2) and (-1,1). Find the equation of the line connecting the points, and plot it. 2. An architect is drawing blueprints for a wheelchair ramp. In his blueprints, he chooses a coordinate system so the base of the ramp is at (0,0) and y is the vertical direction. a. The wheelchair ramp is to have a slope of 1/10. Find the equation of the line describing the ramp. b. Plot the line. c. The ramp must climb a height of 1 foot. Find the coordinates of the top of the ramp. III. Relations Between Lines A. Parallel Lines Something else neat we can do is use the equations to look at relationships between lines. One common occurence is parallel lines, lines that run next to each other, at constant distance, never touching or diverging. The idea of parallelism gives us another way of defining a line. Suppose I give you a line and a point not on that line. (draw on board) As you can see intuitively, there is only one way to draw a line through the point so that it is parallel to the first line. (draw on board) Thus, this situation uniquely defines a line. There must therefore be a way of getting from a line and point to find the equation of the parallel line -- and there is. Let's take a concrete example. (on board) Find the line through (1,2) parallel to the line y = x - 1. The key thing to notice is that parallel lines have to be equally steep -- otherwise they'd converge or diverge. Thus, parallel lines must have the same slope! With this insight, it's easy to see how to proceed. What is the slope of y = x - 1? (let class answer) It's just 1. Thus, the line we're looking for must also have slope 1. We now have a point and a slope, so we've reduced this to a problem we know how to solve: finding the equation given a point and a slope. How do we proceed then? (let class answer) We know that m is 1, so we just have to plug in x and y to find b. (on board) y = mx + b y = x + b 2 = 1 + b b = 1 So the equation of the line is (on board) y = x + 1 Notice that the parallel lines has the same "y = mx" part of its equation, but that the "b" is different. That is always true of parallel lines. Also note that we can do this in reverse, and use this as a check as to whether two lines are parallel. Consider: (on board) Is the line connecting (-3,-1) to (1,2) parallel to the line connecting (-2,0) to (2,2)? To check this, we simply compute the slopes of the two lines. How do we do this? (let class answer) (on board) m1 = (y2 - y1) / (x2 - x1) = (2 - (-1)) / (1 - (-3)) = 3 / 4 m2 = (y2 - y1) / (x2 - x1) = (2 - 0) / (2 - (-2)) = 1 / 2 The slopes are different, to the lines are not parallel. If they had come out the same, that would mean the lines were parallel. B. Perpendicular lines If we can find parallel lines, we can also find perpendicular lines. Again, consider a line and a point. (draw picture) Suppose I tell you I want a line that passes through the point and is perpendicular to the first line. (draw picture) As you can see, that again uniquely defines a line. Thus, there must be a way to find the equation of that line. Let's take another concrete example: (on board) Find the line through (1,1) perpendicular to y = 2x - 1. To see how to approach this problem, let's graph the line we've been given. (on board) x Equation y 0 y = 2(0) - 1 -1 1 y = 2(1) - 1 1 -1 y = 2(-1) - 1 -3 (draw graph) We can envision what the perpendicular line will have to look like. (draw picture) First of all, notice that, since the original line is uphill, the perpendicular line will have to be downhill. If the original line had been downhill, the perpendicular line would be uphill. If we say this in terms of slopes, the slope of the perpendicular line has to have the opposite sign of the slope of the original line. Similarly, if the original line is steep, the perpendicular line will have to be a gradual slope, and vice versa. So if the original line has a big positive slope, for example, its perpendicular will have to have a small (in the absolute value sense) negative slope. It turns out that the rule is this: (on board) If a line has slope m, its perpendicular has slope m_perp = -1/m. In other words, the slopes of perpendicular lines are negative reciprocals of one another. So if m is positive, the perpendicular has a negative slope. And if m is big, the perpendicular will be small, which is exactly what we want. Let's apply this to our example. What is the slope of the original line? (let class answer) It's just 2. So the slope of the perpendicular is m_perp = -1/2. Now we're back to the problem we know how to solve: finding the equation given the slope and a point: (1,1). How do we find the equation? (let class answer) We know the slope is -1/2, so we write down: (on board) y = (-1/2) x + b 1 = (-1/2)(1) + b 1 = -1/2 + b b = 3/2 So the perpendicular equation is (on board) y = (-1/2) x + 3/2 Let's graph this just to be sure: x Equation y 0 y = (-1/2)(0) + 3/2 3/2 1 y = (-1/2)(1) + 3/2 1 -1 y = (-1/2)(-1) + 3/2 2 (draw graph) As we can see, this is just like what we think it should look like. As with parallel lines, we can turn this knowledge around and use it as a test to see if two lines are perpendicular. Consider this problem: (on board) Are 4x - 2y = 3 and x = 1 - 2y perpendicular? How should we approach this? (let class answer) We just find the slope of each line. It's easiest to do that by putting them into slope-intercept form. (on board) 4x - 2y = 3 -2y = -4x + 3 y = 2x - 3/2 So this line has slope 2. (on board) x = 1 - 2y 1 - 2y = x -2y = x - 1 y = -1/2 x + 1/2 So this line has slope -1/2. Clearly, 2 times -1/2 is -1, so the lines are perpendicular. C. Practice Problems As time permits: 1a. Plot y = (1/3) x + 1 b. Find the equation of the line parallel to this through (0,-1), and plot the parallel line. c. Find the equation of the line perpendicular to the two lines you just plotted, passing through (0,-1). 2. Consider the wheelchair ramp from earlier. The next floor up will have a ramp in the same place on that floor, 15 feet higher than the first ramp. a. What is its equation? b. Graph the lines describing both ramps. IV. Finding Intersections of Lines It is often very useful to be able to figure out where two lines cross. Of course one can do this simply by drawing the graphs and measuring, but it is useful to be able to do it algebraically as well. A. Substitution Suppose we have two lines: y = 2x - 4 y = x + 2 We want to find out where they cross. Any point where they cross must have the same x and y values, so we can find such a point just be knowing that the y's have to come out the same. Thus we must have 2x - 4 = x + 2 and we can solve: x - 4 = 2 x = 6 and we see that the two lines cross at the point (6,8). This method of finding the intersection is called substitution: we get one of the variables by itself, then substitute it into the other equation. We can use substitution even when equations aren't given in y = mx + b form. For example, suppose we have x + y = 3 3x - y = 1 We can re-arrange one or both of these equations into y = mx + b form, and then substitute: 3x - 2y = 1 -y = -3x + 1 y = 3x - 1 Now substitute into the other equation: x + (3x - 1) = 3 x + 3x - 1 = 3 4x - 1 = 3 4x = 4 x = 1 Finally, plug in to get y: y = 3(1) - 1 = 2 That's it. We could equally well have substituted for x instead of y. B. Elimination An alternative means of solving is called elimination. Let's take our previous example: x + y = 3 3x - y = 1 Suppose we add the two equations; we're allowed to do that, because we're adding equal things to both sides. Then we get 4x = 4 x = 1 Notice that the y cancelled out, leaving only x, which we could then solve for. Then we can substitute in and solve for y just like before. The trick here is to add or subtract equations in such a way as to make on of the variables cancel. Here's another example: 2x + y = -4 x - 2y = 3 In this case we can't just add, but we can still use elimination: we just have to multiply one of the equations by a number first. For example, suppose we multiply the first equation by 2 on both sides. This gives 2(2x + y) = -4(2) 4x + 2y = -8 Why do this? Because now we can add to the second equation and get a cancellation: 4x + 2y = -8 x - 2y = 3 5x = -5 x = -1 Finally, we can solve for y: x - 2y = 3 -1 - 2y = 3 -2y = 4 y = -2 And we're done.