Write an equation of the line with the given characteristics

Now that we have learned how to plot points on a coordinate plane and graph linear equations, we can begin to analyze the equations of lines and evaluate the different characteristics of these lines. In this section, we will learn about the commonly used forms for writing linear equations and the properties of lines that can be determined from their equations.

For example, without creating a table of values, you will be able to match each equation below to its corresponding graph. You will also be able to explain the similarities and differences of each line, how they relate to each other, and why they behave that way.

6 lines graphed on a coordinate plane.

Writing Equations of Lines

Slope-Intercept Form

Perhaps the most familiar form of a linear equation is slope-intercept form written as [latex]y=mx+b[/latex], where [latex]m=\text[/latex] and [latex]b=y\text[/latex]. Let us begin with the slope.

The Slope of a Line

The slope of a line refers to the ratio of the vertical change in y over the horizontal change in x between any two points on a line. It indicates the direction in which a line slants as well as its steepness. Slope is sometimes described as rise over run.

[latex]m=\frac<_-_>_-_>[/latex]If the slope is positive, the line slants upward to the right. If the slope is negative, the line slants downward to the right. As the slope increases, the line becomes steeper. Some examples are shown below. The lines indicate the following slopes: [latex]m=-3[/latex], [latex]m=2[/latex], and [latex]m=\frac[/latex].

Coordinate plane with the x and y axes ranging from negative 10 to 10. Three linear functions are plotted: y = negative 3 times x minus 2; y = 2 times x plus 1; and y = x over 3 plus 2.

A General Note: The Slope of a Line

The slope of a line, m, represents the change in y over the change in x. Given two points, [latex]\left(_,_\right)[/latex] and [latex]\left(_,_\right)[/latex], the following formula determines the slope of a line containing these points:

[latex]m=\frac<_-_>_-_>[/latex]Example: Finding the Slope of a Line Given Two Points

Find the slope of a line that passes through the points [latex]\left(2,-1\right)[/latex] and [latex]\left(-5,3\right)[/latex].

Show Solution

We substitute the y-values and the x-values into the formula.

[latex]\beginm\hfill&=\frac<3-\left(-1\right)>\hfill \\ \hfill&=\frac\hfill \\ \hfill&=-\frac\hfill \end[/latex]

The slope is [latex]-\frac[/latex].

Analysis of the Solution

It does not matter which point is called [latex]\left(_,_\right)[/latex] or [latex]\left(_,_\right)[/latex]. As long as we are consistent with the order of the y terms and the order of the x terms in the numerator and denominator, the calculation will yield the same result.

Try It

Find the slope of the line that passes through the points [latex]\left(-2,6\right)[/latex] and [latex]\left(1,4\right)[/latex].

Show Solution

Example: Identifying the Slope and y-intercept of a Line Given an Equation

Identify the slope and y-intercept given the equation [latex]y=-\fracx - 4[/latex].

Show Solution

As the line is in [latex]y=mx+b[/latex] form, the given line has a slope of [latex]m=-\frac[/latex]. The y-intercept is [latex]b=-4[/latex].

Analysis of the Solution

The y-intercept is the point at which the line crosses the y-axis. On the y-axis, [latex]x=0[/latex]. We can always identify the y-intercept when the line is in slope-intercept form, as it will always equal b. Or, just substitute [latex]x=0[/latex] and solve for y.

The Point-Slope Form

Given the slope and one point on a line, we can find the equation of the line using point-slope form.

[latex]y-_=m\left(x-_\right)[/latex]

This is an important formula, as it will be used in other areas of College Algebra and often in Calculus to find the equation of a tangent line. We need only one point and the slope of the line to use the formula. After substituting the slope and the coordinates of one point into the formula, we simplify it and write it in slope-intercept form.

A General Note: The Point-Slope Formula

Given one point and the slope, using point-slope form will lead to the equation of a line:

[latex]y-_=m\left(x-_\right)[/latex]

Example: Finding the Equation of a Line Given the Slope and One Point

