Course Hero Logo

Graphing Lines

Linear Equations

Plotting Points

A linear equation can be graphed by using a table to generate a list of ordered pairs. When all the ordered pairs are plotted, they lie on the same line.

When an equation has two variables, such as xx and yy, the solutions of the equation can be represented by a graph in the coordinate plane. The graph consists of the set of all points (x,y)(x,y) that make the equation true. A linear equation in two variables is an equation in two variables whose graph is a line. In a linear equation in two variables, each term can be written as a number, such as -2, or a product of a variable and a number, such as 3x3x. The variables are not raised to a power, in the denominator of a fraction, or under a radical, such as a square root. For example, y=3x2y=3x-2 is a linear equation, but y=3x22y=3x^2-2 is not.

The most basic method of graphing lines is by plotting points and connecting them. A minimum of two points is required to graph a line, but additional points may be plotted as a check. A table is a good way to organize the values when plotting points to graph a line.

Step-By-Step Example
Using a Table of Ordered Pairs to Graph a Linear Equation
Graph the linear equation:
y=3x2y=3x-2
Step 1

Create a table, and choose a list of xx-coordinates.

xx
yy
1-1
00
11
22
Step 2

Substitute the chosen coordinates into the equation for xx, and solve for yy.

xx
y=3x2y=3x-2
yy
1-1
y=3(1)2y=5\begin{aligned}y &= 3(-1)-2\\y &=-5\end{aligned}
5-5
00
y=3(0)2y=2\begin{aligned}y &= 3(0)-2\\y &=-2\end{aligned}
2-2
11
y=3(1)2y=1\begin{aligned}y &= 3(1)-2\\y &=1\end{aligned}
11
22
y=3(2)2y=4\begin{aligned}y &= 3(2)-2\\y &=4\end{aligned}
44
Step 3

Use the table to write a list of ordered pairs.

xx
yy
(x,y)(x, y)
1-1
5-5
(1,5)(-1, -5)
00
2-2
(0,2)(0, -2)
11
11
(1,1)(1, 1)
22
44
(2,4)(2, 4)
Solution
Plot the points, and then connect them with a straight line.

x- and y-Intercepts

The points where a line crosses the xx- or yy-axis are called the intercepts. To find the xx-intercept, let y=0y = 0. To find the yy-intercept, let x=0x = 0.

Another method of graphing a linear equation is to plot the intercepts. Two points determine a line, which means that when two points are plotted, there is only one line that connects them. Any two points can be used to graph a line, but two points that are usually easy to plot are the intercepts. The value of xx where a graph touches or crosses the xx-axis is the x-intercept. It lies on the xx-axis, so it always has a yy-coordinate of zero. The value of yy where a graph touches or crosses the yy-axis is the y-intercept. It lies on the yy-axis, so it always has an xx-coordinate of zero.

To graph a linear equation by finding the intercepts, first set x=0x=0 and solve for yy. Then set y=0y=0 and solve for xx. Plot the intercepts, and draw the line connecting them.

Step-By-Step Example
Using the Intercepts to Graph a Linear Equation
Graph the linear equation:
y=5x+1y = -5x + 1
Step 1

Create a table and insert zero for one xx-coordinate and one yy-coordinate.

xx
yy
00
00
Step 2

Substitute zero into the equation for yy, and solve for xx. Substitute zero into the equation for xx, and solve for yy.

xx
y=5x+1y = -5x + 1
yy
00
y=5(0)+1y=1\begin{aligned}y &= -5(0)+1\\y &=1\end{aligned}
11
0.20.2
0=5x+11=5x15=x0.2=x\begin{aligned}0 &= -5x+1\\-1 &=-5x\\\frac{-1}{-5} &= x\\0.2&=x\end{aligned}
00
Step 3

Use the table to write ordered pairs.

xx
yy
(x,y)(x, y)
00
11
(0,1)(0, 1)
0.20.2
00
(0.2,0)(0.2, 0)
Solution
Plot the points, and then connect them with a straight line.

Slope of a Line

The steepness of a line can be described by the slope. The slope of a line is the ratio of the change in yy-values to the change in xx-values of any two points on the line.
The slope is the ratio of the change in yy to the change in xx for two points on a line, represented as:
RiseRun\frac{\text{Rise}}{\text{Run}}
  • Slope is a measure of the steepness of a line.
  • A line with a positive slope goes up from left to right.
  • A line with a negative slope goes down from left to right.
  • The rise is the vertical change between two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) on a line: y2y1y_2-y_1.
  • The run is the horizontal change between two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) on a line: x2x1x_2-x_1.
  • The slope is represented by the variable mm.
  • The formula for the slope of a line through the points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) is:
m=RiseRun=y2y1x2x1m=\frac{\text{Rise}}{\text{Run}}=\frac{y_2-y_1}{x_2-x_1}
Step-By-Step Example
Determine the Slope of a Line
Identify the slope of the line whose graph is shown.
Step 1

Identify two points on the line. Any two points used will result in the same final answer.

Let (1,1)(1, 1) be the point (x1,y1)(x_1, y_1). Then let (2,4)(2, 4) be the point (x2,y2)(x_2, y_2).

Step 2

Identify the rise and run. There are two ways to identify the rise and run between two points.

Method 1: Subtract the coordinates.
Rise=y2y1=41=3\begin{aligned}\text{Rise}&=y_2-y_1\\&=4-1\\&=3\end{aligned}
Run=x2x1=21=1\begin{aligned}\text{Run}&=x_2-x_1\\&=2-1\\&=1\end{aligned}
Method 2: Count the squares on the grid.

For the rise, count the number of squares vertically from the point (1,1)(1,1) to the point (2,4)(2,4). There are 3 squares for the rise.

For the run, count the number of squares horizontally from the point (1,1)(1,1) to the point (2,4)(2,4). There is 1 square for the run.
Solution
Determine the slope, or mm.
m=RiseRun=31=3\begin{aligned}m&=\frac{\text{Rise}}{\text{Run}}\\&=\frac{3}{1}\\&=3\end{aligned}
The slope of the line is m=3m=3.