# Equation of a straight line: $y=mx+c$â€‹â€‹

## In a nutshell

The equation $y=mx+c$ gives a straight line on a coordinate grid, where $m$ and $c$ are constants. It is the equation for almost any straight line, the exception being vertical lines, which have equations of the form $x=d$ where $d$ is a constant (the $x$-intercept). You can use a straight line graph to work out the equation of the line.

## The components of the equation $y=mx+c$

$m$â€‹ is the value of the gradient of the straight line and $c$ is the $y$-intercept. $x$ and $y$ correspond to coordinates of points on the line. For any point $(x,y)$ on the line, multiplying the $x$-coordinate by $m$ and adding $c$, gives the $y$-coordinate. If this doesn't work, then the point you are using is not actually on the line.

## Finding points on a line

If you have a straight line graph $y=mx+c$ then you will be given $m$ and $c$ to specify the line. Concurrently, $x$ and $y$ are not given as specific values, since they represent the $x$- and $y$-coordinates of *any* point on the line. If you insert an $x$-coordinate into the equation of the line, it gives the corresponding $y$-coordinate for the point on the line.

##### Example 1

*Take the line with equation *

$y=7x-9$

*What are the coordinates of the point on this line that has *$x$*-coordinate *$3$*?*

*Substitute *$x=3$* into this equation:*

$y=7x-9=7(3)-9=21-9=\underline{12}$*â€‹â€‹*

*Hence when *$x=3$* on the line, *$y=12$*. So the point *$\underline{(3,12)}$* is on the line with equation *$y=7x-9$*.*

Similarly, you can find a corresponding $x$-coordinate if given a $y$-coordinate of a point on a line. It just requires some algebraic rearranging to make $x$ the subject of the equation of the line.

##### Example 2

*Take the line with equation*

*$y=-2x+6$*

*What are the coordinates of the point on this line that has $y$-coordinate $8$â€‹?*

*Start by substituting $y=8$ into the equation:*

*$8=-2x+6$â€‹â€‹*

*Now rearrange to make *$x$* the subject:â€‹*

*$8+2x=6$*

*$2x=6-8=-2$*

*$x=\frac{-2}2=\underline{-1}$*

*Hence when $y=8$ on the line, $x=-1$. So the point $\underline{(-1,8)}$ is on the line with equation $y=-2x+6$.*

## â€‹â€‹Using a graph to solve a linear equation

If you have the graph of a linear equation, you can solve a corresponding linear equation for a given $x$- or $y$-value. Simply read off the corresponding value from the graph.

##### Example 3

*Consider the graph of $y=2x-4$*:

*Using the graph, solve the equation *

*$6=2x-4$â€‹â€‹*

*â€‹â€‹â€‹â€‹*

*The equation you have to solve is the equation of the line but with $y=6$. Hence read off the graph to find the $x$-coordinate when $y=6$. You find that the $x$-coordinate is $\underline{5}$.*