Write the equation of the line with slope [latex]m=-3[/latex] and passing through the point [latex]\left(4,8\right)[/latex]. Write the final equation in slope-intercept form.

Show Solution

Using point-slope form, substitute [latex]-3[/latex] for m and the point [latex]\left(4,8\right)[/latex] for [latex]\left(_,_\right)[/latex].

[latex]\beginy-_=m\left(x-_\right)\hfill \\ y - 8=-3\left(x - 4\right)\hfill \\ y - 8=-3x+12\hfill \\ y=-3x+20\hfill \end[/latex]

Analysis of the Solution

Note that any point on the line can be used to find the equation. If done correctly, the same final equation will be obtained.

Try It

Given [latex]m=4[/latex], find the equation of the line in slope-intercept form passing through the point [latex]\left(2,5\right)[/latex].

Show Solution

Example: Finding the Equation of a Line Passing Through Two Given Points

Find the equation of the line passing through the points [latex]\left(3,4\right)[/latex] and [latex]\left(0,-3\right)[/latex]. Write the final equation in slope-intercept form.

Show Solution

First, we calculate the slope using the slope formula and two points.

[latex]\begin\hfill \\ m=\frac\hfill \\ =\frac\hfill \\ =\frac\hfill \end[/latex]

Next, we use point-slope form with the slope of [latex]\frac[/latex] and either point. Let’s pick the point [latex]\left(3,4\right)[/latex] for [latex]\left(_,_\right)[/latex].

[latex]\beginy - 4=\frac\left(x - 3\right)\hfill \\ y - 4=\fracx - 7\hfill& \hfill \\ y=\fracx - 3\hfill \end[/latex]

In slope-intercept form, the equation is written as [latex]y=\fracx - 3[/latex].

Analysis of the Solution

To prove that either point can be used, let us use the second point [latex]\left(0,-3\right)[/latex] and see if we get the same equation.

[latex]\beginy-\left(-3\right)=\frac\left(x - 0\right)\hfill \\ y+3=\fracx\hfill \\ y=\fracx - 3\hfill \end[/latex]

We see that the same line will be obtained using either point. This makes sense because we used both points to calculate the slope.

Standard Form of a Line

Another way that we can represent the equation of a line is in standard form. Standard form is given as

[latex]Ax+By=C[/latex]

where [latex]A[/latex], [latex]B[/latex], and [latex]C[/latex] are integers. The x and y-terms are on one side of the equal sign and the constant term is on the other side.

Example: Finding the Equation of a Line and Writing It in Standard Form

Find the equation of the line with [latex]m=-6[/latex] and passing through the point [latex]\left(\frac,-2\right)[/latex]. Write the equation in standard form.

Show Solution

We begin by using point-slope form.

[latex]\beginy-\left(-2\right)=-6\left(x-\frac\right)\hfill \\ y+2=-6x+\frac\hfill \end[/latex]

From here, we multiply through by 2 as no fractions are permitted in standard form. Then we move both variables to the left aside of the equal sign and move the constants to the right.

[latex]\begin2\left(y+2\right)=\left(-6x+\frac\right)2\hfill \\ 2y+4=-12x+3\hfill \\ 12x+2y=-1\hfill \end[/latex]

This equation is now written in standard form.

Try It

Find the equation of the line in standard form with slope [latex]m=-\frac[/latex] which passes through the point [latex]\left(1,\frac\right)[/latex].

Show Solution [latex]x+3y=2[/latex]

Vertical and Horizontal Lines

The equations of vertical and horizontal lines do not require any of the preceding formulas, although we can use the formulas to prove that the equations are correct. The equation of a vertical line is given as

[latex]x=c[/latex]

where c is a constant. The slope of a vertical line is undefined, and regardless of the y-value of any point on the line, the x-coordinate of the point will be c.

Suppose that we want to find the equation of a line containing the following points: [latex]\left(-3,-5\right),\left(-3,1\right),\left(-3,3\right)[/latex], and [latex]\left(-3,5\right)[/latex]. First, we will find the slope.

