Explainer: Equation of a Straight Line: General Form

In this explainer, we will learn how to find and write the equation of a straight line in general form.

In order to do this, we need to be familiar with the standard equation of a straight line graph and be confident in how to calculate the slope and 𝑦-intercept of a line.

To start, let us recap a couple of concepts.

Slope-Intercept Equation of a Line

The slope-intercept equation of a straight line is 𝑦=π‘šπ‘₯+𝑐, where π‘š is the slope and 𝑐 is the 𝑦-intercept. The slope is calculated using the formula π‘š=changein𝑦changeinπ‘₯. The 𝑦-intercept, 𝑐, can be calculated by substituting a point on the line into the equation once you have worked out the slope.

Let us demonstrate this in a series of examples.

Example 1: Finding the Equation of a Line through Two Points

Find the equation of the line that passes through the points 𝐴(5,11) and 𝐡(10,21).

Answer

First, we will sketch a diagram and calculate the difference in 𝑦 and the difference in π‘₯ by drawing a slope triangle.

The difference in 𝑦 is 21βˆ’11=10 and the difference in π‘₯ is 10βˆ’5=5. Thus, the slope is 105=2.

Therefore, this means that the equation of the line must be 𝑦=2π‘₯+𝑐.

Now, to calculate the 𝑦-intercept, 𝑐, we need to substitute one of the points from our line. Let us substitute the point 𝐴. We know that when π‘₯ is 5, 𝑦 is 11, so we can use these values to find 𝑐: 11=2(5)+𝑐. If we simplify, we get 11=10+𝑐, and subtracting 10 from each side we find that 𝑐=1.

Therefore, the equation of the line through 𝐴 and 𝐡 is 𝑦=2π‘₯+1.

We can check this equation by substituting the π‘₯ coordinate of 𝐡 and checking that we get the correct 𝑦-coordinate: 𝑦=2(10)+1=21, which is correct.

Example 2: Finding the Equation of a Line through Two Points Given in a Table of Values

Write the equation of the line that passes through the points indicated in the table of values.

π‘₯𝑦
312
70

Answer

We need to calculate the slope of the line through the two points. It is worth noting that the points presented in the table are (3,12) and (7,0). Now, it is not essential to draw a diagram, but it can be helpful to visualize what is happening, so let us do that first.

Notice in this example that the slope of the line is going from top to bottom. Therefore, the slope is negative. So, the difference in 𝑦 is 0βˆ’12=βˆ’12 and the difference in π‘₯ is 7βˆ’3=4. Thus, the slope is βˆ’124=βˆ’3.

The equation of the line is 𝑦=βˆ’3π‘₯+𝑐.

If we then substitute the point (3,12), we get 12=βˆ’3(3)+𝑐. Simplifying, 12=βˆ’9+𝑐, and adding 9 to both sides we find that 𝑐=21.

Therefore, the equation of the line is 𝑦=βˆ’3π‘₯+21.

Example 3: Finding the Equation of a Line through Two Points Giving Your Answer in a Specified Form

Find the equation of the line that passes through the points 𝐴(βˆ’10,2) and 𝐡(0,5), giving your answer in the form π‘Žπ‘¦+𝑏π‘₯+𝑐=0.

Answer

We start by calculating the slope of the line through the two points. We can do this without the aid of a diagram. The difference in 𝑦 is 5βˆ’2=3 and the difference in π‘₯ is 0βˆ’(βˆ’10)=10. Therefore, the slope is 310.

The equation of the line is, therefore, 𝑦=310π‘₯+𝑐.

We then substitute the coordinate (βˆ’10,2): 2=310(βˆ’10)+𝑐. Simplifying, we get 2=βˆ’3+𝑐, and adding 3 to both sides we find that 𝑐=5.

Therefore, the equation of the line is 𝑦=310π‘₯+5.

Now, the question asks us to leave the equation in a specified form, so we need to do some rearranging. First we need to get the equation on one level so we multiply both sides through by 10: 10𝑦=3π‘₯+50.

Now, we need to move the 3π‘₯ and 50 terms to the other side of the equation, so we subtract 3π‘₯ from both sides and subtract 50 from both sides, which gives us 10π‘¦βˆ’3π‘₯βˆ’50=0.

Example 4: Finding the Equation of a Line given Its Intercepts

What is the equation of the line with π‘₯-intercept βˆ’3 and 𝑦-intercept 4?

Answer

We have been given the two intercepts of the line. This is equivalent to having been given two points the line goes through. In particular, the π‘₯-intercept is βˆ’3 which means the line passes through the point (βˆ’3,0). Similarly, since the 𝑦-intercept is 4, the line passes through (0,4).

We can now calculate the slope of the line through the two points. The difference in 𝑦 is 4βˆ’0=4 and the difference in π‘₯ is 0βˆ’(βˆ’3)=3. Therefore, the slope is π‘š=43.

