Tutorial on Equation of Line

This is a tutorial on how to find the slopes and equations of lines. A review of the main results concerning lines and slopes and then examples with detailed solutions are presented.

REVIEW

Slope of a Line:

If a line passes through two distinct points P1(x1 , y1) and P2(x2, y2), its slope is given by:
m = (y2 - y1) / (x2 - x1)
with x2 not equal to x1.
This is another interactive tutorial on the slope of a line.

General Equation of a Straight line:

The general equation of straight line is given by:

Ax + By = C

where A, B and C are constants and A and B cannot be both zero. For an interactive exploration of this equation Go here.
Any straight line in a rectangular system has an equation of the form given above.

Slope intercept form of a Line:


The equation of a line with a defined slope m can also be written as follows:
y = mx + b
where m is the slope of the line and b is the y intercept of the graph of the line.
The above form is called the slope intercept form of a line. To understand why, go to this interactive tutorial.



Point-Slope form of a line:


An equation of a line through a point P(x1 , y1) with slope m is given by
y - y1 = m(x - x1)

Vertical and Horizontal lines:

a - If we set A to zero in the general equation, we obtain an equation in y only of the form

By = C
which gives y = C/B = k; k is a constant. This is a horizontal line with slope 0 and passes through all points with y coordinate equal to k.

b - If we set B to zero in the general equation, we obtain

Ax = C
which gives x = C/A = h; h is constant. This is a vertical line with undefined slope and passes through all points with x coordinate equal to h.

Parallel Lines:

Two non vertical lines are parallel if and only if their slopes are equal.

Perpendicular Lines:

Two non vertical lines are perpendicular if and only if their slopes m1 and m2 are such that
m1*m2 = -1




Example 1: Find the slope of a line passing through the points

  1. (2 , 3) and (0 , -1)
  2. (-2 , 4) and (-2 , 6)
  3. (5 , 2) and (-7 , 2)


Solution to Example1:

  1. m = (y2 -  y1) / (x2 - x1) = (-1 -  3) / (0 - 2) = 2

  2. m = (6 - 4) / (-2 + 2)
    The division by -2 + 2 = 0 is undefined and the slope in this case is undefined. The line passing through the given points is a vertical line.

  3. m = (2 - 2) / (-7 - 5) = 0
    The slope is equal to 0 and the line through the given points is a horizontal line.

Matched Exercise 1: Find the slope of a line passing through the points

  1. (-2 , 7) and (-2 , -1)
  2. (2 , 4) and (-2 , 6)
  3. (-1 , -2) and (4 , -2)


Example 2: Find the equation of the line that passes through the point (-2 , 5) and has a slope of -4.

Solution to Example 2:

  • Substitute y1 , x1 and m in the point slope form of a line
    y - y1 = m(x - x1)

    y - 5 = - 4(x - (-2))
    y = - 4x - 3

Matched Exercise 2: Find the equation of the line that passes through the point (3 , 0) and has a slope of - 1.


Example 3: Find the equation of the line that passes through the points (0 , -1) and (3 , 5).

Solution to Example 3:

  • We first calculate the slope of the line
    m = (5 - (-1)) / (3 - 0) = 6 / 3 = 2

  • Use the slope and any of the two points to write the equation of the line using the point slope form.
    y - y1 = m(x - x1)
    using the first point
    y - (-1) = 2(x - 0)
    y = 2x - 1

Matched Exercise 3: Find the equation of the line that passes through the points (2 , 0) and (3 , 3).


Example 4: Find the slope of the line given by the equation

-2x + 4y = 6

Solution to Example 4:

  • Given the equation
    -2x + 4y = 6

  • Write the equation in slope intercept form
    4y = 2x + 6
    y = (1/2)x + 3/2

  • The slope of the line is given by the coefficient of x and is equal to 1/2.

Matched Exercise 4: Find the slope of the line given by the equation

x - 3y = -9


Example 5: Find an equation of the line that passes through the point (-2 , 3) and is parallel to the line 4x + 4y = 8

Solution to Example 5:

  • Let m1 be the slope of the line whose equation is to be found and m2 the slope of the given line. Rewrite the given equation in slope intercept form and find its slope.
    4y = -4x + 8

  • Divide both sides by 4
    y = -x + 2
    slope m2 = -1.

  • Two lines are parallel if and only if they have equal slopes
    m1 = m2 = -1

  • We now use the point slope form to find the equation of the line with slope m1.
    y - 3 = -1(x - (-2))
    which may be written as
    y = -x + 1

Matched Exercise 5: Find an equation of the line that passes through the point (-1 , 0) and is parallel to the line
-2x + 2y = 8


Example 6: Find an equation of the line that passes through the point (0 , -3) and is perpendicular to the line -x + y = 2.

Solution to Example 6:

  • Let m1 be the slope of the line whose equation is to be found and m2 the slope of the given line. Rewrite the given equation in slope intercept form and find its slope.
    y = x + 2
    slope m2 = 1

  • Two lines are perpendicular if and only their slopes are such that
    m1*m2 = -1

  • This gives m1 = -1

  • We now use the point slope form to find the equation of the line with slope m1.
    y - (-3) = -1(x - 0)
    which may be written
    y = -x - 3

Matched Exercise 6: Find an equation of the line that passes through the point (-2 , 1) and is perpendicular to the line x + 2y = -2.

More references on lines and slopes.


  1. Easy to use calculator to find slope and equation of a line through two points.Find Distance, Slope and Equation of Line - Calculator.

  2. Another calculator to find slope, x and y intercepts given the equation of a line.Find Slope and Intercepts of a Line - Calculator

  3. Find Distance From a Point to a Line - Calculator

  4. Find a Parallel Line Through a Point: Find a line that is parallel to another line and passes through a point.


  5. Find a Perpendicular Line Through a Point: Find a line that is perpendicular to another line and passes through a point.


  6. General Equation of a Line: ax + by = c - Applet

  7. Slope Intercept Form Of a Line

  8. Slope of a Line


Find the Inverse Functions - Online Calculator
Free Online Graph Plotter for All Devices
Home Page -- HTML5 Math Applets for Mobile Learning -- Math Formulas for Mobile Learning -- Algebra Questions -- Math Worksheets -- Free Compass Math tests Practice
Free Practice for SAT, ACT Math tests -- GRE practice -- GMAT practice Precalculus Tutorials -- Precalculus Questions and Problems -- Precalculus Applets -- Equations, Systems and Inequalities -- Online Calculators -- Graphing -- Trigonometry -- Trigonometry Worsheets -- Geometry Tutorials -- Geometry Calculators -- Geometry Worksheets -- Calculus Tutorials -- Calculus Questions -- Calculus Worksheets -- Applied Math -- Antennas -- Math Software -- Elementary Statistics High School Math -- Middle School Math -- Primary Math
Math Videos From Analyzemath
Author - e-mail


Updated: 2 April 2013

Copyright © 2003 - 2014 - All rights reserved