# Linear equation

Two Graphs of linear equations in two variables

In mathematics, a linear equation is an equation that may be put in the form

${\displaystyle a_{1}x_{1}+\cdots +a_{n}x_{n}+b=0,}$

where ${\displaystyle x_{1},\ldots ,x_{n}}$ are the variables (or unknowns or indeterminates), and ${\displaystyle b,a_{1},\ldots ,a_{n}}$ are the coefficients, which are often real numbers. The coefficients may be considered as parameters of the equation, and may be stated as arbitrary expressions, restricted to not contain any of the variables. To yield a meaningful equation for non-zero values of ${\displaystyle b,}$ the coefficients are required not to be all zeros. This can be formulated as

${\displaystyle a_{1}^{2}+a_{2}^{2}+\cdots +a_{n}^{2}=\textstyle \sum _{i=1}^{n}a_{i}^{2}>0.}$

In the words of algebra, a linear equation is obtained by equating to zero a linear polynomial over some field, where the coefficients are taken from, and that does not contain the symbols for the indeterminates.

The solutions of such an equation are the values that, when substituted to the unknowns, make the equality true.

The case of just one variable is of particular importance, and it is frequent that the term linear equation refers implicitly to this particular case, in which the name unknown for the variable is sensibly used.

All the pairs of numbers that are solutions of a linear equation in two variables form a line in the Euclidean plane, and every line may be defined as the solutions of a linear equation. This is the origin of the term linear for qualifying this type of equations. More generally, the solutions of a linear equation in n variables form a hyperplane (of dimension n – 1) in the Euclidean space of dimension n.

Linear equations occur frequently in all mathematics and their applications in physics and engineering, partly because non-linear systems are often well approximated by linear equations.

This article considers the case of a single equation with coefficients from the field of real numbers, for which one studies the real solutions. All its content applies for complex solutions and, more generally, for linear equations with coefficient and solutions in any field. For the case of several simultaneous linear equations, see System of linear equations.

## One variableEdit

Frequently the term linear equation refers implicitly to the case of just one variable. This case, in which the name unknown for the variable is sensibly used, is of particular importance, since it offers a unique value as solution to the equation. According to the above definition such an equation has the form

${\displaystyle ax+b=0,}$

and, for a ≠ 0, a unique value as solution

${\displaystyle x=-{\frac {b}{a}}.}$

The above equation may always be rewritten to

