# The Equation of a Line

## Slope-Intercept Form

### Exercise 1

Enter a line into an empty GeoGebra-sheet by using the tool **Line through
Two Points** .

Right-click on the line in the algebra view and change the equation to the
form `y = m x + c`

.

Move the points defining the line and watch the expression for the equation of the line. The equation of the line will be shown as an equation of the form \[y=mx+c\]

for almost all lines; for what type of lines will the equation look different? Why?

### Exercise 2

The numbers `m` and `c` represent the gradient (the slope)
and the `y`-intercept of the line. If you want to vary these numbers,
you can use sliders. A slider can take on any number within a given interval.

Delete the line from the previous exercise and input two sliders
with the names `m` and `c.`

Enter the function \(y=mx+c\) in the Input bar.

Adjust `m `and `c `to display following lines:

- A line with the
`y`-intercept (0,2) and with the slope 2 - A line with the
`y`-intercept (0,1) and with the slope 0 - A line with the
`y`-intercept (0,3) and with the slope -3 - A line with the
`y`-intercept (0,-2) and with the slope 0.5

### Exercise 3

Put a trace on the line; right-click on the line and check `Trace on`

.

Explain the resulting pattern when you move the slider `m`!

Zoom in or out to "erase" the pattern of traces.

Explain the resulting pattern when you move the slider `c`!

## Slope-Point Form

Input three sliders
with the names `m, h`

and `k`

into a GeoGebra window.

Enter the function \(y=m(x-h)+k\).

Make sure that the `Grid`

is shown.

### Exercise 4

Let \(h=1\) and \(k=1\)!

Put a trace on the line and move the slider `m`

.

What point lies on all the lines regardless of `m`

?

### Exercise 5

Let \(h=3\) and \(k=-2\)!

Zoom in or out to erase the pattern of lines and then move the slider `m`

to get a new pattern.

What point lies on all the lines regardless of `m`

?

### Exercise 6

Use your conclusions from the previous exercises to make a general statement about the line \(y=m(x-h)+k\). Describe what effect each of the letters \(m\), \(h\) and \(k\) has on the line. Explain the general statement by referring to the equation of the line.

## Equation or function

The expression \(y=mx+c\) can be seen as an equation or a function.

The expression is a **function** since each value of \(x\)
assigns exactly one value of \(y\) through a rule. Vertical lines are
not functions since one \(x\)-value corresponds to infinitely many \(y\)-values.
Vertical lines can not be written in slope-intercept form.

The expression can also be seen as an **equation**. An equation
is satisfied for some values of the variables, but not satisfied for other values;
i.e. the equality is true for some values and false for other values. A point
lies on the line if and only if the `x`-coordinate and the `y`-coordinate
of the point satisfy the equation.

### You should know this

You should know how to find the equation of a line given **the gradient
and a point on the line**.

You should know how to find the equation of a line given **two points
on the line**.

Rearranging the slope-point form, you get an equation that resembles the definition
of gradient; in other words, the gradient is the change along the `y`-axes
divided by the change along the `x`-axes
\[y=m(x-h)+k\Leftrightarrow \frac{y-k}{x-h}=m \]

## General Form

Since the slope isn't defined for a vertical line, you cannot write a vertical line using the form \(y=mx+c\).

The equation of a vertical line is written as \(x=a\) where \(a\) is some number.

When using general form, you write the equation of a line as \[ax+by=c\]

where \(a\), \(b\) and \(c\) are some numbers; and where \(x\) and \(y\) are variables. A point lies on the line if and only if the equation is satisfied for the coordinates of the point, i.e. if the equality is true when substituting for the values of the \(x\)-coordinate and \(y\)-coordinate of the point.

You can write the equation of **all** lines
using the general form. For vertical lines \(b=0\).

### Exercise 7

Input three sliders
with the names `a, b `

and `c`

into a GeoGebra window.

Enter the equation \(ax+by=c\) in the Input bar.

Enter two variables `variable1=c/a`

and `variable2=c/b`

in the Input bar.

Put a trace on the line.

Move the slider `a`

. Describe what you see in detail!

Move the slider `b.`

Describe what you see in detail!

Explain your observations!

by Malin Christersson under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Sweden License