[latex]m=\frac<5 - 3><-3-\left(-3\right)>=\frac[/latex]

Zero in the denominator means that the slope is undefined and, therefore, we cannot use point-slope form. However, we can plot the points. Notice that all of the x-coordinates are the same and we find a vertical line through [latex]x=-3[/latex].

The equation of a horizontal line is given as

[latex]y=c[/latex]

where c is a constant. The slope of a horizontal line is zero, and for any x-value of a point on the line, the y-coordinate will be c.

Suppose we want to find the equation of a line that contains the following set of points: [latex]\left(-2,-2\right),\left(0,-2\right),\left(3,-2\right)[/latex], and [latex]\left(5,-2\right)[/latex]. We can use point-slope form. First, we find the slope using any two points on the line.

[latex]\beginm=\frac<-2-\left(-2\right)><0-\left(-2\right)>\hfill \\ =\frac\hfill \\ =0\hfill \end[/latex]

Use any point for [latex]\left(_,_\right)[/latex] in the formula, or use the y-intercept.

[latex]\beginy-\left(-2\right)=0\left(x - 3\right)\hfill \\ y+2=0\hfill \\ y=-2\hfill \end[/latex]

The graph is a horizontal line through [latex]y=-2[/latex]. Notice that all of the y-coordinates are the same.

Coordinate plane with the x-axis ranging from negative 7 to 4 and the y-axis ranging from negative 4 to 4. The function y = negative 2 and the line x = negative 3 are plotted.

The line x = −3 is a vertical line. The line y = −2 is a horizontal line.

Example: Finding the Equation of a Line Passing Through the Given Points

Find the equation of the line passing through the given points: [latex]\left(1,-3\right)[/latex] and [latex]\left(1,4\right)[/latex].

Show Solution

The x-coordinate of both points is 1. Therefore, we have a vertical line, [latex]x=1[/latex].

Try It

Find the equation of the line passing through [latex]\left(-5,2\right)[/latex] and [latex]\left(2,2\right)[/latex].

Show Solution

Horizontal line: [latex]y=2[/latex]

Parallel and Perpendicular Lines

Parallel lines have the same slope and different y-intercepts. Lines that are parallel to each other will never intersect. For example, the figure below shows the graphs of various lines with the same slope, [latex]m=2[/latex].

Coordinate plane with the x-axis ranging from negative 8 to 8 in intervals of 2 and the y-axis ranging from negative 7 to 7. Three functions are graphed on the same plot: y = 2 times x minus 3; y = 2 times x plus 1 and y = 2 times x plus 5.

Parallel lines have slopes that are the same.

All of the lines shown in the graph are parallel because they have the same slope and different y-intercepts.

Lines that are perpendicular intersect to form a [latex]^[/latex] angle. The slope of one line is the negative reciprocal of the other. We can show that two lines are perpendicular if the product of the two slopes is [latex]-1:_\cdot _=-1[/latex]. For example, the figure below shows the graph of two perpendicular lines. One line has a slope of 3; the other line has a slope of [latex]-\frac[/latex].

[latex]\begin\text< >_\cdot _=-1\hfill \\ \text< >3\cdot \left(-\frac\right)=-1\hfill \end[/latex]

Coordinate plane with the x-axis ranging from negative 3 to 6 and the y-axis ranging from negative 2 to 5. Two functions are graphed on the same plot: y = 3 times x minus 1 and y = negative x/3 minus 2. Their intersection is marked by a box to show that it is a right angle.

Perpendicular lines have slopes that are negative reciprocals of each other.

Example: Graphing Two Equations and Determining Whether the Lines are Parallel, Perpendicular, or Neither

Graph the equations of the given lines and state whether they are parallel, perpendicular, or neither: [latex]3y=-4x+3[/latex] and [latex]3x - 4y=8[/latex].

Show Solution

The first thing we want to do is rewrite the equations so that both equations are in slope-intercept form.

