Equation of a Line: Definition, Method and Examples

MathPublished

Equation of a Line: Point-Slope and Slope-Intercept Forms

An equation of a line describes every point on that line. Point-slope form uses one known point and the slope, while slope-intercept form shows the slope and the vertical-axis intercept. Vertical lines need a different equation because their slope is undefined.

What does an equation of a line represent?

An equation of a straight line is an algebraic rule that connects the coordinates of every point on the line. It guarantees that any point (x,y)(x, y) satisfying the equation will lie perfectly on the line when plotted in coordinate geometry.


A straight line graph showing the relationship y equals x plus 2, with points marked at zero two and two four.


Every linear equation graph extends infinitely in both directions. The equation allows you to predict coordinates without expanding the visual graph, making it a powerful tool for linear equations and coordinate graphs.

Use point-slope form

The point-slope form is written as y−y1=m(x−x1)y - y_1 = m(x - x_1). It builds the equation of a line using the constant slope of a line, represented by mm, and the coordinates of one known point on the line, (x1,y1)(x_1, y_1).


The point-slope form directly models the proportional vertical and horizontal changes between any two points.


The variables xx and yy stay as letters in the final equation because they represent every possible point on the line.

A graph showing a slope triangle connecting a known point to a general point on a line.


To use this point-slope equation, substitute the known slope for mm, the known horizontal coordinate for x1x_1, and the known vertical coordinate for y1y_1.

Convert to slope-intercept form

The slope-intercept form is written as y=mx+by = mx + b. It is one of the most common ways to express a line equation because it clearly displays the slope mm and the vertical-axis intercept bb.


To convert a point-slope equation into slope-intercept form, expand the brackets by multiplying the slope across the horizontal terms, then isolate yy on one side of the equal sign.


For example, if you start with y−3=2(x−4)y - 3 = 2(x - 4), multiply 22 by both terms inside the brackets to get y−3=2x−8y - 3 = 2x - 8. Next, add 33 to both sides. The final slope-intercept equation is y=2x−5y = 2x - 5.

Write equations from information and graphs

When you need to write an equation from point and slope information given in a visual graph, start by identifying the exact coordinates of two clear points where the line crosses the grid intersections.

A coordinate grid showing a line passing through the points zero negative two and two two.


Calculate the slope mm by dividing the vertical change by the horizontal change between these two points. Once you find the slope, choose either point to be (x1,y1)(x_1, y_1) and substitute both values into the point-slope formula.

Handle horizontal and vertical lines

Horizontal and vertical lines behave differently because of their slopes. A horizontal line has a slope of exactly zero. A vertical line has an undefined slope because its horizontal change is zero, and division by zero is mathematically undefined.


A coordinate graph showing a horizontal line passing through y equals three and a vertical line passing through x equals negative two.


Because the slope is zero, the equation of any horizontal line simplifies to y=cy = c, where cc is the vertical intercept. Because the slope of a vertical line is undefined, the equation of any vertical line is written as x=ax = a, where aa is the constant horizontal position.

Worked examples

The following examples show how to form a line equation under different initial conditions.


Example 1: Using one point and the slope


Question: A line has a slope of 44 and passes through the point (2,5)(2, 5). Write its equation in point-slope form.


Method:

  1. Identify the given values: m=4m = 4, x1=2x_1 = 2, and y1=5y_1 = 5.
  2. State the point-slope formula: y−y1=m(x−x1)y - y_1 = m(x - x_1).
  3. Substitute the values directly into the formula.

Answer: y−5=4(x−2)y - 5 = 4(x - 2).


Check: Test the point (2,5)(2, 5) by placing it back into the result. 5−5=4(2−2)5 - 5 = 4(2 - 2) simplifies to 0=00 = 0, confirming the equation is correct.


Example 2: Deriving from two coordinates


Question: Find the slope-intercept equation of the line passing through (−1,4)(-1, 4) and (3,−4)(3, -4).


Method:

  1. Calculate the slope mm by dividing the change in yy by the change in xx: m=−4−43−(−1)=−84=−2m = \dfrac{-4 - 4}{3 - (-1)} = \dfrac{-8}{4} = -2.
  2. Choose one point, such as (−1,4)(-1, 4), and substitute it into the point-slope formula: y−4=−2(x−(−1))y - 4 = -2(x - (-1)).
  3. Simplify the brackets: y−4=−2(x+1)y - 4 = -2(x + 1).
  4. Expand and isolate yy: y−4=−2x−2y - 4 = -2x - 2, which becomes y=−2x+2y = -2x + 2.

Answer: y=−2x+2y = -2x + 2.


Check: Test the second point (3,−4)(3, -4) in the final equation. −4=−2(3)+2-4 = -2(3) + 2 simplifies to −4=−4-4 = -4, proving the line connects both points in coordinate geometry proofs.

Common mistakes

When substituting negative coordinates into the point-slope formula, learners often forget that the formula contains built-in subtraction. If x1x_1 is −3-3, the term becomes (x−(−3))(x - (-3)), which must be simplified to (x+3)(x + 3). Writing (x−3)(x - 3) instead is a frequent error.


Another common mistake is swapping the positions of the horizontal and vertical coordinates. Always ensure the yy-coordinate replaces y1y_1 on the left side of the equation, and the xx-coordinate replaces x1x_1 inside the brackets on the right side.

Frequently asked questions

Can I use any point on the line for the point-slope equation? Yes. A point-slope equation describes the entire line, not just one segment. If you choose a different point, the initial equation will look different, but it will always simplify to the exact same slope-intercept form.

Why do we need multiple forms of a line equation? Different forms are useful for different tasks.


The point-slope form is the fastest way to build an equation when analyzing data. The slope-intercept form makes graphing easier and simplifies comparisons between parallel and perpendicular lines on a coordinate plane.

Practice questions

Question

A coordinate grid displaying a line passing through the points negative one negative two and one two.


Which point-slope equation represents the line shown in the graph?

  • y−2=2(x−1)y - 2 = 2(x - 1)

  • y−1=2(x−2)y - 1 = 2(x - 2)

  • y−2=12(x−1)y - 2 = \dfrac{1}{2}(x - 1)

  • y+2=2(x−1)y + 2 = 2(x - 1)

Answer:

y−2=2(x−1)y - 2 = 2(x - 1)

Question

What is the slope-intercept form of the equation y−3=−4(x+2)y - 3 = -4(x + 2)?

  • y=−4x+2y = -4x + 2

  • y=−4x−5y = -4x - 5

  • y=−4x−8y = -4x - 8

  • y=−4x+5y = -4x + 5

Answer:

y=−4x−5y = -4x - 5

Question

Which equation represents a horizontal line passing through the point (−5,9)(-5, 9)?

  • x=−5x = -5

  • y=9y = 9

  • y=−5y = -5

  • x=9x = 9

Answer:

y=9y = 9

Question

A line passes through (0,−6)(0, -6) and (3,6)(3, 6). What is its equation?

  • y=4x+6y = 4x + 6

  • y=−4x−6y = -4x - 6

  • y=2x−6y = 2x - 6

  • y=4x−6y = 4x - 6

Answer:

y=4x−6y = 4x - 6

Question

What is the slope of the line described by the equation y+7=−3(x−5)y + 7 = -3(x - 5)?

  • −3-3

  • 33

  • −7-7

  • 55

Answer:

−3-3