This article was coauthored by Grace Imson, MA. Grace Imson is a math teacher with over 40 years of teaching experience. Grace is currently a math instructor at the City College of San Francisco and was previously in the Math Department at Saint Louis University. She has taught math at the elementary, middle, high school, and college levels. She has an MA in Education, specializing in Administration and Supervision from Saint Louis University.
This article has been viewed 856,300 times.
Finding the equation for a line is a common problem in geometry and trigonometry. There are two common situations where you are asked to find the equation for a line: either you'll be provided with one point on the line and the slope of the line, or you'll be provided two points on the line. In either case, finding the equation for that line isn't difficult, provided you use the correct formula and work carefully.
Steps
Method 1
Method 1 of 2:Calculating the Equation with One Point and the Slope

1Plug the slope in for m in the formula yy_{1} = m(xx_{1}). This is known as the pointslope formula.^{[1] X Expert Source Grace Imson, MAMath Teacher Expert Interview. 1 November 2019. } The pointslope formula uses the slope and the coordinates of a point along the line to find the yintercept. Use the slope in place of m in yy_{1} = m(xx_{1}).^{[2] X Research source }
 For example, if you know the slope of the line is 2, then your formula will look like this: yy_{1} = 2(xx_{1}).

2Replace x_{1} and y_{1} with the coordinates of the point. Use the coordinates you’re given as (x_{1}, y_{1}). Put the numbers in the corresponding spot on your formula before you start solving the equation.^{[3] X Expert Source Grace Imson, MAMath Teacher Expert Interview. 1 November 2019. }
For example, if you know the coordinate is (4, 3), your formula will read: y3 = 2(x4).
Advertisement 
3Solve the formula for y to get the final slopeintercept formula. Follow the mathematical order of operations and the distributive property to remove the xterm from parenthesis.^{[4] X Expert Source Grace Imson, MAMath Teacher Expert Interview. 1 November 2019. }
 In our example, first you’d use the distributive property to get y3=2x8.
 Then, add 3 to each side so y is by itself.
 The final equation for a line in slopeintercept form with a slope of 2 that contains the point (4, 3) is y = 2x5.
Advertisement
Method 2
Method 2 of 2:Finding the Equation Using Two Points

1Find the slope using m = (y_{2}y_{1})/(x_{2}x_{1}). The ordered pairs of the coordinates you have are listed as (x, y). Use the first set of coordinates as (x_{1}, y_{1}) and the second set as (x_{2}, y_{2}). Plug the numbers into the formula m = (y_{2}y_{1})/(x_{2}x_{1}) and solve for m.^{[5] X Expert Source Grace Imson, MAMath Teacher Expert Interview. 1 November 2019. }
For example, if your coordinates are (3, 8) and (7, 12), the formula would read: m = (128)/(73) = 4/4 = 1. In this case, your slope, or m, equals 1.

2Replace the m in the slopeintercept formula with the slope you found. The slopeintercept formula of a line is written as y = mx+b, where m is the slope and b is the yintercept (the point on the yaxis where the line crosses it). Plug the number you found for your slope in place of m.^{[6] X Research source }
 In our example, the formula would read y = 1x+b or y = x+b when you replace the slope value.

3Substitute x and y for one of the points you know to solve for the yintercept. Pick one of the ordered pairs to put into the slopeintercept formula. Put the xvalue in place of x and the yvalue in place of y.^{[7] X Research source }
 In this example, if you chose (3, 8) as your coordinates, then the formula would read 8 = 1(3)+b.

4Solve the equation for b. Once you plug the x and yvalues as well as your slope into the formula, find the value of b in the equation. Follow the order of operations first before moving the rest of the numbers to the other side. Leave b on one side of the equation to solve it.^{[8] X Research source }
 In our example, the formula currently reads 8 = 1(3)+b. Multiply 1 and 3 together to get 8 = 3+b. Since 3 is a positive number, subtract 3 from each side to isolate b. This leaves you with 5 = b, or b = 5.

