Linear equations

Equation of a line

ax + by + c = 0

A more useful form is y = mx + c, where m is the gradient of the line and c is the y-intercept.

The gradient m of a straight line can be found by choosing any two points (x_1, y_1) and (x_2, y_2) on the line and dividing the vertical displacement by the horizontal displacement:

m = \frac{\delta y}{\delta x} = \frac{y_2 - y_1}{x_2 - x_1}

The gradient m of a line is also given by \tan \theta, where \theta is the angle measured anti-clockwise to the point from the positive x-axis. The angle can be recovered from the gradient with \theta = \tan^{-1} m.

Equation of a line given a point and a gradient

To find the equation of the line passing through (1, 4) with gradient \frac{3}{2}, we substitute the values into the equation m = \frac{y_2 - y_1}{x_2 - x_1}:

\frac{3}{2} = \frac{y - 4}{x - 1}

Finally, cross-multiply and expand:

2(y - 4) = 3(x - 1) \\ -3x + 2y - 5 = 0

Equation of a line given two points

To find the equation of the line passing through two points, we first find the gradient of the line with the equation m = \frac{y_2 - y_1}{x_2 - x_1}, and then we use the previous method with a point and gradient.

Parallel and perpendicular lines

If two lines are parallel, they have the same gradient.

If two lines are perpendicular, the product of the gradients is -1 (that is, m_1 m_2 = -1). This means that m_1 = - \frac{1}{m_2}, so we can find a perpendicular gradient by negating the reciprocal of the original gradient.

Solving linear equations in two variables

For example, to find the value of x and y in the following linear equations:

\begin{aligned} 2x + 3y - 3 = 0 \\ 3x - y + 4 = 0 \\ \end{aligned}

We start by multiplying every term in one equation by a constant, in order to make the coefficients of one of the terms the same in both equations:

\begin{aligned} 6x + 9y - 9 = 0 \\ \tag{multiplied by 3} 3x - y + 4 = 0 \\ \end{aligned}

Finally, we can subtract one equation from the other and solve for y, and then substitute that value into one of the equations so that we can solve for x. If there is no valid solution (such as when subtracting one equation from the other would remove both variables), then the lines are parallel.