In this video, we are going to look at how to find the equation of a line when given two points.

The equation of a line is written in the form y=mx+b, where m is the slope, and b is the y-intercept. When given the points (2,3) and (4,7), let’s see how to find the equation of the line. First, let’s find the slope. The equation for the slope is:
m=\frac{y_2-y_1}{x_2-x_1}
m=\frac{7-3}{4-2}
m=\frac{4}{2}
m=2

Now that we have the slope, let’s see how it looks in the equation of a line.
y=2x+b

We still don’t know what b is. We do know that the line passes through the two given points. If we pick any one of the two points and plug in their x and y values, then we can solve for b. Let’s pick the first point (2,3), and see what we get for b.
3=2(2)+b
3=4+b
-1=b

Now we know that b is -1 and m is 2. If we go back to our equation of a line and plug these in, then we have:
y=2x-1

There is also another way to solve for this as well. The first step is still to find the slope. We already found that the slope is 2 in the last method of solving, so we can just bypass that step. In order to use this other method, we have to use a different form of the equation of a line, called the point-slope form. This is:
y-y_1=m(x-x_1)

In this form, y_1 and x_1 refer to a point, and m is still the slope. If we just plug in the point (2,3) to the equation and solve then we will get:
y-3=2(x-2)
y-3=2x-4
y=2x-1
As you can see, both methods give us the same equation of a line.