This article was co-authored 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.
There are 6 references cited in this article, which can be found at the bottom of the page.
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
Method1
Calculating the Equation with One Point and the Slope
1
Plug the slope in for m in the formula y-y_{1} = m(x-x_{1}). This is known as the point-slope formula. The point-slope formula uses the slope and the coordinates of a point along the line to find the y-intercept. Use the slope in place of m in y-y_{1} = m(x-x_{1}).^{[1]}
For example, if you know the slope of the line is 2, then your formula will look like this: y-y_{1} = 2(x-x_{1}).
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.
Grace Imson, MA Math Instructor, City College of San Francisco
Our Expert Agrees: When you're given two points to solve for the equation of the line, the first thing you have to find is the slope of the line. To get that, subtract the vertical coordinates, then divide that by the difference in the horizontal coordinates.
2
Replace 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.^{[2]}
For example, if you know the coordinate is (4, 3), your formula will read: y-3 = 2(x-4).
3
Solve the formula for y to get the final slope-intercept formula. Follow the mathematical order of operations and the distributive property to remove the x-term from parenthesis.
In our example, first you’d use the distributive property to get y-3=2x-8.
Then, add 3 to each side so y is by itself.
The final equation for a line in slope-intercept form with a slope of 2 that contains the point (4, 3) is y = 2x-5.
Method2
Finding the Equation Using Two Points
1
Find 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.^{[3]}
For example, if your coordinates are (3, 8) and (7, 12), the formula would read: m = (12-8)/(7-3) = 4/4 = 1. In this case, your slope, or m, equals 1.
2
Replace the m in the slope-intercept formula with the slope you found. The slope-intercept formula of a line is written as y = mx+b, where m is the slope and b is the y-intercept (the point on the y-axis where the line crosses it). Plug the number you found for your slope in place of m.^{[4]}
In our example, the formula would read y = 1x+b or y = x+b when you replace the slope value.
3
Substitute x and y for one of the points you know to solve for the y-intercept. Pick one of the ordered pairs to put into the slope-intercept formula. Put the x-value in place of x and the y-value in place of y.^{[5]}
In this example, if you chose (3, 8) as your coordinates, then the formula would read 8 = 1(3)+b.
4
Solve the equation for b. Once you plug the x- and y-values 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.^{[6]}
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.
5
Plug in the slope and y-intercept into the slope-intercept formula to finish the equation. Once you’re finished, plug in the slope for m and the y-intercept 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.
Using the equation, set x equal to zero and solve for y to find the y-intercept, or set y equal to zero and solve for x to find the x-intercept.
Question
What should I do with a negative y?
Community Answer
You 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=5x-1.
Question
What about given a slope and an intercept in y?
Donagan
Top Answerer
Express the equation in standard form, y = mx + b, where m is the slope, and b is the y-intercept.
Question
The 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?
Donagan
Top Answerer
Yes, y = 3x - 5.
Question
What if my parallel line is the y-axis?
Donagan
Top Answerer
That 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 x-intercept.
Question
How do I find whether a point (coordinate) falls on a line?
Donagan
Top Answerer
Take the x- and y-coordinates 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.
Question
How do I find a parallel line?
Donagan
Top Answerer
Assuming a given straight line in the form of mx + b, any parallel line would have the same form with the same "m" but a different "b."
Question
How would I solve a system with only one given point?
Donagan
Top Answerer
A "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.
Question
What about one point and no slope?
Donagan
Top Answerer
As 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.
Question
Can the slope, when finding the equation of a line, be negative?
Community Answer
Yes it can. For example the equation: y=-2x+3, where -2 is the slope and 3 is the y intercept. If you graph this, it forms a negative line.
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 slope-intercept 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 y-intercept. Finally, plug the slope and y-intercept into the slope-intercept formula to finish the equation of the line. To learn how to find the equation of a line using 1 point, scroll down!
Did this summary help you?
Article Info
FEATURED ARTICLE
This article was co-authored 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.
81% of people told us that this article helped them.
JB
Joseph Barnes
Dec 4, 2016
"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
TD
Tony Doyle
Feb 4, 2017
"I love the fact that it explains in a step-by-step method, as it's so easy to be bogged down with choices while doing these type of calculations. Top marks."..." more
BV
Bryan Valle
Nov 13, 2016
"Finally going back to school after 2 years, and this was very helpful to remember and refresh my math skills. "
TS
Tanmay Sahoo
Feb 6, 2017
"Thanks, wikiHow. I had almost forgotten this part. This article really helped me remember the formulas again. "
RM
Reese Muffin
Dec 13, 2016
"In 8th grade, you need stuff like this to help you when the teacher doesn't. Thank you, wikiHow!"
A
Anonymous
Jan 17, 2018
"The general information really made things click, along with the different methods."
IS
Isaiah Smith
Dec 14, 2016
"Thank you so much, wikiHow has helped me a lot in high school. Good job."
A
Anonymous
Feb 22, 2017
"Everything helped! It made a lot of sense, and it clicked in my brain."
A
Anonymous
Dec 8, 2017
"Thanks a lot, it is very helpful with very easy examples."