- Mathematics, three units
How do you find the equation of the line through two given points?
First find the slope m by dividing the difference in y-coordinates by the difference in x-coordinates, keeping the points in the same order. Next, substitute m and one point into y = mx + n to solve for the y-intercept n. Write y = mx + n and check using the second point.
The topic explained
Two numbers define a straight line
Every straight line on a coordinate plane is determined by two values: its slope m and its y-intercept n. Written as y = mx + n, the equation tells you everything about how the line behaves. The slope m describes the rate of change: how much y changes whenever x increases by 1. A slope of 3 means the line rises 3 units for each step to the right, while a negative slope means it falls.
The value n is the y-intercept, which is where the line crosses the vertical y-axis at x = 0. In word problems, n usually represents the starting value or fixed base cost. To write an equation of line through two points, your only goal is to find these two numbers.
The two-step method with numbers
Suppose you need to find the line passing through (2, 5) and (6, 13). First, compute the slope m: subtract the first y-value from the second, and divide by the second x-value minus the first. Here, m = (13 - 5) / (6 - 2) = 8 / 4 = 2.
Second, find n by substituting the slope m = 2 and one point into y = mx + n. Using (2, 5), you get 5 = 2(2) + n, which simplifies to 5 = 4 + n, so n = 1. The equation is y = 2x + 1. Always substitute the second point (6, 13) to verify: 2(6) + 1 = 13.
Common pitfalls to watch for
A frequent error is mixing up the subtraction order when finding slope. If you calculate y2 - y1 in the numerator, you must use x2 - x1 in the denominator. Subtracting in reverse order in either half flips the sign of m, turning a rising line into a falling line.
Another mistake is confusing the x-intercept with the y-intercept. The y-intercept n occurs when x = 0. If you accidentally set y = 0, you find the x-intercept instead, which gives an incorrect equation.
Finding the Equation of a Line Through Two Points
For 11th-grade students. Calculate the slope m and the y-intercept n for each pair of points, write the final line equation in the form y = mx + n, and verify your answer with the second point.
Free, no sign-up. The answer key prints on the second page. Regenerating a new worksheet on the same topic needs a free account.
Find the equation of the line passing through (0, 3) and (2, 7).
Find the equation of the line passing through (1, 4) and (3, 10).
Find the equation of the line passing through (2, 8) and (5, 2).
Find the equation of the line passing through (-1, -5) and (3, 3).
Find the equation of the line passing through (-4, 7) and (2, 7).
A gym membership charges a fixed registration fee plus a set monthly fee. After 2 months, a client paid $70. After 5 months, the client paid $145. Write a linear equation for total cost y after x months.
Common questions
Does it matter which point I substitute to find n?
No. Both points lie on the line, so substituting either coordinate pair into y = mx + n produces the exact same value for n. Using the point with smaller or positive numbers simply makes the arithmetic easier.
What if both x-coordinates are the exact same number?
If both points share the same x-coordinate, such as (3, 1) and (3, 5), the line is vertical. Dividing by zero gives an undefined slope. A vertical line cannot be written as y = mx + n; its equation is simply x = c, where c is the shared x-value.
How do I know if two lines are parallel without drawing them?
Compare their slopes directly. Two distinct lines are parallel if and only if their slopes m are equal. You do not need to sketch them to be sure; algebraic equality of slopes guarantees they never meet.
How long does it take an 11th grader to master this method?
Most high school students master the basic steps in 30 to 45 minutes of focused practice. Additional practice helps prevent common calculation slips with negative signs and fractions.

Still have a question? Ask Lessi
Any question about this subject. Lessi answers right here, step by step.
Try asking
Asking needs a free account; your question is kept while you sign up. Answers are written by AI and can contain mistakes. Lessi doesn’t give medical or legal advice.
Learn it with a teacher
Learn this topic live with Lessi
Lessi, the AI teacher, explains it out loud on a board, with short quizzes, at your pace. The first 60 minutes are free.
Private teachers for Mathematics
Teachers on Lessoons, online or face to face. Each profile opens on the Lessoons site.
Featured teacher דביר הראלMathematics teacher₪200 / hourרמת גןבואו להתחיל איתי את השנה החדשה בתחושת ביטחון עצמי והבנה מעמיקה של החומר! אצלי גדלים מנצחים. אני הייטקיסט בעל רקע רב שנים בהוראת מתמטיקה בתיכון, מדעי המחשב ואנגלית.Full profile
גל חכם אהרוןMathematics teacher₪150 / hourירושליםבוגרת תואר ראשון במשפטים ובכלכלה מהאוניברסיטה העברית, ומרצה במכינה האוניברסיטאית של האוניברסיטה העברית.Full profile
אופיר מאגדיMathematics teacher₪200 / hourתל אביב -יפופרונטלי+ZOOM. הכנה מהירה ותכליתית לבחינה! מורה פרטי מצוין!!! רק למקצועות: המימון, ניהול פיננסי, שוק ההון ושמאות מקרקעין. יש מאות המלצות!Full profile
אבירם יעקביאןMathematics teacher₪230 / hourראשון לציוןבוגר מתמטיקה בהצטיינות מהטכניון, מרצה ומתרגל מצטיין. בעל ניסיון עשיר ורב שנים. מלמד מתמטיקה בגובה העיניים, סבלני ואיכפתי:)Full profile
יוחאי אMathematics teacherרמת גןסטטיסטיקאי ומוסמך MBA מסייע בעיבודים סטטיסטיים ומעביר שיעורים פרטיים (ליחיד או לקבוצות קטנות).Full profile
שי קמחיMathematics teacher₪200 / hourחיפהבוגר תואר שני עם שנות ניסיון בהוראה , רצון גדול להוביל להצלחות. .Full profile
בנימין דוידובMathematics teacher₪120 / hourאשקלוןמורה פרטי למתמטיקה/פיזיקה מזה כשבע שנים המלמד בצפון ובדרום - מגיש לבגרויות בכל הרמות טלפון - **********Full profile
יובל שפיראMathematics teacher₪80 / hourעתליתיובל, בת 23 מעתלית, בוגרת 5 יח״ל מתמטיקה בציון 95, בעלת ניסיון בהדרכה והוראה. מציעה תגבור, הכנה למבחנים וחיזוק הבסיס. סבלנית, אחראית וניידת עם רכב 😊Full profile