[latex]\begin3x - 4y=8\hfill \\ -4y=-3x+8\hfill \\ y=\fracx - 2\hfill \end[/latex]

See the graph of both lines in the graph below.

Coordinate plane with the x-axis ranging from negative 4 to 5 and the y-axis ranging from negative 4 to 4. Two functions are graphed on the same plot: y = negative 4 times x/3 plus 1 and y = 3 times x/4 minus 2. A box is placed at the intersection to note that it forms a right angle.

From the graph, we can see that the lines appear perpendicular, but we must compare the slopes.

The slopes are negative reciprocals of each other confirming that the lines are perpendicular.

Try It

Graph the two lines and determine whether they are parallel, perpendicular, or neither: [latex]2y-x=10[/latex] and [latex]2y=x+4[/latex].

Show Solution

Coordinate plane with the x-axis ranging from negative 5 to 5 and the y-axis ranging from negative 1 to 6. Two functions are graphed on the same plot: y = x/2 plus 5 and y = x/2 plus 2. The lines do not cross.

Parallel lines. Write the equations in slope-intercept form.

If we know the equation of a line, we can use what we know about slope to write the equation of a line that is either parallel or perpendicular to the given line.

Writing Equations of Parallel Lines

Suppose we are given the following equation:

We know that the slope of the line formed by the function is 3. We also know that the y-intercept is (0, 1). Any other line with a slope of 3 will be parallel to [latex]y=3x+1[/latex]. So all of the following lines will be parallel to the given line.

[latex]\beginy=3x+6\hfill & \\ y=3x+1\hfill & \\ y=3x+\frac\hfill \end[/latex]

Suppose then we want to write the equation of a line that is parallel to [latex]y=3x+6[/latex] and passes through the point (1, 7). We already know that the slope is 3. We just need to determine which value for b will give the correct line. We can begin with point-slope form of a line and then rewrite it in slope-intercept form.

[latex]\beginy-_=m\left(x-_\right)\hfill & \\ y - 7=3\left(x - 1\right)\hfill & \\ y - 7=3x - 3\hfill & \\ \text<>y=3x+4\hfill \end[/latex]

So [latex]y=3x+4[/latex] is parallel to [latex]y=3x+1[/latex] and passes through the point (1, 7).

How To: Given the equation of a LINE, write the equation of a line parallel to the given line that passes through A given point

  1. Find the slope of the line.
  2. Substitute the given values into either point-slope form or slope-intercept form.
  3. Simplify.

Example: Finding a Line Parallel to a Given Line

Find a line parallel to the graph of [latex]y=3x+6[/latex] that passes through the point (3, 0).

Show Solution

The slope of the given line is 3. If we choose to use slope-intercept form, we can substitute m = 3, x = 3, and y = 0 into slope-intercept form to find the y-intercept.

[latex]\beginy=3x+b\hfill & \\ \text<>0=3\left(3\right)+b\hfill & \\ \text<>b=-9\hfill \end[/latex]

The line parallel to [latex]y=3x+6[/latex] that passes through (3, 0) is [latex]y=3x - 9[/latex].

Analysis of the Solution

We can confirm that the two lines are parallel by graphing them. The graph below shows that the two lines will never intersect.

Graph of two functions where the blue line is y = 3x + 6, and the orange line is y = 3x - 9.

Try It

Writing Equations of Perpendicular Lines

We can use a very similar process to write the equation for a line perpendicular to a given line. Instead of using the same slope, however, we use the negative reciprocal of the given slope. Suppose we are given the following line:

The slope of the line is 2 and its negative reciprocal is [latex]-\frac[/latex]. Any function with a slope of [latex]-\frac[/latex] will be perpendicular to [latex]y=2x+4[/latex]. So all of the following lines will be perpendicular to [latex]y=2x+4[/latex].

As before, we can narrow down our choices for a particular perpendicular line if we know that it passes through a given point. Suppose then we want to write the equation of a line that is perpendicular to [latex]y=2x+4[/latex] and passes through the point (4, 0). We already know that the slope is [latex]-\frac[/latex]. Now we can use the point to find the y-intercept by substituting the given values into slope-intercept form and solving for b.

