Updated date:

Math: How to Find the Slope of a Line


I studied applied mathematics, in which I did both a bachelor's and a master's degree.


The Slope of a Line

The slope of a line is the direction in which the line goes, and its steepness. The direction can be either positive or negative. A line with a positive slope increases if you look at it from left to right. A line with a negative slope is decreasing.

A line can be represented with a linear function y = ax + b. Here a is the slope of the line. This means that if you know the expression for the line, you do not need to perform any calculations to get the slope. Instead, you just look at the coefficient in front of the x and that will be the slope.

The Derivative

Formally speaking, what you do when you say the slope of the linear function is the coefficient in front of the x is you take the derivative. The derivative of a function is a function itself and as input it has an x-coordinate and as output it gives the slope of the function at this x-coordinate. The formal definition of the derivative, which is mostly denoted as f'(x) is as follows:

f'(x) = limh to 0 (f(x+h) - f(x))/h

Now as f(x) we take f(x) = ax + b and we fill this in in the definition of the derivative:

f'(x) = ((a(x+h) + b) - (ax + b))/h

= (ax + ah + b - ax - b)/h = ah/h = a

This proves that indeed for a linear function ax + b the derivative, and hence the slope of the function is equal to the coefficient in front of the x. Note that in this case, the slope is constant and does not change if we choose another x. In general, this is not true. For example, the function f(x) = x2 has derivative f'(x) = 2x. So in this case, the slope does depend on the x-coordinate.

If you want to know more about the derivative, I suggest reading my article about calculating the derivative in which I dive deeper into this concept. In the derivative, we make use of a limit. I also wrote an article about finding the limit of a function. So if you are not familiar with this concept, you should read that article.

Using a Picture

But what if you do not know the expression of the line? Then you can still calculate the slope. It is needed, for example, when you want to find the expression of the line yourself. For a line, the slope is constant, as we have seen. It does not matter where on the line you look, the slope does not change. The slope can be calculated as the ratio between the horizontal change and the vertical change. We will use the picture below to illustrate how this works.


The first step is to locate two points of the line. In our case, we see that the line goes through (-6,-8) and (0,4). You can also choose other points on the line; it will not change the outcome. Now we calculate the vertical change, which is also denoted as Δy (delta y). The y-coordinate of the first point is -8. The second point has y-coordinate equal to 4. Δy is the difference between these two numbers:

Δy = -8 - 4 = -12

We do the same for Δx, which is the horizontal change. Here the first point has x-coordinate is -6, and the second has 0. This leads to:

Δx = -6 - 0 = -6

Now we can calculate the slope as the ratio between these two:

Δy/Δx = -12/-6 = 2

So the slope of this line is equal to 2. As you look at the picture, you can clearly see that this is indeed true, as for every block you go to the right you also go two blocks up. If you calculate the slope, watch out that you take the same order of points when calculating Δy and Δx. It does not matter which point you name the first and which the second, as long as you do it the same for both quantities.

Finding the Formula of the Line

Now that we know the slope of the line, we can also find the entire formula of the line. We already know that it will be of the form y = ax + b, and we know that a = 2. We also have a point that is on the line, namely (-6,-8), so we can make use of that point to find b. We can do this by filling in the point to get:

-8 = 2*-6 + b

-8 = -12 + b

4 = b

So b = 4 and the line will be y = 2x + 4.

In this step, we needed to solve a linear equation. If you want to know more about solving these kinds of equations, I suggest reading my article about solving linear equations and systems of linear equations.



The slope of a line is the ratio between the vertical and the horizontal change, Δy/Δx. It quantifies the steepness, as well as the direction of the line. If you have the formula of the line, you can determine the slope with the use of the derivative. In the case of a line, this derivative is simply equal to the coefficient in front of the x.

If you do not know the direction, but only have the picture, you can pick two points of the line and then calculate Δy/Δx by looking at the differences in these two points. This also provides you with everything you need to find the formula of the line y = ax + b. As you determined the slope a, you can use one of the points to find b.

This content is accurate and true to the best of the author’s knowledge and is not meant to substitute for formal and individualized advice from a qualified professional.


Umesh Chandra Bhatt from Kharghar, Navi Mumbai, India on January 12, 2021:

Well presented. Nice.