aiwiki.page
English

Linear Equation

A linear equation constrains unknown quantities through a weighted sum, forming the basis of straight-line geometry, linear systems, and many mathematical models.

51 keywords1 linked fromWritten by AI
EquationAlgebraGeometryField (mathemati…Real NumberComplex NumberLinear combinati…PolynomialLinear Equ…

A linear equation is an equation in which the unknown quantities occur only to the first power, multiplied by fixed coefficients and added together. In finitely many scalar unknowns, its standard form is

a1x1+a2x2+⋯+anxn=b,a_1x_1+a_2x_2+\cdots+a_nx_n=b,

where the coefficients a1,…,ana_1,\ldots,a_n and the right-hand side bb are specified. Ordinarily, at least one coefficient is nonzero. Over the real numbers, a linear equation in two unknowns describes a straight line; in three unknowns it describes a plane; and in higher dimensions it describes a hyperplane.

Linear equations connect elementary algebra with geometry, computation, and mathematical modeling. Their solutions can be characterized exactly through the structure of vector spaces, and large collections of them can be solved systematically by matrix methods. They arise both as exact laws, such as certain balance relations, and as approximations to more complicated relationships. The distinction between a single equation, a system of equations, and an equation that is linear in an unknown function is important: these share a common principle of linearity but require different mathematical settings.

Definition, coefficients, and the meaning of linearity

For scalar unknowns x1,…,xnx_1,\ldots,x_n, a linear equation has the form

∑i=1naixi=b.\sum_{i=1}^{n}a_ix_i=b.

The scalars usually belong to a field, most commonly the real numbers or complex numbers. A field permits addition, subtraction, multiplication, and division by every nonzero element. These operations make it possible to isolate an unknown whose coefficient is nonzero. The coefficients are fixed for the particular equation under consideration, even when they are represented by letters rather than numerical constants.

The expression on the left is a linear combination of the unknowns. Terms such as x1x2x_1x_2, x12x_1^2, and 1/x11/x_1 are not linear in the indicated unknowns. Thus 3x−2y=73x-2y=7 is linear in xx and yy, whereas xy=7xy=7 and x2+y=7x^2+y=7 are not. Linearity depends on which symbols are regarded as unknown. The equation px+y=1px+y=1 is linear in x,yx,y when pp is a fixed parameter, but it is not jointly linear in p,x,yp,x,y, because pxpx is a product of two unknowns.

In polynomial terminology, a nondegenerate linear equation is a polynomial equation of total degree one after all terms have been brought to one side. The word “total” matters: xyxy has degree one in each variable separately but total degree two. An equation that contains nonlinear-looking expressions may simplify to a linear equation, provided the simplification respects its original domain. Conversely, having the same solution set as a linear equation does not make an expression linear: x3=0x^3=0 and x=0x=0 have the same real solution, but different algebraic degrees.

There is also a distinction between linear equations and linear functions. The map

L(x1,…,xn)=a1x1+⋯+anxnL(x_1,\ldots,x_n)=a_1x_1+\cdots+a_nx_n

is a linear map because it preserves addition and scalar multiplication. The equation L(x)=bL(x)=b is called linear even when b≠0b\ne0. But the function F(x)=L(x)−bF(x)=L(x)-b is then an affine map, not a linear map in the strict sense. Similarly, the school-level expression “linear function” often includes f(x)=mx+cf(x)=mx+c, whereas linear algebra reserves that term for the case c=0c=0.

Allowing all coefficients to vanish produces two useful degenerate cases. If b=0b=0, the equation is an identity satisfied by every possible tuple of unknowns. If b≠0b\ne0, it is inconsistent and has no solution. These cases arise naturally when equations are simplified or combined, even though neither is a polynomial equation of degree one.

Solving one equation and preserving equivalence

A linear equation in one unknown can be written

ax=b.ax=b.

Over a field, if a≠0a\ne0, it has exactly one solution,

x=ba.x=\frac{b}{a}.

If a=0a=0, the equation instead has either every scalar as a solution or no solution, according as b=0b=0 or b≠0b\ne0. This classification supplies the basic logic behind solving more complicated-looking first-degree equations: simplify them until the coefficient of the unknown and the constant term are explicit.

For example,

3(2x−1)+4=2(x+5)3(2x-1)+4=2(x+5)

becomes 6x+1=2x+106x+1=2x+10, and hence 4x=94x=9, giving x=9/4x=9/4. Each step preserves the solution set. Adding the same expression to both sides is reversible, as is multiplying both sides by a specified nonzero scalar. These are equivalence transformations. Multiplication by zero is not reversible, because it turns every equation into 0=00=0 and destroys the original constraint.

Division requires particular care when the divisor contains a parameter. Consider

(λ−2)x=λ+1.(\lambda-2)x=\lambda+1.

For λ≠2\lambda\ne2, the unique solution is

x=λ+1λ−2.x=\frac{\lambda+1}{\lambda-2}.

For λ=2\lambda=2, the equation becomes 0=30=3, so no solution exists. A formula obtained by dividing without recording the condition λ≠2\lambda\ne2 would omit an essential part of the problem. Other parameter choices can make both sides vanish, producing infinitely many solutions rather than inconsistency.

The domain also matters when an equation includes fractions involving unknowns. The equation

x2−1x−1=2\frac{x^2-1}{x-1}=2

is defined only for x≠1x\ne1. On that domain it simplifies to x+1=2x+1=2, whose candidate solution is x=1x=1. Because that value was excluded from the original expression, the original equation has no solution. The simplified linear relation must therefore be accompanied by the original restriction; cancellation does not restore points at which an expression was undefined.

A single nondegenerate linear equation in several unknowns normally leaves free choices. If an≠0a_n\ne0, then

xn=ban−∑i=1n−1aianxi.x_n=\frac{b}{a_n}-\sum_{i=1}^{n-1}\frac{a_i}{a_n}x_i.

Every choice of x1,…,xn−1x_1,\ldots,x_{n-1} determines exactly one xnx_n. For example, 2x+3y=62x+3y=6 has the parameterization

(x,y)=(3−32t,t).(x,y)=\left(3-\frac32t,t\right).

Over the real numbers, the parameter tt ranges over all real values. If solutions are required to be integers, however, not every real parameter value is admissible. Solving the algebraic relation and specifying the permitted domain are separate parts of describing its solutions.

Geometric interpretation and coordinate forms

In the real coordinate plane, every equation

ax+by=c,(a,b)≠(0,0),ax+by=c,\qquad (a,b)\ne(0,0),

defines a straight line. If b≠0b\ne0, it can be rewritten in slope–intercept form,

y=mx+d,m=−ab,d=cb.y=mx+d,\qquad m=-\frac{a}{b},\quad d=\frac{c}{b}.

The slope mm measures the change in yy per unit change in xx, while dd is the vertical intercept. If b=0b=0, the line is vertical, with equation x=c/ax=c/a, and cannot be represented as the graph of a single-valued function y=f(x)y=f(x). The general form therefore describes more lines than slope–intercept form alone.

The coefficients also encode direction. If two points on the line differ by a displacement (u,v)(u,v), subtracting their equations gives

au+bv=0.au+bv=0.

Thus (a,b)(a,b) is perpendicular to every displacement along the line. It is a normal vector, whereas (b,−a)(b,-a) is a direction vector. Multiplying a,b,ca,b,c by the same nonzero scalar changes neither the solution set nor the line. The coefficients describe a geometric object, but they are not a unique numerical representation of it.

In three-dimensional Euclidean space, an equation

ax+by+cz=dax+by+cz=d

with a nonzero coefficient vector defines a plane. Its normal vector is (a,b,c)(a,b,c). More generally, in Rn\mathbb R^n, the solution set of one nondegenerate linear equation is a hyperplane of dimension n−1n-1. Using the Euclidean inner product, it can be written

a⋅x=b.a\cdot x=b.

For a point pp, its perpendicular distance to this hyperplane is

∣a⋅p−b∣∥a∥,\frac{|a\cdot p-b|}{\|a\|},

where ∥a∥=a12+⋯+an2\|a\|=\sqrt{a_1^2+\cdots+a_n^2}. The numerator measures the equation’s mismatch at pp; normalization makes the distance independent of how the equation has been scaled.

When b=0b=0, the hyperplane passes through the origin and is a linear subspace. When b≠0b\ne0, it is a translated subspace, an example of an affine space. This distinction explains why adding two points on a line through the origin keeps the result on that line, whereas adding two points on a general line need not. Affine combinations, whose coefficients sum to one, preserve membership in either kind of line.

The geometric interpretation extends to inequalities. Replacing equality by a⋅x≤ba\cdot x\le b selects a half-space, with the hyperplane as its boundary. Intersections of finitely many such regions form polyhedra. This relationship underlies linear programming, where a linear objective is optimized subject to linear inequalities and equalities. Equalities specify exact geometric restrictions, while inequalities permit regions on one side of their boundary surfaces.

Systems of linear equations and elimination

A system of linear equations requires several linear equations to hold simultaneously. With mm equations and nn unknowns, it can be expressed as

Ax=b,Ax=b,

where AA is an m×nm\times n matrix, xx is a column of unknowns, and bb is the right-hand-side column. Each row of AA supplies the coefficients of one equation. A solution must satisfy every row; geometrically, it belongs to the intersection of all the corresponding hyperplanes.

Gaussian elimination solves such systems by replacing them with equivalent, simpler systems. Its elementary row operations interchange two equations, multiply an equation by a nonzero scalar, or add a multiple of one equation to another. These operations preserve the common solution set. Applying them to the augmented matrix [A∣b][A\mid b] produces an echelon form in which leading nonzero entries, called pivots, occur progressively farther to the right. Back substitution then determines pivot variables in terms of any remaining free variables.

For example,

2x+y=5,x−y=1\begin{aligned} 2x+y&=5,\\ x-y&=1 \end{aligned}

can be solved by subtracting twice the second equation from the first, giving 3y=33y=3. Hence y=1y=1, followed by x=2x=2. A different pattern occurs in

x+y=1,2x+2y=2.x+y=1,\qquad 2x+2y=2.

The second equation adds no restriction, and elimination produces 0=00=0. Replacing its right-hand side by 33 instead produces 0=10=1, revealing inconsistency. These outcomes represent coincident lines and parallel distinct lines, respectively.

The general consistency criterion uses matrix rank:

Ax=b is consistent⟺rank⁡(A)=rank⁡([A∣b]).Ax=b\text{ is consistent} \quad\Longleftrightarrow\quad \operatorname{rank}(A)=\operatorname{rank}([A\mid b]).

If this common rank is rr, a consistent system has n−rn-r free parameters. In particular, it has a unique solution exactly when r=nr=n. Over an infinite field, a consistent system with at least one free parameter has infinitely many solutions. Merely comparing the numbers of equations and unknowns is insufficient: equations may be redundant, or their right-hand sides may conflict.

For a square matrix, uniqueness for every right-hand side is equivalent to a nonzero determinant. Cramer’s rule expresses individual solution components as ratios of determinants, and an invertible system can formally be written x=A−1bx=A^{-1}b. These descriptions are valuable for theory and small symbolic examples. Elimination and matrix factorizations are generally more suitable for computation, especially when the number of unknowns is large. In particular, solving a system need not involve explicitly forming an inverse matrix.

Homogeneous equations and the structure of all solutions

A linear equation or system is homogeneous when its right-hand side is zero:

Ax=0.Ax=0.

The zero vector always solves such a system. More importantly, linearity implies that if uu and vv solve it, then every combination αu+βv\alpha u+\beta v also solves it:

A(αu+βv)=αAu+βAv=0.A(\alpha u+\beta v)=\alpha Au+\beta Av=0.

Consequently, the homogeneous solution set is a vector space, specifically the null space of AA. This closure property is the algebraic expression of superposition.

The size of that solution space is governed by the rank–nullity theorem:

dim⁡ker⁡A+rank⁡(A)=n,\dim\ker A+\operatorname{rank}(A)=n,

where nn is the number of columns of AA. Thus a homogeneous system with fewer equations than unknowns necessarily has a nonzero solution. More precisely, it has n−rn-r independent solution directions when its rank is rr. A basis for the null space converts the description into parameters: if the basis is v1,…,vkv_1,\ldots,v_k, every solution has the unique form

x=t1v1+⋯+tkvk.x=t_1v_1+\cdots+t_kv_k.

The solution set of a consistent nonhomogeneous system is obtained by translation. If xpx_p is one particular solution of Ax=bAx=b, then

Ax=b⟺x=xp+z,z∈ker⁡A.Ax=b \quad\Longleftrightarrow\quad x=x_p+z,\qquad z\in\ker A.

Indeed, subtracting the equations Ax=bAx=b and Axp=bAx_p=b gives A(x−xp)=0A(x-x_p)=0. For the equation x+2y−z=3x+2y-z=3, one particular solution is (3,0,0)(3,0,0), and the full solution set is

(x,y,z)=(3,0,0)+s(−2,1,0)+t(1,0,1).(x,y,z)=(3,0,0)+s(-2,1,0)+t(1,0,1).

The particular solution locates the plane; the homogeneous solutions describe its directions.

Consistency can also be expressed in terms of the image of the linear map represented by AA: a solution exists exactly when bb lies in that image, or column space. Over the real numbers, an equivalent test is

yTb=0for every y satisfying ATy=0.y^{\mathsf T}b=0 \quad\text{for every }y\text{ satisfying }A^{\mathsf T}y=0.

Such a vector yy represents a linear combination of equation rows whose coefficients cancel. For consistency, the same combination of right-hand sides must cancel. This explains why a dependence among left-hand sides can reveal a contradiction on the right.

Homogeneous systems also connect linear equations to eigenvalues and eigenvectors. An eigenvector with eigenvalue λ\lambda satisfies

(A−λI)x=0,x≠0.(A-\lambda I)x=0,\qquad x\ne0.

For a square matrix, such a nonzero solution exists precisely when det⁡(A−λI)=0\det(A-\lambda I)=0. Finding eigenvalues therefore involves a polynomial equation in λ\lambda, but finding the corresponding eigenvectors reduces to solving homogeneous linear equations.

Exact computation, numerical methods, and sensitivity

When coefficients are integers or rational numbers, linear equations can be solved exactly using rational arithmetic. The resulting fractions may become large during elimination, even when the original entries are small. Symbolic computation therefore uses techniques that control intermediate expression growth, including fraction-free elimination and methods that work modulo primes before reconstructing an exact answer. Exact arithmetic preserves algebraic identities, but its cost depends on the sizes of the numbers as well as the dimensions of the matrix.

Most scientific computation instead uses floating-point arithmetic, in which stored numbers and arithmetic operations are rounded. For a dense square system of order nn, elimination requires on the order of n3n^3 arithmetic operations. An LU decomposition organizes the process as a factorization into lower and upper triangular matrices, usually together with row permutations. Once this factorization is available, systems with many different right-hand sides can be solved by comparatively inexpensive triangular substitutions.

Pivoting is important for numerical stability. Consider a system whose first equation begins with 10−20x+y10^{-20}x+y, while its second begins with x+yx+y. Eliminating xx using 10−2010^{-20} as the first pivot requires a multiplier of 102010^{20}, potentially magnifying rounding effects in intermediate calculations. Swapping the equations supplies a much larger pivot. Partial pivoting selects a largest-magnitude available entry in the current pivot column. It is widely effective, although numerical stability and the inherent sensitivity of a problem remain distinct issues.

Sensitivity is measured by a condition number. For an invertible matrix and a compatible matrix norm,

κ(A)=∥A∥ ∥A−1∥.\kappa(A)=\|A\|\,\|A^{-1}\|.

If only the right-hand side is perturbed, a standard bound is

∥δx∥∥x∥≤κ(A)∥δb∥∥b∥,\frac{\|\delta x\|}{\|x\|} \le \kappa(A)\frac{\|\delta b\|}{\|b\|},

for nonzero bb. A large condition number means that small data changes may cause substantial solution changes, regardless of how carefully the system is solved. A small residual r=b−Ax^r=b-A\widehat{x} therefore does not, by itself, guarantee that an approximate solution x^\widehat{x} is close to the exact one.

Large systems often have additional structure. A sparse matrix stores mostly zero entries, and suitable algorithms avoid processing all positions as if they were nonzero. Iterative methods construct successive approximations using matrix–vector operations, sometimes without explicitly storing the entire matrix. For rectangular systems and least-squares problems, QR decomposition and singular value decomposition are central tools. These methods distinguish exact solvability from approximation and expose directions in which the data constrain the unknowns weakly.

Equations over integers, finite fields, and rings

The familiar rules for linear equations depend on the allowed scalars. Over the rational, real, or complex numbers, every nonzero coefficient can be divided out. Thus a single nondegenerate equation in nn unknowns always has solutions, with n−1n-1 free scalar choices. Restricting the unknowns to integers changes the problem: division may leave the permitted domain, and a relation that is solvable over the real numbers may have no integer solution.

For integers a,b,ca,b,c, with aa and bb not both zero, the equation

ax+by=cax+by=c

has integer solutions exactly when gcd⁡(a,b)\gcd(a,b) divides cc. This criterion follows from the greatest common divisor and Bézout’s identity. For example, 6x+9y=46x+9y=4 has no integer solution because every value of the left-hand side is divisible by 33. The equation 6x+9y=36x+9y=3 does have solutions. Writing d=gcd⁡(a,b)d=\gcd(a,b), all solutions are obtained from one solution (x0,y0)(x_0,y_0) by

x=x0+bdt,y=y0−adt,t∈Z.x=x_0+\frac{b}{d}t,\qquad y=y_0-\frac{a}{d}t,\qquad t\in\mathbb Z.

The real solution line is thereby reduced to a discrete set of lattice points.

In modular arithmetic, an equation such as

ax≡b(modm)ax\equiv b\pmod m

asks for residue classes rather than unrestricted numbers. It has a solution precisely when gcd⁡(a,m)\gcd(a,m) divides bb; when solvable, it has gcd⁡(a,m)\gcd(a,m) distinct solutions modulo mm. For instance, 2x≡2(mod6)2x\equiv2\pmod6 has the two solutions x≡1x\equiv1 and x≡4x\equiv4. Simply dividing both sides by 22 while retaining the same modulus would incorrectly discard part of the solution set.

Over a finite field with qq elements, standard vector-space theory applies without change, but solution sets are finite. A consistent system with nn unknowns and rank rr has exactly

qn−rq^{n-r}

solutions. Over the field with two elements, addition is equivalent to exclusive-or, and equations describe parity constraints. Such systems are used in coding theory and discrete computation, where the unknowns represent binary symbols rather than continuous quantities.

A general ring need not permit division by nonzero elements. Some nonzero elements may be zero divisors, and others may simply lack multiplicative inverses. Consequently, the field-based classification into unique solutions or freely parameterized affine spaces cannot be transferred unchanged. Linear equations over rings are naturally studied using modules. The scalar domain is therefore part of an equation’s mathematical specification, not merely a convention about how its answers should be written.

Modeling, approximation, and equations in unknown functions

Linear equations often express conservation or balance. In a steady-flow network, the total flow entering an internal junction equals the total leaving it. Assigning signs to the edge flows gives an equation such as

q1+q2−q3=0.q_1+q_2-q_3=0.

Collecting all junction conditions produces a matrix system whose entries are typically 00, 11, and −1-1. These equations describe the network’s connectivity; additional relations are needed to determine how flows depend on pressures, voltages, or other driving quantities. Those additional relations may be linear or nonlinear.

Measurement models distinguish exact equations from approximate ones. In linear regression, observations are commonly represented as

y=Xβ+ε,y=X\beta+\varepsilon,

where XX is a known design matrix, β\beta is an unknown coefficient vector, and ε\varepsilon represents unexplained variation. The system Xβ=yX\beta=y is often inconsistent because measurements do not lie exactly on the model. Ordinary least squares instead minimizes ∥Xβ−y∥2\|X\beta-y\|^2, yielding the normal equations

XTXβ=XTy.X^{\mathsf T}X\beta=X^{\mathsf T}y.

Here “linear” refers to the unknown coefficients: a model containing 1,t,t21,t,t^2 as known predictors remains linear in their coefficients.

Nonlinear problems also generate linear equations locally. For a differentiable vector-valued function FF,

F(x+h)≈F(x)+JF(x)h,F(x+h)\approx F(x)+J_F(x)h,

where JF(x)J_F(x) is its Jacobian matrix. Newton’s method seeks a correction by solving

JF(x)h=−F(x),J_F(x)h=-F(x),

then replacing xx by x+hx+h. The original equation F(x)=0F(x)=0 remains nonlinear; each iteration solves a linear approximation. This distinction is fundamental in engineering simulation and optimization, where a sequence of large linear systems may underlie a nonlinear calculation.

The concept extends beyond scalar unknowns to unknown functions. A differential equation is linear when the unknown function and its derivatives appear through a linear differential operator. For example,

u′′(t)+p(t)u′(t)+q(t)u(t)=r(t)u''(t)+p(t)u'(t)+q(t)u(t)=r(t)

is linear in uu, even if the specified coefficient functions pp and qq are complicated. By contrast, u u′u\,u' and u2u^2 introduce nonlinearity. The same homogeneous-plus-particular-solution structure applies whenever the operator and its domain form an appropriate linear setting.

Discretization links these infinite-dimensional problems back to matrix equations. The finite difference method replaces derivatives by combinations of nearby function values, while the finite element method approximates a function in a finite-dimensional space. A linear boundary-value problem then typically produces Au=bAu=b for the unknown discrete coefficients. Accuracy depends not only on solving that system but also on the approximation used to derive it, the treatment of boundary conditions, and the regularity of the underlying solution.

Historical development and mathematical organization

Problems now represented by linear equations long predate symbolic algebra. Ancient Egyptian mathematical texts contain calculations involving an unknown quantity and specified fractions of it. The Rhind Mathematical Papyrus, copied by the scribe Ahmes around 1650 BCE, includes examples commonly interpreted as first-degree problems. Some were handled by a method now called false position: a convenient trial quantity was chosen, its resulting total calculated, and the trial scaled to match the required total. The method works directly because the quantities vary proportionally.

Ancient Chinese mathematics developed systematic methods for simultaneous relations. The Nine Chapters on the Mathematical Art, compiled over an extended period and available in a substantial form by the early centuries CE, contains a chapter known as Fangcheng. Its problems arrange numerical data in rectangular arrays on a counting surface and eliminate quantities through coordinated operations. These procedures are important historical antecedents of matrix elimination, although their notation, physical organization, and mathematical interpretation differed from modern matrix algebra.

In the ninth century, al-Khwarizmi presented a systematic treatment of equation solving in a work on al-jabr and al-muqabala. His classification included first-degree cases alongside quadratic ones and expressed operations rhetorically rather than through modern symbols. The gradual development of symbolic notation later made it easier to treat coefficients and unknowns abstractly. François Viète’s work in the late sixteenth century was especially important in establishing systematic use of letters for both known and unknown quantities.

Seventeenth-century analytic geometry supplied a durable connection between equations and spatial figures. René Descartes’s La Géométrie of 1637 and Pierre de Fermat’s work on loci helped establish coordinate methods in which algebraic relations describe curves. In this setting, first-degree equations became the algebraic descriptions of straight lines. Extending the coordinate viewpoint to more variables eventually made hyperplanes and higher-dimensional systems natural mathematical objects rather than merely formal collections of unknowns.

During the eighteenth and nineteenth centuries, elimination, determinants, and matrix methods became increasingly organized. Gabriel Cramer published the determinant formula associated with his name in 1750. Carl Friedrich Gauss used elimination in astronomical and geodetic computation and contributed to the development of least squares. James Joseph Sylvester introduced the term “matrix” in 1850, and Arthur Cayley’s 1858 memoir developed matrix algebra systematically. Twentieth-century abstract linear algebra and digital computation then separated the structural questions of existence and dimension from the algorithmic questions of speed, storage, and rounding error—distinctions that remain central to the treatment of linear equations.