[latex]\beginy=mx+b\hfill & \\ 0=-\frac\left(4\right)+b\hfill & \\ 0=-2+b\hfill \\ 2=b\hfill & \\ b=2\hfill \end[/latex]

The equation for the function with a slope of [latex]-\frac[/latex] and a y-intercept of 2 is [latex]y=-\fracx+2[/latex].

So [latex]y=-\fracx+2[/latex] is perpendicular to [latex]y=2x+4[/latex] and passes through the point (4, 0). Be aware that perpendicular lines may not look obviously perpendicular on a graphing calculator unless we use the square zoom feature.

Q & A

A horizontal line has a slope of zero and a vertical line has an undefined slope. These two lines are perpendicular, but the product of their slopes is not –1. Doesn’t this fact contradict the definition of perpendicular lines?

No. For two perpendicular linear functions, the product of their slopes is –1. As you will learn later, a vertical line is not a function so the definition is not contradicted.

How To: Given the equation of a LINE, write the equation of a line Perpendicular to the given line that passes through A given point

  1. Find the slope of the given line.
  2. Determine the negative reciprocal of the slope.
  3. Substitute the slope and point into either point-slope form or slope-intercept form.
  4. Simplify.

Example: Finding the Equation of a Perpendicular Line

Find the equation of a line perpendicular to [latex]y=3x+3[/latex] that passes through the point (3, 0).

Show Solution

The original line has slope m = 3, so the slope of the perpendicular line will be its negative reciprocal or [latex]-\frac[/latex]. Using this slope and the given point, we can find the equation for the line.

[latex]\beginy=-\fracx+b\hfill & \\ \text<>0=-\frac\left(3\right)+b\hfill & \\ \text<>1=b\hfill \\ \text< >b=1\hfill \end[/latex]

The line perpendicular to [latex]y=3x+3[/latex] that passes through (3, 0) is [latex]y=-\fracx+1[/latex].

Analysis of the Solution

A graph of the two lines is shown below.

Graph of two functions where the blue line is g(x) = -1/3x + 1, and the orange line is f(x) = 3x + 6.

Try It

Given the line [latex]y=2x - 4[/latex], write an equation for the line passing through (0, 0) that is

Show Solution
  1. [latex]y=2x[/latex] is parallel
  2. [latex]y=-\fracx[/latex] is perpendicular

How To: Given two points on a line, write the equation of A perpendicular line that passes through A Third point

  1. Determine the slope of the line passing through the points.
  2. Find the negative reciprocal of the slope.
  3. Substitute the slope and point into either point-slope form or slope-intercept form.
  4. Simplify.

Example: Finding the Equation of a Perpendicular Line

A line passes through the points (–2, 6) and (4, 5). Find the equation of a perpendicular line that passes through the point (4, 5).

Show Solution From the two points of the given line, we can calculate the slope of that line.

Find the negative reciprocal of the slope.

We can then solve for the y-intercept of the line passing through the point (4, 5).

[latex]\beginy=6x+b\hfill \\ 5=6\left(4\right)+b\hfill \\ 5=24+b\hfill \\ -19=b\hfill \\ b=-19\hfill \end[/latex]

The equation for the line that is perpendicular to the line passing through the two given points and also passes through point (4, 5) is:

Try It

A line passes through the points (–2, –15) and (2, –3). Find the equation of a perpendicular line that passes through the point (6, 4).

Show Solution

Writing the Equations of Lines Parallel or Perpendicular to a Given Line

As we have learned, determining whether two lines are parallel or perpendicular is a matter of finding the slopes. To write the equation of a line parallel or perpendicular to another line, we follow the same principles as we do for finding the equation of any line. After finding the slope, use point-slope form to write the equation of the new line.

Example: Writing the Equation of a Line Parallel to a Given Line

Write the equation of line parallel to a [latex]5x+3y=1[/latex] which passes through the point [latex]\left(3,5\right)[/latex].

