Hi. This is Anthony Varela, and in this tutorial, we're going to be writing an equation by looking at a graph of a line. So we're going to be talking about slope on a graph, we're going to look at intercepts on a graph, and then we're also going to talk about parallel and perpendicular lines. So first, let's review slope and intercepts.
Well, here I have the graph of a line, and I've marked in the x and y-intercepts of this line. Now, the y-intercept is where our line crosses the y-axis, and it occurs at x equals 0. And our x-intercept is when the line crosses the x-axis. And notice this happens at y equals 0. So our x-intercept is at y equals 0. It has the general coordinates x, comma, 0. With our y-intercept, this is when x equals 0, so its general coordinate is 0, comma, y.
Now, when we have two points on a graph, we can calculate the slope, which can be thought of as the rise over the run to get from one point to another. Now, more mathematically speaking, we can define slope as the difference in y-coordinates, y2 minus y1, over the difference in x-coordinates, x2 minus x1. So let's use this information, then, to look at a graph of a line and write its equation. So here, I have a line on a graph, and I want to write the equation to this line.
So the first thing that I'm going to point out is I know the y-intercept. It's where my line crosses the y-axis. So this occurs at the point 0, 6. Now I can use this information, then, when using an equation written in slope intercept form. Y equals mx plus b, but I've written in 6. I know that they sort of look the same, but this is a 6 coming from the y-intercept of 6 on the y-axis.
So so far, I know that this equation is y equals mx plus 6. I need to define m to complete my equation here. So how am I going to calculate m? Well, I need another point on the line. So looking at what other point I can easily identify, I happened to pick out the x-intercept pretty easily. This is the point 2,0.
So now I have two points, I have a set of coordinates that I can plug in to my equation to calculate slope. So looking at the difference in y values, this would be y1 of 0 minus-- sorry, y2 of 0 minus y1 of 6 over x2, which is 2, and x1, which is 0. So evaluating, then, 0 minus 6 is negative 6, and 2 minus 0 is 2. So my slope, negative 6 over 2, is negative 3. So the equation of this line is y equals negative 3x plus 6.
Let's take a look at another line. And the difference here is that I don't know what the y-intercept is. It's not on my graph. Well, that's OK. I can still write the equation of this line.
So I'm looking at y equals mx plus b. Well, if I know two points on the line, I can calculate the slope. So where can I point out two points on my line? Well, this is easily read as 5, 6, if we go over 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6. And I can also identify 1, 2, 3, negative 1, negative 2, negative 3, and negative 4. So I have two points on my line. I can use those two points to calculate the slope.
So taking the difference in y-coordinates, 6 minus negative 4, over the difference in x-coordinates, 5 minus 3, this gives me 10 over 2, which is a slope of 5. So so far, I know that my equation is y equals 5x plus b, this y-intercept. Now, how can I find the y-intercept if I don't know where it is on this graph? Well, I can use one of my two points, it doesn't matter which one, and this will give me an x and a y value that I can plug into this equation.
So I'm going to be taking, then, this point right here, plugging in 5 for x and 6 for y. And now, I can solve for b. So 5 times 5 is 25. So I know that 6 equals 25 plus b.
So I'm going to subtract 25 from both sides of this equation, and b is negative 19, which makes sense. We know it's going to be a negative number. That's where this line is going to cross the y-axis, way down here at y equals negative 19. So that means the equation of this line is y equals 5x minus 19. The slope is 5, and the y-intercept is negative 19.
I'm going to go through another example here, where we're going to write an equation for a line that is either parallel or perpendicular to the one we see on the graph. So first, what I want to do is write the equation for a line that we see, and then we'll talk about parallel and perpendicular lines. So parallel lines have identical slopes, and perpendicular lines have opposite reciprocal slopes. We'll come to that when we're ready to write equations for those lines.
So first thing I'm going to do is locate two points on this line so I can calculate the slope, because I don't know what the slope is. So here my two points that I'm going to use-- this y-intercept and then some other point here. So so far, I know, then, that this equation is going to be y equals 3/2x plus 2.
And how did I know that so quickly? Well, I know that the y-intercept is 2, so that's where I have my plus 2, and going from this point to this point, I have a rise of 3 and a run of 2. So rise over run, 3 over 2. So this is the equation of the line that I see on my graph.
What's the equation of a line parallel or perpendicular to it? Well, parallel lines have identical slopes. So here, the slope is 3/2. So any line that has a slope of 3/2 but just a different y-intercept would be a line that's parallel to this one. So for example, 3/2x plus 8. It could be plus 10, it could be plus 100, but we know it's going to be parallel, because their slopes are identical.
Now, how about a line perpendicular to it? Well, perpendicular lines have opposite reciprocal slopes. So opposite reciprocal means that our fraction here is going to flip. So instead of 3 over 2, we're going to have 2 over 3. And an opposite reciprocal means going from negative to positive or positive to negative.
So here, I can take the same y-intercept. That doesn't matter. But we know that our slope, m, is going to be negative 2/3, taking 3/2, flipping it, and changing its sign. So y equals negative 2/3x plus 2 is a line perpendicular to the one we see on the graph.
So let's review writing an equation from a graph. We talked about y equals mx plus b as giving us information about slope and y-intercept. If we don't know what the slope is, we can calculate that by taking the difference in y-coordinates, dividing that by the difference in x-coordinates. The y-intercept occurs at x equals 0 and has the corner point in 0, y, whereas the x-intercept has a corner point of x, comma, 0, because this occurs at y equals 0. And remember, with parallel lines, the slopes are identical, and with perpendicular lines, the slopes are opposite reciprocals of one another.
So thanks for watching this tutorial on writing an equation from a graph. Hope to see you next time.