# Equation of a line

The equation of a straight line is commonly written as

y = mx + b

where m is the slope and b is the y-intercept. The slope determines how steep the line is. The y-intercept tells us the point at which the line intersects the y-axis. The x and y tell us the position relative to the x- and y-axes respectively. Thus, given any 2 points on the line, or 1 point and the slope, we can graph the line.

## How to find the slope

The slope of a line is often described as "rise over run." It tells us how much the y-value changes as the x-value changes.

Given a slope of 2, this means that for every 1 unit change in x, y changes 2 units. Because the slope is positive, the line increases (moves up) as the graph moves from left to right. If the slope were negative, the line would decrease instead.

Example

Graph the lines y = 2x + 3 and y = -2x + 3

Based on the equation of the line, the y-intercept is 3, meaning that the line goes crosses y-axis at the point (0, 3). The slope is 2, or 2/1, so for every 1 unit of change in y, there is a 2 units change in y. Using the y-intercept as a reference point, we can either move right 1 and up 2, or left 1 and down 2 to determine the next point. Once we have two points, we can just connect the points to graph the line. The figure below shows the two possible points on either side of the chosen reference point (the y-intercept).

The only difference between the two equations above is that the slope is positive in one but negative in the other. Below is the graph of the line given that the slope is -2.