# How to calculate the Slope Intercept equation from two points

A common problem in linear equations is of how to determine the equation of a line, when given any two points on that line.

Here's a simple step by step guide on how to work out the equation in Slope Intercept Form **(y = mx + b)**

For example, given the two points * (1,5)* and

*, let's work out the solution. Lets call the*

**(3,1)***"Point 1" and*

**(1,5)***"Point 2" for reference.*

**(3,1)****Step 1: Determine the Slope (m)**

The Slope of a line is determined by the change in the value of y which corresponds to a given change in the value of x. We can use the two points we have been given to determine the slope:

Point2.y - Point1.y | |

Point2.x - Point1.x |

Substituting our values for the Point:

1 - 5 | |

3 - 1 |

-4 | |

2 |

**Step 2: Determining the Y-Intercept (b)**

The Y intercept is the point where the line intercepts the Y Axis (which is where x = 0). So by using this definition, and EITHER of the two points, we can work back from the point

Our slope, **m**, is **-2**. This means for every 1 unit of x we increase, y will decrease by 2 y-units (since m is -2), and conversely, for every x-unit we decrease, y will increase by 2 y-units (since -1 x -2 = 2)!

Taking the first point * (1,5)*, x is 1. To get to the Y axis, we need to subtract 1 x-unit, so a decrease of 1 x-unit will require an increase of 2 y-units.

So the Y Intercept is **5 + 2 = 7**

In mathematical terms, the general form of *working a point back to the Y Axis using the slope of the line* is:

Taking Point 1, (1,5)

Note that you could have ALSO used Point2, * (3, 1)*:

So our final equation for the line through the points * (1,5)* and

*, in Slope-Intercept form, is*

**(3,1)**See this example, and try your own problems using our Linear Equation solver with a Graph!