Therefore, the equation of the line is 𝑦=43π‘₯+𝑐.

Since 𝑐 represents the 𝑦-intercept, we can immediately jump to the conclusion that 𝑐=4. Therefore, the equation of the line is 𝑦=43π‘₯+4.

We can also express this in another form. By multiplying by 3, we can rewrite this as 3𝑦=4π‘₯+12.

Then, subtracting 4π‘₯ from both sides, we have 3π‘¦βˆ’4π‘₯=12.

Interestingly, we can generalize the result of the last example. If a line has intercepts π‘₯0 and 𝑦0, where π‘₯0,𝑦0β‰ 0, using the same idea above, we can state that it passes through the points (π‘₯0,0) and (0,𝑦0). Therefore, the slope π‘š is given by π‘š=𝑦0βˆ’00βˆ’π‘₯0=βˆ’π‘¦0π‘₯0.

Hence, given that 𝑦0 is the 𝑦-intercept, the equation of the line is 𝑦=βˆ’π‘¦0π‘₯0π‘₯+𝑦0.

By multiplying by π‘₯0, we can rewrite this as π‘₯0𝑦=βˆ’π‘¦0π‘₯+π‘₯0𝑦0.

Adding 𝑦0π‘₯ to both sides yields π‘₯0𝑦+𝑦0π‘₯=π‘₯0𝑦0.

Alternatively, we can divide through by π‘₯0𝑦0 which gives 𝑦𝑦0+π‘₯π‘₯0=1.

These are special forms of the equation of a line called the (two-) intercept from.

In our final example, we will find the equation of a straight line using a graph.

Example 5: Finding the Equation of a Line from a Graph

Write the equation represented by the graph shown. Give your answer in the form 𝑦=π‘šπ‘₯+𝑏.

Answer

We begin by identifying two points the line passes through. From the graph, we can identify a number of points with integer coordinates that the line passes through: (2,8), (0,4), (βˆ’2,0), and (βˆ’4,βˆ’4). We can use any pair of points to find the equation of the line. We will chose to use the two intercepts (0,4) and (βˆ’2,0).

We can now calculate the slope of the line: the difference in 𝑦 is 4βˆ’0=4 and the difference in π‘₯ is 0βˆ’(βˆ’2)=2. Therefore, the slope is π‘š=42=2.

The equation of the line is, therefore, 𝑦=2π‘₯+𝑐, where 𝑐 is the 𝑦-intercept. Since we know the 𝑦-intercepts is 4, we can conclude that the equation of the line is 𝑦=2π‘₯+4.

Alternatively, since we knew both of the intercept values, we could have used the intercept form of the line 𝑦𝑦0+π‘₯π‘₯0=1 with 𝑦0=4 and π‘₯0=βˆ’2 to write 𝑦4βˆ’π‘₯2=1.

We could then multiply by 4 to get π‘¦βˆ’2π‘₯=4.

Finally, we could add 2π‘₯ to both sides and arrive at the same answer: 𝑦=2π‘₯+4.

Using the method of finding the equation of a line from two points, we can derive a general formula as follows. Given a line that passes through two distinct points, (π‘₯1,𝑦1) and (π‘₯2,𝑦2), the slope can be calculated in the same way as example 1 by calculating the change in π‘₯ and 𝑦, so π‘š=𝑦2βˆ’π‘¦1π‘₯2βˆ’π‘₯1.

The equation of the line is, therefore, 𝑦=𝑦2βˆ’π‘¦1π‘₯2βˆ’π‘₯1π‘₯+𝑐, where 𝑐 can be found by substituting in one of the coordinates: 𝑐=𝑦1βˆ’π‘¦2βˆ’π‘¦1π‘₯2βˆ’π‘₯1π‘₯1.

The equation of the line is then 𝑦=𝑦2βˆ’π‘¦1π‘₯2βˆ’π‘₯1π‘₯+𝑦1βˆ’π‘¦2βˆ’π‘¦1π‘₯2βˆ’π‘₯1π‘₯1 which is usually simplified to the following: π‘¦βˆ’π‘¦1=𝑦2βˆ’π‘¦1π‘₯2βˆ’π‘₯1(π‘₯βˆ’π‘₯1).

Key Points

  1. To find the equation of a line through two points, we use the following method:
    1. Generally, it is best to start by drawing a diagram to check if the slope is positive or negative.
    2. Calculate the slope which is π‘š=changein𝑦changeinπ‘₯.
    3. Using one pair of coordinates, find the 𝑦-intercept by substituting them into your equation.
    4. Check your answer by substituting in the second pair of coordinates.
    5. If necessary, rearrange your formula to match the form requested in the question.
  2. A general formula for the equation of a line through the points (π‘₯1,𝑦1) and (π‘₯2,𝑦2) is given by π‘¦βˆ’π‘¦1=𝑦2βˆ’π‘¦1π‘₯2βˆ’π‘₯1(π‘₯βˆ’π‘₯1).

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.