The slope of a line is a measure of its steepness and direction. It is the ratio of the rise (change in y-coordinate) to the run (change in x-coordinate) as we move from one point to another on the line.

In this tutorial, we’ll look at the concept of slope (in analytical geometry). We will cover what slope means and how to find the slope of a line under different scenarios.

It’s a crucial topic – you’ll be working with it all the time in the study of analytical geometry and even calculus.

So let’s dive in.

The slope of a line is usually represented by ‘$\hspace{0.2em} m \hspace{0.2em}$’.

So, here’s the formula for the slope of a line (consider the black line in the image above).

$\begin{align*} \text{slope} &= \frac{ {\color{Teal} \text{rise}} }{ {\color{Red} \text{run}} } \\[1.3em] m &= \frac{ {\color{Teal} y_2 - y_1} }{ {\color{Red} x_2 - x_1} } \end{align*}$

Based on the orientation of the concerned line, the slope of a line can be positive, negative, or zero.

For the slope to be positive, both the numerator and denominator on the right side (in the formula above) must have the same sign. That means both the x and y coordinates increase or decrease together.

So as we move rightwards on the line, we must be moving upward. And as we move leftwards, we must be moving downwards. In other words, the line must slope uphill ↗.

On the other hand, for the slope to be negative, the numerator and the denominator must have opposite signs. So the line must slope downhill ↘.

Alright, for a better understanding of how to find the slope of a line in different cases, let’s solve a few example problems now.

Example

Find the slope of the line that passes through $\hspace{0.2em} (\frac{1}{4}, 0) \hspace{0.2em}$ and $\hspace{0.2em} (3, 2) \hspace{0.2em}$.

Solution

We’ll start with the formula for the slope.

$m = \frac{y_2 - y_1}{x_2 - x_1}$

Next, from the question, let’s list the coordinates we need for the formula.

$\begin{align*} (x_1, y_1) &= \left ( \frac{1}{4}, 0 \right ) \\[1.3em] (x_2, y_2) &= (3, 2) \end{align*}$

Note – It doesn’t matter which point you take as P1 (x1, y1) and which as P2 (x2, y2).

Finally, we just need to substitute the coordinates into the formula and simplify.

$\begin{align*} m &= \frac{2 - 0}{3 - \frac{1}{4}} \\[1.3em] &= \frac{8}{11} \end{align*}$

That’s it. The slope of the line is $\hspace{0.2em} \frac{8}{11} \hspace{0.2em}$.

Example

Find the slope of the line in the figure.

Solution

This is pretty much the same as the last example, except that here we are given the graph.

So, first, here are the coordinates from the figure.

$\begin{align*} (x_1, y_1) &= (-4, 3) \\[1.3em] (x_2, y_2) &= (-1, -1) \end{align*}$

Plugging these coordinates into our formula and simplifying, we have –

$\begin{align*} m &= \frac{y_2 - y_1}{x_2 - x_1} \\[1.3em] &= \frac{-1-(-3)}{-1-(-4)}\, = \, \frac{2}{3} \end{align*}$

How to find the slope of a line when you have the line’s equation but not the coordinates of two points on it?

Well, the most preferred approach is to transform the equation into slope-intercept form and then extract the slope from it.

To give you a quick summary of the equation of a line in slope-intercept form – we have y on one side (with 1 as its coefficient) and x and the constant term on the other side. The x-coefficient gives the slope of the line.

$y = {\color{Red} m} x + b$

Slope-intercept form

Example

Find the slope of each line from its equation.

$\begin{align*} &(\text{i}) \hspace{1.08em} y = -\frac{1}{2} + 4 \\[1.3em] &(\text{ii}) \hspace{0.9em} 3x + 5y = 1 \\[1.3em] &(\text{iii}) \hspace{0.75em} x - y = 2 \end{align*}$

Solution ($\hspace{0.2em} \text{i} \hspace{0.2em}$)

Here, the equation given to us is already in its slope-intercept form, so let’s compare it with the standard equation.

$\begin{align*} y &= {\color{Red} m} x + b \\[1.3em] y &= {\color{Red} -\frac{1}{2}} x + b \end{align*}$

Clearly, the slope is –

${\color{Red} m} = {\color{Red} -\frac{1}{2}}$

Solution ($\hspace{0.2em} \text{ii} \hspace{0.2em}$)

$3x + 5y = 1$

This time, our equation is not in the slope-intercept form, so we’ll need to transform it.