Show Solution

First, we will write the equation in slope-intercept form to find the slope.

[latex]\begin5x+3y=1\hfill \\ 3y=-5x+1\hfill \\ y=-\fracx+\frac\hfill \end[/latex]

The slope is [latex]m=-\frac[/latex]. The y-intercept is [latex]\frac[/latex], but that really does not enter into our problem, as the only thing we need for two lines to be parallel is the same slope.

The one exception is that if the y-intercepts are the same, then the two lines are the same line. The next step is to use this slope and the given point in point-slope form.

[latex]\beginy - 5=-\frac\left(x - 3\right)\hfill \\ y - 5=-\fracx+5\hfill \\ y=-\fracx+10\hfill \end[/latex]

The equation of the line is [latex]y=-\fracx+10[/latex].

Coordinate plane with the x-axis ranging from negative 8 to 8 in intervals of 2 and the y-axis ranging from negative 2 to 12 in intervals of 2. Two functions are graphed on the same plot: y = negative 5 times x/3 plus 1/3 and y = negative 5 times x/3 plus 10. The lines do not cross.

Try It

Find the equation of the line parallel to [latex]5x=7+y[/latex] which passes through the point [latex]\left(-1,-2\right)[/latex].

Show Solution

Example: Finding the Equation of a Perpendicular Line

Find the equation of the line perpendicular to [latex]5x - 3y+4=0[/latex] which goes through the point [latex]\left(-4,1\right)[/latex].

Show Solution

The first step is to write the equation in slope-intercept form.

[latex]\begin5x - 3y+4=0\hfill \\ -3y=-5x - 4\hfill \\ y=\fracx+\frac\hfill \end[/latex]

We see that the slope is [latex]m=\frac[/latex]. This means that the slope of the line perpendicular to the given line is the negative reciprocal or [latex]-\frac[/latex]. Next, we use point-slope form with this new slope and the given point.

Key Concepts

  • Given two points, we can find the slope of a line using the slope formula.
  • We can identify the slope and y-intercept of an equation in slope-intercept form.
  • We can find the equation of a line given the slope and a point.
  • We can also find the equation of a line given two points. Find the slope and use point-slope form.
  • The standard form of a line has no fractions.
  • Horizontal lines have a slope of zero and are defined as [latex]y=c[/latex], where c is a constant.
  • Vertical lines have an undefined slope (zero in the denominator) and are defined as [latex]x=c[/latex], where c is a constant.
  • Parallel lines have the same slope and different y-intercepts.
  • Perpendicular lines have slopes that are negative reciprocals of each other unless one is horizontal and the other is vertical.

Glossary

slope the change in y-values over the change in x-values Licenses and Attributions CC licensed content, Original
  • Revision and Adaptation. Provided by: Lumen Learning. License: CC BY: Attribution
CC licensed content, Shared previously
  • College Algebra. Authored by: Abramson, Jay et al.. Provided by: OpenStax. Located at: http://cnx.org/contents/9b08c294-057f-4201-9f48-5d6ad992740d@5.2. License: CC BY: Attribution. License Terms: Download for free at http://cnx.org/contents/9b08c294-057f-4201-9f48-5d6ad992740d@5.2
  • Question ID 1719. Authored by: Barbara Goldner. License: CC BY: Attribution. License Terms: IMathAS Community License CC- BY + GPL
  • Question ID 110942, 110946, 110951, 110952, 110960, 110970, 110971. Authored by: Lumen Learning. License: CC BY: Attribution. License Terms: IMathAS Community License CC-BY + GPL
  • Question ID 1436. Authored by: WebWork-Rochester. License: CC BY: Attribution. License Terms: IMathAS Community License CC- BY + GPL
CC licensed content, Specific attribution
  • College Algebra. Authored by: OpenStax College Algebra. Provided by: OpenStax. Located at: http://cnx.org/contents/9b08c294-057f-4201-9f48-5d6ad992740d@3.278:1/Preface. License: CC BY: Attribution