5Plug in the slope and yintercept into the slopeintercept formula to finish the equation. Once you’re finished, plug in the slope for m and the yintercept for b. After that, you’ve found the equation for the line.
 For example, the equation for the line with points on (3, 8) and (7, 12) is y = 1x+5 or simply y = x+5.
Advertisement
Community Q&A

QuestionHow do I find an intercept of a line?DonaganTop AnswererUsing the equation, set x equal to zero and solve for y to find the yintercept, or set y equal to zero and solve for x to find the xintercept.

QuestionWhat should I do with a negative y?Community AnswerYou multiply the whole equation by 1 to remove the negative sign. For example, if the question is: y=5x+1, you would then change the question to: y*(1) = (5x+1)*(1), and then get: y=5x1.

QuestionWhat about given a slope and an intercept in y?DonaganTop AnswererExpress the equation in standard form, y = mx + b, where m is the slope, and b is the yintercept.

QuestionThe teacher wants me to write the equation of a line. If the gradient is 3 and the y intercept is 5, is the equation y = 3x + 5?DonaganTop AnswererYes, y = 3x  5.

QuestionWhat if my parallel line is the yaxis?DonaganTop AnswererThat means the line you're looking for would be defined as x = b: the line is vertical, m is "undefined" (infinity), and b is the xintercept.

QuestionHow do I find whether a point (coordinate) falls on a line?DonaganTop AnswererTake the x and ycoordinates of the point, and insert them into the equation of the line. If the equation holds true with those x and y values inserted, the point is on the line.

QuestionHow do I find a parallel line?DonaganTop AnswererAssuming a given straight line in the form of y = mx + b, any parallel line would have the same form with the same "m" but a different "b."

QuestionHow would I solve a system with only one given point?DonaganTop AnswererA "system" consists of at least two different equations (and thus at least two lines on a graph). As the above article explains, two pieces of information are required in order to define a line: a point and a slope. To "solve a system with only one given point," the point would have to be the intersection of the lines, and you would then need each line's slope.

QuestionWhat about one point and no slope?DonaganTop AnswererAs the above article explains, two pieces of information are required in order to define a straight line: the line's slope and a point on the line. If you don't know the slope, you could have an infinite number of lines passing through a given point.

QuestionHow to find the equation of a line when points are given?DonaganTop AnswererUse Method 2 above.
References
 ↑ Grace Imson, MA. Math Teacher. Expert Interview. 1 November 2019.
 ↑ http://www.coolmath.com/algebra/08lines/11findingequationlinepointslope01
 ↑ Grace Imson, MA. Math Teacher. Expert Interview. 1 November 2019.
 ↑ Grace Imson, MA. Math Teacher. Expert Interview. 1 November 2019.
 ↑ Grace Imson, MA. Math Teacher. Expert Interview. 1 November 2019.
 ↑ https://www.mathwarehouse.com/algebra/linear_equation/writeequation/equationoflinegiventwopoints.php
 ↑ https://www.mathwarehouse.com/algebra/linear_equation/writeequation/equationoflinegiventwopoints.php
 ↑ https://www.mathwarehouse.com/algebra/linear_equation/writeequation/equationoflinegiventwopoints.php
About This Article
To find the equation of a line using 2 points, start by finding the slope of the line by plugging the 2 sets of coordinates into the formula for slope. Then, plug the slope into the slopeintercept formula, or y = mx + b, where "m" is the slope and "x" and "y" are one set of coordinates on the line. Next, solve the formula to find the value of "b," which is the yintercept. Finally, plug the slope and yintercept into the slopeintercept formula to finish the equation of the line. To learn how to find the equation of a line using 1 point, scroll down!
Reader Success Stories

"The article led you through each method clearly, step by step, with picture examples and simple explanations. It helped me complete my MyMaths problems and to produce a set of revision notes about equations of lines. Thank you very much."..." more