Forms of the equation of a line · Mathematics Class 11–12 | StemPy Lab
Course 6.1·Lesson 3 of 3
Forms of the equation of a line
A point is on a line when its coordinates satisfy the line's equation. Four standard forms cover most lines: point-slope y−y1=m(x−x1)
Lesson 3 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
write the equation of a horizontal or a vertical line;
write the equation of a line in point-slope, two-point, slope-intercept and intercept form;
find the intercepts of a line and the slope from its intercepts;
find the point that divides a segment in a given ratio, and use it to fix a line.
Horizontal and vertical lines
Every point of a horizontal line has the same y-coordinate. A horizontal line through (0,b) is
y=b.
A vertical line has the same x-coordinate everywhere. The vertical line through (a,0) is
x=a.
The x-axis is y=0 and the y-axis is x=0.
Point-slope form
Let a line pass through (x1,y1) with slope m. A point P(x,y) is on the line when the slope from (x1,y1) to P is also m:
x−x1y−y1=msoy−y1=m(x−x1).
Two-point form
Suppose the line passes through (x1,y1) and (x2,y2). Its slope is x2−x1y2−y1, and the point-slope form gives
y−y1=x2−x1y2−y1(x−x1).
Slope-intercept form
Suppose a line has slope m and cuts the y-axis at (0,c). The number c is the y-intercept. The point-slope form at (0,c) gives
y=mx+c.
A vertical line cannot be written this way, because it has no slope.
Intercept form
Suppose a line cuts the x-axis at (a,0) and the y-axis at (0,b). The numbers a and b are its intercepts. The slope is 0−ab−0=−ab, so y−b=−ab(x−0). Divide by b and rearrange:
ax+by=1.
A blue line slopes down to the right. It crosses the y-axis at the point 0, b and the x-axis at the point a, 0, both marked with red dots. The label on the line reads x over a plus y over b equals one. A list on the right is headed Four forms. It shows the point-slope form, the two-point form, y equals m x plus c, and the intercept form.
This form needs a=0 and b=0. It cannot describe a line through the origin, or a line parallel to an axis.
A point that divides a segment
Sometimes a line has to pass through a point defined by a ratio. Let P lie on the segment from A(x1,y1) to B(x2,y2), with AP:PB=m:n. Then
P=(m+nmx2+nx1,m+nmy2+ny1).
The larger part of the ratio multiplies the far point. When m=n, the formula gives the midpoint.
Worked examples
The line through two points. Find the equation of the line through A(3,1) and B(7,9), and its intercepts.
The slope.m=7−39−1=2.
Point-slope form.y−1=2(x−3), so y=2x−5.
The intercepts. At x=0, y=−5. At y=0, x=2.5.
A point from a ratio. The point P divides the segment from A(−1,2) to B(5,8) in the ratio 1:2. Find the line through P with slope −3.
The x-coordinate.31×5+2×(−1)=1.
The y-coordinate.31×8+2×2=4, so P=(1,4).
The line.y−4=−3(x−1), so y=−3x+7.
Intercepts in a ratio. A line passes through (6,1), and its x-intercept is 3 times its y-intercept. Find the intercepts.
The form. Let the y-intercept be b. Then 3bx+by=1.
Use the point.3b6+b1=1, so b3=1 and b=3.
The answer. The y-intercept is 3 and the x-intercept is 9.
Practise with new numbers
Try it in Python
The program finds the equation of a line from two points, then its intercepts, and checks that both points satisfy it.
Common mistakes
Writing x+x1 in point-slope form. The form is y−y1=m(x−x1), with minus signs in both brackets.
Using intercept form for a line through the origin. Both intercepts are 0, and the form needs a division by 0.
Writing a vertical line as y=mx+c. A vertical line has the equation x=a.
Mixing up the intercept with the slope. In y=mx+c, the slope is m and the y-intercept is c.
Swapping the ratio. In the section formula, the part m multiplies the far point B.