First, let’s make sure we have only the y-term on the left side.

$5y = -3x + 1$

Next, we divide the whole equation by the y-coefficient (5) so that the y-coefficient becomes one.

$5y = -\frac{3}{5}x + \frac{3}{5}$

Great! Now our equation is in the desired form and so, the x-coefficient is the slope of the line.

$m = -\frac{3}{5}$

Solution ($\hspace{0.2em} \text{iii} \hspace{0.2em}$)

Again, we will start by transforming the equation to the slope-intercept form.

$\begin{align*} x - y = 2 \\[1em] y = x -2 \end{align*}$

And looking at the x-coefficient, we have,

$m = 1$

Remember, if the coefficient is not explicitly mentioned, it’s 1.

In the context of analytical geometry, when say horizontal or vertical, we generally mean in reference to the x-axis. So a horizontal line is one parallel to the x-axis and a vertical line is one perpendicular to it.

For a horizontal line, the y-coordinate remains constant for all points. This is why its equation is of the y = a, where a is a constant.

Now if we calculate the slope of a horizontal line –

$\begin{align*} m &= \frac{y_2 - y_1}{x_2 - x_1} \\[1.3em] &= \frac{a - a}{x_2 - x_1} \\[1.3em] &= 0 \end{align*}$

The slope of a horizontal line is 0.

For a vertical line, the x-coordinate remains constant for all points. Which is why its equation is of the x = a, where a is a constant.

Similar to the previous case, here, the denominator (bottom part) in our slope formula becomes 0. But division by zero is not defined.

The slope of a horizontal line is undefined.

In this last section, we’ll look at how to find the slope of a line that is parallel or perpendicular to a line whose slope is known.

For the most part, the idea is very simple.

If two lines are parallel, their slopes would be equal. If they are perpendicular, the product of their slopes would be $\hspace{0.2em} -1 \hspace{0.2em}$.

Example

Line $\hspace{0.2em} l_1 \hspace{0.2em}$ passes through the points $\hspace{0.2em} (0, 1) \hspace{0.2em}$ and $\hspace{0.2em} (2, 0) \hspace{0.2em}$. Find the slope of a line parallel to $\hspace{0.2em} l_1 \hspace{0.2em}$.

Solution

Before we can find the slope of any line parallel to $\hspace{0.2em} l_1 \hspace{0.2em}$, we need to find the slope of $\hspace{0.2em} l_1 \hspace{0.2em}$ itself (let’s call it $\hspace{0.2em} m' \hspace{0.2em}$).

So, just like we did for the first two examples, we’ll use the slope formula.

$\begin{align*} m' &= \frac{y_2 - y_1}{x_2 - x_1} \\[1.3em] &= \frac{0 - 1}{2 - 0} \\[1.3em] &= - \frac{1}{2} \end{align*}$

Now, we know that slopes of parallel lines are equal. So if the slope of a line parallel $\hspace{0.2em} l_1 \hspace{0.2em}$ is $\hspace{0.2em} m \hspace{0.2em}$,

Done.

Example

If line $\hspace{0.2em} l_1 \hspace{0.2em}$ is perpendicular to $\hspace{0.2em} l_2 \hspace{0.2em}$, find the slope of $\hspace{0.2em} l_2 \hspace{0.2em}$.

Solution

Again, first, we find the slope of the line $\hspace{0.2em} l_1 \hspace{0.2em}$ (say $\hspace{0.2em} m' \hspace{0.2em}$).

$\begin{align*} m' &= \frac{y_2 - y_1}{x_2 - x_1} \\[1.3em] &= \frac{7 - 1}{-2 - 1} \\[1.3em] &= \frac{6}{-3} \, = \, -2 \end{align*}$

Next, let the slope of a line perpendicular to $\hspace{0.2em} l_1 \hspace{0.2em}$ be m. And since the product of slopes of perpendicular lines is $\hspace{0.2em} -1 \hspace{0.2em}$, we have

$m \cdot m' = -1$

Substituting the value of m’ gives us

$\begin{align*} m \cdot (-2) &= -1 \\[1.3em] m &= \frac{-1}{-2} \, = \, \frac{1}{2} \end{align*}$

So the required slope is $\hspace{0.2em} \frac{1}{2} \hspace{0.2em}$.

And with that, we come to the end of this tutorial on how to find the slope of a line. Until next time.

We use cookies to provide and improve our services. By using the site you agree to our use of cookies. Learn more