Q. how to find y-intercept with two points
Answer
Given points \((x_1,y_1)\) and \((x_2,y_2)\) with \(x_1 \ne x_2\):
\[
m = \frac{y_2-y_1}{x_2-x_1}
\]
\[
b = y_1 – m x_1 = \frac{x_2 y_1 – x_1 y_2}{x_2 – x_1}
\]
The y-intercept is \((0,b)\).
Detailed Explanation
How to find the y-intercept from two points (step-by-step)
Given two distinct points on a line, (x1, y1) and (x2, y2), the y-intercept is the value b in the line equation \(y = m x + b\). The following steps show exactly what to do and why at each step.
-
Step 1 — Check for a vertical line (special case)
What to do: Compare x1 and x2.
Why: If x1 = x2, the line is vertical and has the form \(x = c\) with \(c = x_1\). A vertical line has no finite y-intercept unless \(c = 0\). If \(c = 0\) then the line is the y-axis and every point on it intersects the y-axis (the concept of a single y-intercept is not meaningful).
Action:
If x1 = x2 and x1 ≠ 0, stop: there is no y-intercept. If x1 = x2 = 0, the line is the y-axis (every y is an intersection). Otherwise continue to Step 2.
-
Step 2 — Compute the slope m
What to do: Use the slope formula
\(m = \dfrac{y_{2} – y_{1}}{x_{2} – x_{1}}\)
Why: The slope gives the rate of change of y with respect to x and is needed to write the line in slope-intercept form \(y = m x + b\).
Note: This is valid because x1 ≠ x2 (we excluded the vertical-line case in Step 1).
-
Step 3 — Write the line equation and solve for b
What to do: Start with the slope-intercept form
\(y = m x + b\)
Substitute one of the given points, for example (x1, y1), and solve for b:
\(b = y_{1} – m x_{1}\)
Why: Substituting a known point into \(y = m x + b\) isolates b so you can compute the y-intercept directly.
-
Step 4 — (Optional) Use a single formula for b in terms of the two points
What to do: Combine the slope formula and the expression for b to get a direct formula for b:
\(b = y_{1} – x_{1}\,\dfrac{y_{2} – y_{1}}{x_{2} – x_{1}}\)
Simplify the expression to a single fraction if desired:
\(b = \dfrac{x_{2}y_{1} – x_{1}y_{2}}{x_{2} – x_{1}}\)
Why: This formula computes the y-intercept directly from the coordinates of the two points without separately computing m first.
-
Step 5 — State the y-intercept
What to do: The y-intercept is the point where x = 0, so it is (0, b). The numeric value of the intercept on the y-axis is b as computed above.
Why: By definition the y-intercept is the y-value when x = 0, which is exactly b in \(y = m x + b\).
Compact summary
For non-vertical lines through (x1, y1) and (x2, y2):
\(m = \dfrac{y_{2} – y_{1}}{x_{2} – x_{1}}\)
\(b = y_{1} – m x_{1}\)
Or directly
\(b = \dfrac{x_{2}y_{1} – x_{1}y_{2}}{x_{2} – x_{1}}\)
Worked numerical example
What to do: Apply the steps to concrete points. Suppose the points are (2, 3) and (5, 11).
- Compute the slope:
- Compute b using (2, 3):
- Thus the y-intercept is
\(m = \dfrac{11 – 3}{5 – 2} = \dfrac{8}{3}\)
\(b = 3 – \dfrac{8}{3}\cdot 2 = 3 – \dfrac{16}{3} = \dfrac{9}{3} – \dfrac{16}{3} = -\dfrac{7}{3}\)
\((0, -\dfrac{7}{3})\) and the y-intercept value is \(b = -\dfrac{7}{3}\).
Follow these steps with any two non-vertical points to find the y-intercept. If the two given x-values are equal, handle the vertical-line special case described in Step 1.
Graph
FAQs
How do I get the slope from two points \((x_1,y_1)\) and \((x_2,y_2)\)?
Once I have the slope, how do I find the y-intercept?
Is there a direct formula for the y-intercept from two points?
What if the two points have the same x-value (vertical line)?
What if one of the given points is on the y-axis?
How do I handle fractional or decimal slopes to get an exact intercept?
How can I check my y-intercept is correct?
Can I find the intercept by solving a linear system instead?
Use our tools to simplify it.
Math, Calculus, Geometry, etc.