# Equations and Gradients of a straight line

Home / / Equations and Gradients of a straight line

### What is a straight line?

A straight line is a line with no curves. By definition we can say that a straight line is the set of all points between and extending beyond two points.

### Equation of a straight line

An equation of the first degree of the form $\displaystyle \text{Ax}+By+C=0$  where A,B,C are constants and x and y variables, always represents a straight line, where at least one of the A or B is not zero.
The relation between x and y satisfies all points on a curve.

### General equation of a straight line

The general equation of a straight line is $\displaystyle y=mx+c$ where m is the slope and (0,c) the coordinates of the y-intercept.

How do we find this general equation?
We need to find the m and c and then write the equation.
Finding c is easy, just need to see where the line crosses the y axis.
To find the slope you need to find the tangent of the angle that our line forms with the x-axis.
$\displaystyle m=\tan \theta$

### What is a slope?

We explained how to find the slope in a numerical value, but not what it means.The slope of a line is also called the gradient of that line.

The gradient of a line tells you how steep the line is. For every one unit moved to the right, the gradient will tell you how much the line moves up or down. It is calculated by dividing the change in the y co-ordinate by the change in the x co-ordinate.

$\displaystyle gradient(m)=\frac{{y-change}}{{x-change}}$

So another way to find the gradient is when we know two points of the line

$\displaystyle {{M}_{1}}({{x}_{1}},{{y}_{1}})$  and $\displaystyle {{M}_{2}}({{x}_{2}},{{y}_{2}})$

$\displaystyle m=\frac{{{{y}_{2}}-{{y}_{1}}}}{{{{x}_{2}}-{{x}_{1}}}}$

### Equation of a line when given the gradient and a point on the line

$\displaystyle y-{{y}_{1}}=m(x-{{x}_{1}})$
where m is the gradient and $\displaystyle (x,~{{x}_{1}})$ is the point on the line.

Don’t forget!

$\displaystyle m=\tan \theta =\frac{{{{y}_{2}}-{{y}_{1}}}}{{{{x}_{2}}-{{x}_{1}}}}$

### Equation of a line that passes through two points

$\displaystyle {{M}_{1}}({{x}_{1}},{{y}_{1}})$  and $\displaystyle {{M}_{2}}({{x}_{2}},{{y}_{2}})$

$\displaystyle y-{{y}_{1}}=\frac{{{{y}_{2}}-{{y}_{1}}}}{{{{x}_{2}}-{{x}_{1}}}}(x-{{x}_{1}})$

Where $\displaystyle m=\frac{{{{y}_{2}}-{{y}_{1}}}}{{{{x}_{2}}-{{x}_{1}}}}$

So in general we can write it as: $\displaystyle y-{{y}_{1}}=m(x-{{x}_{1}})$

Example 1: Calculate the gradient of each line and write your answer as a whole number of fraction in its lowest term.

a) We notice that our graph passes through the points (2,1) and (-1,-2).

$\displaystyle gradient(m)=\frac{{y-change}}{{x-change}}$

$\displaystyle m=\frac{{{{y}_{2}}-{{y}_{1}}}}{{{{x}_{2}}-{{x}_{1}}}}$

$\displaystyle m=\frac{{(-2)-1}}{{(-1)-2}}=\frac{{-3}}{{-3}}=1$

b) We notice that our graph passes through the points (3,0) and (0,4).
$\displaystyle m=\frac{{4-0}}{{0-3}}=\frac{4}{{-3}}=-\frac{4}{3}$

In our example we saw that our gradient may be positive or negative.

What does that mean?

If the gradient of the graph has a negative value means the graph slopes down the to the right and if it has a positive value it means it slopes up to the right. The higher the value of m, the steeper the gradient of the graph.

Example 2: Find the gradient and the y-intersect of the lines given by each of the following equations.

a) $\displaystyle y=5x+2$

b) $\displaystyle y=6-2x$

c) $\displaystyle \text{x}+y=12$

d) $\displaystyle 3x+5y=6$

Solution

a) $\displaystyle y=5x+2$

The coefficient of x is 5 so the gradient is m = 5.
The constant term is c=4 so y intersect is (0,4)

b)  $\displaystyle y=6-2x$

Rewrite the equation as $\displaystyle y=-2x+6$.
The coefficient of x is -2 so the gradient is m = -2.
The constant term is c=6 so y intersect is (0,6)

c) $\displaystyle \text{x}+y=12$
Subtracting x from both sides, so that y is the subject.

$\displaystyle x+y-x=12-x$

Rewrite the equation as $\displaystyle y=-x+12$

The coefficient of x is -1 so the gradient is m=-1

The constant term is c=12 so y intersect is (0,12)

d) $\displaystyle 3x+5y=6$

Make y the subject of the equation.

$\displaystyle 2y=-3x+6$

$\displaystyle y=\frac{{-3}}{2}x+\frac{6}{2}$

$\displaystyle y=\frac{{-3}}{2}x+3$

The coefficient of x is $\displaystyle -\frac{3}{2}$ so the gradient is m=-3/2
The constant term is c=3 so y intersect is (0,3)

Example 3: Find the equation of the line with gradient 4, passing through (4,2).

Solution

Equation of a line when given the gradient and a point on the line.

$\displaystyle y-{{y}_{1}}=m(x-{{x}_{1}})$

We know the gradient m=4 and the point $\displaystyle ({{x}_{1}},{{y}_{1}})=(4,2)$

The equation is: $\displaystyle y-2=4(x-4)$

$\displaystyle y-2=4x-16$

$\displaystyle y=4x-16+2$

$\displaystyle y=4x-14$

Example 4: Find the equation of the line which passes through the points $\displaystyle {{M}_{1}}(5,2)$and  $\displaystyle {{M}_{2}}(1,6)$. Show the y-intersect point.

Solution

We know the general equation of a line passing through two points is: $\displaystyle y-{{y}_{1}}=m(x-{{x}_{1}})$

Where the gradient is: $l\displaystyle m=\frac{{{{y}_{2}}-{{y}_{1}}}}{{{{x}_{2}}-{{x}_{1}}}}$

$\displaystyle m=\frac{{6-2}}{{1-5}}=\frac{4}{{-4}}=-1$

Substituting the gradient and one of the points we rewrite the equation.

$\displaystyle y-2=-1(x-6)$
$\displaystyle y-2=-1x+6$
$\displaystyle y-2=-x+6$
$\displaystyle y=-x+6+2$
$\displaystyle y=-x+8$
As we found at the begging the gradient is m=-1 and since the constant c=8 the y-intersect point is (0,8).