We know that all linear equations can be written in the form $y=ax+b$y=ax+b where $a$a is the slope and $b$b is the value of the $y$y-intercept.
Knowing this, we can also work out the equation of a straight line if we are given its graph (or a table of values) - we just need to work out the slope and $y$y-intercept. That is, we want to find $a$a and $b$b
To find $b$b we can just look at where the line crosses the $y$y-axis. The value of $y$y at this point is our $y$y-intercept.
To find the slope, we want to choose two points on the line that we can easily identify the co-ordinates of, ideally points with integer co-ordinates. Using these two points we can calculate the slope, by identifying the rise and run of the line, or by using the slope formula.
Consider the following graph. How can we work out its equation?
Every linear equation can be written in the form $y=ax+b$y=ax+b so if we can find $a$a and $b$b we can find the equation.
We can see that the $x$x and $y$y-intercepts are clearly marked on the graph and to find the equation of a straight-line graph we actually only need to know two points, so let's use the two intercepts.
The $y$y-intercept is at $\left(0,-6\right)$(0,−6) which means $b=-6$b=−6.
To find the slope $a$a we want to work out the rise and run of the line. As we move along the line from the $x$x-intercept to the $y$y-intercept , we have moved from $\left(0,-6\right)$(0,−6) to $\left(2,0\right)$(2,0). That is, the $x$x-value has increased by $2$2 and the $y$y-value has increased by $6$6. This means we have a run of $2$2 and a rise of $6$6.
This means the slope $a$a is equal to $\frac{6}{2}=3$62=3.
We could have chosen any two points on this line, but sometimes the coordinates might not be clear if they are not integer values. In this case, the point that is one unit along the $x$x-axis from the point $\left(0,-6\right)$(0,−6) has coordinates of $\left(1,-3\right)$(1,−3) which confirms the slope is $3$3 and as expected.
If the line passes through the origin $\left(0,0\right)$(0,0) the $x$x and $y$y-intercept both occur at this point, so you will need to find a second point to calculate the slope.
Sometimes we don't know the value of the $y$y-intercept, but if we know the slope and the coordinates of one point, we can still find the equation of the line. If we don't know the slope, but know the coordinates of two points, we can first find the slope and then use the point-slope formula.
Let's say we know that the slope of the line is $-2$−2. We also know a point on the line, $\left(2,-8\right)$(2,−8).
Now, apart from this point there are infinitely many other points on this line, and we will let $\left(x,y\right)$(x,y) represent each of them.
Well, since $\left(x,y\right)$(x,y) and $\left(2,-8\right)$(2,−8) are points on the line, then the slope between them will be $-2$−2.
We know that to find the slope given two points, we use:
$a=\frac{\text{change in }y}{\text{change in }x}$a=change in ychange in x
Let's apply the slope formula to $\left(x,y\right)$(x,y) and $\left(2,-8\right)$(2,−8):
$a=\frac{y-\left(-8\right)}{x-2}$a=y−(−8)x−2
But we know that the slope of the line is $-2$−2. So:
$\frac{y-\left(-8\right)}{x-2}=-2$y−(−8)x−2=−2
Rearranging this slightly, we get:
$y-\left(-8\right)=-2\left(x-2\right)$y−(−8)=−2(x−2)
You may be thinking that we should simplify the equation, and of course if you do you should get $y=-2x-4$y=−2x−4 What we want to do though, is generalise our steps so that we can apply it to any case where we're given a slope $a$a, and a point on the line $\left(x_1,y_1\right)$(x1,y1).
In the example above, the point on the line was $\left(2,-8\right)$(2,−8). Let's generalise and replace it with $\left(x_1,y_1\right)$(x1,y1).
We were also given the slope $-2$−2. Let's generalise and replace it with $a$a.
$y-\left(-8\right)=-2\left(x-2\right)$y−(−8)=−2(x−2) becomes $y-y_1=a\left(x-x_1\right)$y−y1=a(x−x1)
We call this the point slope formula, because when we know a point and the slope using this rule we can easily get the equation of that line.
Given a point on the line $\left(x_1,y_1\right)$(x1,y1) and the slope $a$a, the equation of the line is:
$y-y_1=a\left(x-x_1\right)$y−y1=a(x−x1)
Find the equation of a line, in point-slope form, that passes through the point $\left(-4,3\right)$(−4,3) and has slope of $5$5.
Think: We know the slope of the line, and a point that it passes through, so we can use the point-slope formula to find the equation of the line.
Do: Substitute $a=5$a=5, $x_1=-4$x1=−4 and $y_1=3$y1=3 into the equation $y-y_1=a\left(x-x_1\right)$y−y1=a(x−x1), and rearrange to solve for $y$y.
$y-y_1$y−y1 | $=$= | $a\left(x-x_1\right)$a(x−x1) |
$y-3$y−3 | $=$= | $5\left(x-\left(-4\right)\right)$5(x−(−4)) |
$y-3$y−3 | $=$= | $5\left(x+4\right)$5(x+4) |
$y-3$y−3 | $=$= | $5x+20$5x+20 |
$y$y | $=$= | $5x+23$5x+23 |
We can also achieve the same result by substituting the known values straight into the equation $y=ax+b$y=ax+b. We can then rearrange the equation to solve for the unknown $b$b.
In the above case, we know that $a=5$a=5 and the point $\left(-4,3\right)$(−4,3) lies on the line. Substituting these values into $y=ax+b$y=ax+b gives us:
$3=5\times\left(-4\right)+b$3=5×(−4)+b
Rearranging the equation to solve for $b$b gives us:
$b=23$b=23
We now know the values of $b$b and $a$a and can substitute them into the equation $y=ax+b$y=ax+b, giving us:
$y=5x+23$y=5x+23
Consider the following graph.
State the value of the $x$x-intercept.
State the value of the $y$y-intercept.
The variables $x$x and $y$y are related, and a table of values is given below:
$x$x | $1$1 | $2$2 | $3$3 | $4$4 | $5$5 |
---|---|---|---|---|---|
$y$y | $3$3 | $6$6 | $9$9 | $12$12 | $15$15 |
What is the value of $y$y when $x=0$x=0?
Write the linear equation expressing the relationship between $x$x and $y$y.
What is the value of $y$y when $x=18$x=18?
A line passes through Point $A$A $\left(-4,2\right)$(−4,2) and has a slope of $2$2.
Find the value of the $y$y-intercept of the line, denoted by $b$b.
Hence, write the equation of the line in slope-intercept form.
A line passes through the point $A$A$\left(-4,-5\right)$(−4,−5) and has a slope of $-10$−10. Using the point-slope formula, express the equation of the line in slope intercept form.