Lines and Slopes
Powers of x
UBC Calculus Online Course Notes

Equations of Straight Lines

This page is a quick review of equations of straight lines. It contains a summary of the different ways of arriving at the equation of a straight line. Consult your favourite Calculus book for more details. As mentioned in the discussion of lines on the previous page, only two pieces of information are needed to completely describe a given line. However, we have some flexibility on which two pieces of information we use

  • Specifying the slope and the "y intercept", b, of the line.
  • Specifying the slope of the line and one point on the line.
  • Specifying two points through which the line passes.

(Comment: Since the "y intercept" is simply the point (0,b), the first and second entries above are closely related.)


Since this page is mainly review, you may be able to skim this material. Just be sure you can answer the problems at the bottom of this page. Should you have difficulty in understanding or answering these questions, we suggest reviewing the material on equations of lines in your favourite Calculus or analytic geometry book.


From the above information, in any of its forms, we can determine the equation of a straight line.

  • Given the slope m and "y intercept" b, the equation of the line is

    y = m x + b

  • Given the slope of the line m and one point P1 = (x1,y1) through which the line passes, we can formulate the equation as as:

    (y- y1)/(x-x1)= m

    We have written this equation in a form which makes it clear that the slope calculated between any point (x,y) on the line and the given point P1 is the same. However, the relationship generally gets simplified algebraically to:

    y = m (x-x1)+ y1

    This form is tidier, but conceals the simple truth behind how the equation was crafted, namely as a statement about the slope of the line.

  • Given that the line passes through the two points P1 = (x1,y1) and P2 = (x2,y2), we first find that the slope of the line is

    slope: m = (y2- y1)/ (x2-x1)

    We can then use the form shown in the second example above---namely,

    y = m x + b



    For your consideration:

    1. Consider the graph below:

      • Determine the value of the y intercept, b, of this line.
      • Find the slope of the line.
      • Write the equation of the line.

    2. A straight line passes through the points (-14,0) and (0,-10).
      • Plot a graph of the line on some ordinary graph paper. (Once you have sketched the line, you can peak at our graph. )
      • Find the equation of this line.

How to find the Equation of a Straight Line: Examples


Example 1 Find the equation of a straight line through the point (-1,3) with slope 2.

Answer: The slope of the line must be the same between any two points, e.g. between (x,y) and (-1,3) so that


\[ 
\frac{y-3}{x-(-1)} = 2 
\]

This implies that


\[ 
y-3 = 2(x+1) 
\] 
\[ 
y = 2(x+1) + 3 
\] 
\[ 
y = 2x +5 
\]


Example 2


Find the equation of a line through the points (1,2) and (3,1). What is its slope? What is its y intercept?

Answer: We first find the slope of the line by finding the ratio of the change in y over the change is x. Thus


\[ 
 m = \frac{(2-1)}{(1-3)} = -\frac{1}{2} 
\]

Now that we have the slope, the problem is similar to that in Example 1, so we use the same method to conclude that


\[ 
\frac{(y-2)}{(x-1)} = - \frac{1}{2} 
\]

Rearranging leads to


\[ 
 y = -\frac{x}{2} + \frac{5}{2} 
\]

Thus, the y intercept is 5/2 and the slope is -1/2.


Example 3

What is the equation of the line that passes through the point (1,1) and is perpendicular to the line $ y = -2x +2  $ ? Where do the two lines intersect ?

Answer:
Recall that two lines are perpendicular if their slopes are negative reciprocals of one another. Thus, the line $  y= mx+b $ would be perpendicular to any line whose slope is $ -1/m $ .
The slope of the original line is -2. Thus the slope of a second line perpendicular to it would be 1/2. We also require that this second line go through the point (1,1). Now we have reduced the problem to the type of calculation that we already did in example 1. We find that points on the line satisfy


\[ 
\frac{(y-1)}{(x-1)} = \frac{1}{2} 
\]

After rearranging, we find that the required equation is:


\[ 
y = \frac{x}{2} + \frac{1}{2} 
\]

In the second part of this problem we are asked to find the point(s) at which the two lines intersect. First recall that two lines either intersect at exactly one point, or else they intersect all along their length (if they correspond to the same line !). In any case, at points of intersection, both equations are satisfied simultaneously. Thus, we look for points (x,y) such that


\[ 
y = -2x +2 
\] 
\[ 
y = \frac{x}{2} + \frac{1}{2} 
\]

The above two equations imply that



\[ 
-2x+2 = \frac{x}{2} + \frac{1}{2} 
\] 
\[ 
-2x-\frac{x}{2}  = \frac{1}{2} - 2 
\] 
\[ 
-\frac{5}{2} x = -\frac{3}{2} 
\] 
\[ 
x = \frac{3}{5} 
\]

Thus, the x-coordinate of the point of intersection is found. The y value can be obtained by using either of the two equations, and simply plugging in this value of x. We find that


\[ 
y = -2x+2 = -2(\frac{3}{5}) + 2 = \frac{4}{5} 
\]

The answer is that the point of intersection is $  (3/5,4/5) $ . It is wise to check that this point also satisfies the equation of the second line to avoid simple algebraic mistakes.


Example 4

Find the equation of the tangent line to the circle


\[ 
x^2 + y^2 = 4 
\]

at the point in the first quadrant whose x coordinate is x=1.

Answer:
In order to answer this question, we must review some basic ideas from geometry. First, recall that a tangent line has the property that it "touches" a curve, intersecting it at a single point and having "the same direction" as the curve. (This vague description will be made much more precise in the course of this Calculus class). The special property of a circle is that the tangent line at each point on the circle is perpendicular to the radius vector. (A radius vector is a line pointing from the center of the circle to the point on the rim of the circle). You can see these properties of the tangent line in the demonstration below. (Move the red dot with your mouse to see how the tangent line, shown in red changes at different positions on the circle.)



The equation given in this problem describes a circle with center at (0,0) and radius 2. Further, note that if the x coordinate of the point on the circle is x=1, then the y coordinate must be given by


\[ 
y^2 = 4 - x^2 = 4 - 1 = 3 
\] 

\[ 
y = \pm \sqrt(3) 
\]

We observe that there are two values of y that correspond to the x coordinate x=1, but since we are interested in a point in the first quadrant, we select the positive value. This means that the point of the circle at which we want a tangent line has the coordinates $ (1,\sqrt(3)) $ . Thus, the radius vector is a line connecting (0,0) and $ (1,\sqrt(3)) $ , which means that its slope is


\[ 
m = \frac{\sqrt 3}{1} = \sqrt(3) 
\]

The tangent line, by what we have said above, is perpendicular to this radius vector, and has a slope the negative reciprocal of the above, namely


\[ 
m = \frac{-1}{\sqrt 3} 
\]

We now have all the information required to compute the equation of the tangent line: namely its slope, $ m = -1 / \sqrt 3 $ and a point through which it passes, $  (1, \sqrt(3)) $ . We find, after some simple algebra that the equation of the tangent line is:


\[ 
y = \frac{-1}{\sqrt 3}(x-4) 
\]