## Finding the Slope of Horizontal and Vertical Lines

Contents

Do you remember what was special about horizontal and vertical lines? Their equations had just one variable.

- horizontal line \(y=b;\) all the \(y\)-coordinates are the same.
- vertical line \(x=a;\) all the \(x\)-coordinates are the same.

So how do we find the slope of the horizontal line \(y=4?\) One approach would be to graph the horizontal line, find two points on it, and count the rise and the run. Let’s see what happens in the figure below. We’ll use the two points \(\left(0,\phantom{\rule{0.2em}{0ex}}4\right)\) and \(\left(3,\phantom{\rule{0.2em}{0ex}}4\right)\) to count the rise and run.

What is the rise? | The rise is 0. |

What is the run? | The run is 3. |

What is the slope? | \(m=\frac{\text{rise}}{\text{run}}\) |

\(m=\frac{0}{3}\) | |

\(m=0\) |

The slope of the horizontal line \(y=4\) is \(0.\)

All horizontal lines have slope \(0\). When the \(y\)-coordinates are the same, the rise is \(0\).

### Definition: Slope of a Horizontal Line

The **slope** of a **horizontal line**, \(y=b,\) is \(0.\)

Now we’ll consider a vertical line, such as the line \(x=3\), shown in the figure below. We’ll use the two points \(\left(3,\phantom{\rule{0.2em}{0ex}}0\right)\) and \(\left(3,\phantom{\rule{0.2em}{0ex}}2\right)\) to count the rise and run.

What is the rise? | The rise is 2. |

What is the run? | The run is 0. |

What is the slope? | \(m=\frac{\text{rise}}{\text{run}}\) |

\(m=\frac{2}{0}\) |

But we can’t divide by \(0.\) Division by \(0\) is undefined. So we say that the slope of the vertical line \(x=3\) is undefined. The slope of all vertical lines is undefined, because the run is \(0.\)

### Definition: Slope of a Vertical Line

The **slope** of a **vertical line**, \(x=a,\) is undefined.

## Example

Find the slope of each line:

- \(\phantom{\rule{0.2em}{0ex}}x=8\phantom{\rule{0.2em}{0ex}}\)
- \(\phantom{\rule{0.2em}{0ex}}y=-5\)

### Solution

\(\phantom{\rule{0.2em}{0ex}}x=8\)

This is a vertical line, so its slope is undefined.

\(\phantom{\rule{0.2em}{0ex}}y=-5\)

This is a horizontal line, so its slope is \(0.\)