${\displaystyle ax=-b=b',}$

and the solution is of course the same in both cases:

${\displaystyle x={\frac {b'}{a}}=-{\frac {b}{a}}.}$

In the case of ${\displaystyle a=0}$ , two possibilities emerge:

1. ${\displaystyle b=0:}$  Every value for ${\displaystyle x}$  is a solution to the equation ${\displaystyle 0\cdot x+0=0,}$  and
2. ${\displaystyle b\neq 0:}$  There is no solution for the equation ${\displaystyle 0\cdot x+b=0,}$  the equation is said to be inconsistent.

## Two variablesEdit

In linear equations in two variables the variable names x and y are commonly used instead of indexed variable names. There are varying habits of capitalizing names, of using other letters, and also of moving constituents to the other side, without changing anything about the solutions of the equation. It is also immediately to see that one non-zero coefficient can be reduced to ${\displaystyle +1}$  by dividing both sides of the equation by the negative of the original coefficient, resulting in an other equation with the same set of solutions. These inessential variants are sometimes given generic names, like general form or standard form,[1] but contribute no new concepts.

According to the above, every linear equation in x and y may be rewritten, e.g., as

${\displaystyle ax+by+c=0,}$

or equivalently with the same set of solutions, setting ${\displaystyle A=a,\;B=b}$  and ${\displaystyle C=-c,}$  as

${\displaystyle Ax+By=C,}$

where ${\displaystyle a}$  and ${\displaystyle b}$  (resp. ${\displaystyle A}$  and ${\displaystyle B}$ ) are not both zero. All (non-zero) multiples of these equations can be considered as equivalent, for having the same set of solutions, thereby forming equivalence classess of equations. Reducing one non-zero coefficient to ${\displaystyle +1,}$  selects one specific form from each class of equations as a representative for the whole class.

Since per definition at least one coefficient of the variables is not zero, one variable can always be isolated on one side of the equation and its coefficient reduced to ${\displaystyle +1.}$  This leaves an expression on the other side that defines a function, which is either a constant or depends linearly on one variable. Evaluating this expression yields for every argument one specific value, and all the pairs of argument and value make up the set of solutions for the given equation. For example, assuming ${\displaystyle b\neq 0,}$  the equation may be resolved for ${\displaystyle y}$  and the expression on the left hand side links arguments and values of a linear function, often denoted as:

${\displaystyle y=mx+y_{0},}$

with ${\displaystyle m=-{\tfrac {a}{b}}}$  and ${\displaystyle y_{0}=-{\tfrac {c}{b}}.}$  The graph of such a linear function is thus the set of the solutions of this linear equation, which is a line in the Euclidean plane of slope ${\displaystyle m}$  and ${\displaystyle y}$ -intercept ${\displaystyle y_{0}}$ . Since a variable with a zero coefficient simply does not appear in the equation, it is also not possible to isolate this variable. In this case the function, assigning values to the other variable, is a constant. In the example above (${\displaystyle b\neq 0,\;a=0=m}$ ) this is:

${\displaystyle y=y_{0}.}$

Only when both coefficients of the variables are not zero, the equation can be solved alternatively for both variables, expressing one variable as a function of the other (see below).

Any solution of an equation in two variables is a pair of values, and the set of these solutions forms the graph of this equation. Depicting the graph of a linear equation in two variables within a Cartesian coordinate system results in a straight line, and every straight line in a Cartesian coordinate system can be represented by such an equation. If ${\displaystyle a}$  is nonzero, then the ${\displaystyle x}$ -intercept, that is the ${\displaystyle x}$ -coordinate of the point, where the line crosses the ${\displaystyle x}$ -axis (there ${\displaystyle y=0}$  holds), is ${\displaystyle -{\tfrac {c}{a}}}$ . If ${\displaystyle b}$  is nonzero, then the ${\displaystyle y}$ -intercept, that is the ${\displaystyle y}$ -coordinate of the point, where the line crosses the ${\displaystyle y}$ -axis (there ${\displaystyle x=0}$  holds), is ${\displaystyle -{\tfrac {c}{b}}.}$  Only if both ${\displaystyle a}$  and ${\displaystyle b}$  are non-zero, both intercept values exist.

Using the laws of elementary algebra, a linear equation in two variables may be rewritten in several forms, and all forms are equivalent by having the same set of solutions, and all these forms are often referred to as "equations of a line". They are adjusted to fit best to specific tasks, and are given therefore specific names, described below. In what follows, ${\displaystyle x,\;y,\;t,\;\theta }$  are the names of variables, and other letters denote constants (fixed numbers) as coefficients.

### Slope–intercept formEdit

${\displaystyle y=mx+b,}$

where m is the slope of the line and b is the y intercept, which is the y coordinate of the location where the line crosses the y axis. This can be seen by letting x = 0, which immediately gives y = b. It may be helpful to think about this in terms of y = b + mx; where the line passes through the point (0, b) and extends to the left and right at a slope of m. Vertical lines, having undefined slope, cannot be represented by this form.

A corresponding form exists for the x intercept, though it is less-used, since y is conventionally a function of x:

${\displaystyle x=ny+a.}$

Analogously, horizontal lines cannot be represented in this form. If a line is neither horizontal nor vertical, it can be expressed in both these forms, with ${\displaystyle m\cdot n=1}$ , so ${\displaystyle m=1/n}$ . Expressing y as a function of x gives the form:

${\displaystyle y=m(x-a),}$

which is equivalent to the polynomial factorization of the y intercept form. This is useful when the x intercept is of more interest than the y intercept. Expanding both forms shows that ${\displaystyle b=-ma}$ , so ${\displaystyle a=-b/m}$ , expressing the x intercept in terms of the y intercept and slope, or conversely.

### Point–slope formEdit

${\displaystyle y-y_{1}=m(x-x_{1}),\,}$

where m is the slope of the line and (x1,y1) is any point on the line.

The point-slope form expresses the fact that the difference in the y coordinate between two points on a line (that is, y − y1) is proportional to the difference in the x coordinate (that is, x − x1). The proportionality constant is m (the slope of the line).

### Two-point formEdit

${\displaystyle y-y_{1}={\frac {y_{2}-y_{1}}{x_{2}-x_{1}}}(x-x_{1}),\,}$

where (x1y1) and (x2y2) are two points on the line with x2x1. This is equivalent to the point-slope form above, where the slope is explicitly given as (y2 − y1)/(x2 − x1).

Multiplying both sides of this equation by (x2 − x1) yields a form of the line generally referred to as the symmetric form:

${\displaystyle (x_{2}-x_{1})(y-y_{1})=(y_{2}-y_{1})(x-x_{1}).\,}$

Expanding the products and regrouping the terms leads to the general form:

${\displaystyle x\,(y_{2}-y_{1})-y\,(x_{2}-x_{1})=x_{1}y_{2}-x_{2}y_{1}}$

Using a determinant, one gets a determinant form, easy to remember:

${\displaystyle {\begin{vmatrix}x&y&1\\x_{1}&y_{1}&1\\x_{2}&y_{2}&1\end{vmatrix}}=0\,.}$

### Intercept formEdit

${\displaystyle {\frac {x}{a}}+{\frac {y}{b}}=1,\,}$

where a and b must be nonzero. The graph of the equation has x-intercept a and y-intercept b. The intercept form is in standard form with A/C = 1/a and B/C = 1/b. Lines that pass through the origin or which are horizontal or vertical violate the nonzero condition on a or b and cannot be represented in this form.

### Matrix formEdit

Using the order of the standard form

${\displaystyle Ax+By=C,\,}$

one can rewrite the equation in matrix form:

${\displaystyle {\begin{pmatrix}A&B\end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}={\begin{pmatrix}C\end{pmatrix}}.}$

Further, this representation extends to systems of linear equations.

${\displaystyle A_{1}x+B_{1}y=C_{1},\,}$
${\displaystyle A_{2}x+B_{2}y=C_{2},\,}$

becomes:

${\displaystyle {\begin{pmatrix}A_{1}&B_{1}\\A_{2}&B_{2}\end{pmatrix}}{\begin{pmatrix}x\\y\end{pmatrix}}={\begin{pmatrix}C_{1}\\C_{2}\end{pmatrix}}.}$

Since this extends easily to higher dimensions, it is a common representation in linear algebra, and in computer programming. There are named methods for solving a system of linear equations, like Gauss-Jordan which can be expressed as matrix elementary row operations.

### Parametric formEdit

${\displaystyle x=Tt+U\,}$

and

${\displaystyle y=Vt+W.\,}$

These are two simultaneous equations in terms of a variable parameter t, with slope m = V / T, x-intercept (VU - WT) / V and y-intercept (WT - VU) / T. This can also be related to the two-point form, where T = p - h, U = h, V = q - k, and W = k:

${\displaystyle x=(p-h)t+h\,}$

and

${\displaystyle y=(q-k)t+k.\,}$

In this case t varies from 0 at point (h,k) to 1 at point (p,q), with values of t between 0 and 1 providing interpolation and other values of t providing extrapolation.

### 2D vector determinant formEdit

The equation of a line can also be written as the determinant of two vectors. If ${\displaystyle P_{1}}$  and ${\displaystyle P_{2}}$  are unique points on the line, then ${\displaystyle P}$  will also be a point on the line if the following is true:

${\displaystyle \det({\overrightarrow {P_{1}P}},{\overrightarrow {P_{1}P_{2}}})=0.}$

One way to understand this formula is to use the fact that the determinant of two vectors on the plane will give the area of the parallelogram they form. Therefore, if the determinant equals zero then the parallelogram has no area, and that will happen when two vectors are on the same line.

To expand on this we can say that ${\displaystyle P_{1}=(x_{1},\,y_{1})}$ , ${\displaystyle P_{2}=(x_{2},\,y_{2})}$  and ${\displaystyle P=(x,\,y)}$ . Thus ${\displaystyle {\overrightarrow {P_{1}P}}=(x-x_{1},\,y-y_{1})}$  and ${\displaystyle {\overrightarrow {P_{1}P_{2}}}=(x_{2}-x_{1},\,y_{2}-y_{1})}$ , then the above equation becomes:

${\displaystyle \det {\begin{pmatrix}x-x_{1}&y-y_{1}\\x_{2}-x_{1}&y_{2}-y_{1}\end{pmatrix}}=0.}$

Thus,

${\displaystyle (x-x_{1})(y_{2}-y_{1})-(y-y_{1})(x_{2}-x_{1})=0.}$

Ergo,

${\displaystyle (x-x_{1})(y_{2}-y_{1})=(y-y_{1})(x_{2}-x_{1}).}$

Then dividing both side by ${\displaystyle (x_{2}-x_{1})}$  would result in the “Two-point form” shown above, but leaving it here allows the equation to still be valid when ${\displaystyle x_{1}=x_{2}}$ .

### Special casesEdit

${\displaystyle y=b\,}$

Horizontal Line y = b

This is a special case of the standard form where A = 0 and B = 1, or of the slope-intercept form where the slope m = 0. The graph is a horizontal line with y-intercept equal to b. There is no x-intercept, unless b = 0, in which case the graph of the line is the x-axis, and so every real number is an x-intercept.

${\displaystyle x=a\,}$

Vertical Line x = a

This is a special case of the standard form where A = 1 and B = 0. The graph is a vertical line with x-intercept equal to a. The slope is undefined. There is no y-intercept, unless a = 0, in which case the graph of the line is the y-axis, and every real number is a y-intercept. This is the only type of straight line which is not the graph of a function (it obviously fails the vertical line test).

### Connection with linear functionsEdit

A linear equation, written in the form y = f(x) whose graph crosses the origin (x,y) = (0,0), that is, whose y-intercept is 0, has the following properties:

• Additivity: ${\displaystyle f(x_{1}+x_{2})=f(x_{1})+f(x_{2})\ }$
• Homogeneity of degree 1: ${\displaystyle f(ax)=af(x),\,}$

where a is any scalar. A function which satisfies these properties is called a linear function (or linear operator, or more generally a linear map). However, linear equations that have non-zero y-intercepts, when written in this manner, produce functions which will have neither property above and hence are not linear functions in this sense. They are known as affine functions.

### ExampleEdit

An everyday example of the use of different forms of linear equations is computation of tax with tax brackets. This is commonly done with a progressive tax computation, using either point–slope form or slope–intercept form.

## More than two variablesEdit

A linear equation can involve more than two variables. Every linear equation in n unknowns may be rewritten

${\displaystyle a_{1}x_{1}+a_{2}x_{2}+\cdots +a_{n}x_{n}=b,}$

where, a1, a2, ..., an represent numbers, called the coefficients, x1, x2, ..., xn are the unknowns, and b is called the constant term. When dealing with three or fewer variables, it is common to use x, y and z instead of x1, x2 and x3.

If all the coefficients are zero, then either b ≠ 0 and the equation does not have any solution, or b = 0 and every set of values for the unknowns is a solution.

If at least one coefficient is nonzero, a permutation of the subscripts allows one to suppose a1 ≠ 0, and rewrite the equation

${\displaystyle x_{1}={\frac {b}{a_{1}}}-{\frac {a_{2}}{a_{1}}}x_{2}-\cdots -{\frac {a_{n}}{a_{1}}}x_{n}.}$

In other words, if ai ≠ 0, one may choose arbitrary values for all the unknowns except xi, and express xi in term of these values.

If n = 3 the set of the solutions is a plane in a three-dimensional space. More generally, the set of the solutions is an (n – 1)-dimensional hyperplane in a n-dimensional Euclidean space (or affine space if the coefficients are complex numbers or belong to any field).