# Linear combination

In mathematics, a **linear combination** is an expression constructed from a set of terms by multiplying each term by a constant and adding the results (e.g. a linear combination of *x* and *y* would be any expression of the form *ax* + *by*, where *a* and *b* are constants).^{[1]}^{[2]}^{[3]}^{[4]} The concept of linear combinations is central to linear algebra and related fields of mathematics.
Most of this article deals with linear combinations in the context of a vector space over a field, with some generalizations given at the end of the article.

Let *V* be a vector space over the field *K*. As usual, we call elements of *V* *vectors* and call elements of *K* *scalars*.
If **v**_{1},...,**v**_{n} are vectors and *a*_{1},...,*a*_{n} are scalars, then the *linear combination of those vectors with those scalars as coefficients* is

There is some ambiguity in the use of the term "linear combination" as to whether it refers to the expression or to its value. In most cases the value is emphasized, as in the assertion "the set of all linear combinations of **v**_{1},...,**v**_{n} always forms a subspace". However, one could also say "two different linear combinations can have the same value" in which case the reference is to the expression. The subtle difference between these uses is the essence of the notion of linear dependence: a family *F* of vectors is linearly independent precisely if any linear combination of the vectors in *F* (as value) is uniquely so (as expression). In any case, even when viewed as expressions, all that matters about a linear combination is the coefficient of each **v**_{i}; trivial modifications such as permuting the terms or adding terms with zero coefficient do not produce distinct linear combinations.

In a given situation, *K* and *V* may be specified explicitly, or they may be obvious from context. In that case, we often speak of *a linear combination of the vectors* **v**_{1},...,**v**_{n}, with the coefficients unspecified (except that they must belong to *K*). Or, if *S* is a subset of *V*, we may speak of *a linear combination of vectors in S*, where both the coefficients and the vectors are unspecified, except that the vectors must belong to the set *S* (and the coefficients must belong to *K*). Finally, we may speak simply of *a linear combination*, where nothing is specified (except that the vectors must belong to *V* and the coefficients must belong to *K*); in this case one is probably referring to the expression, since every vector in *V* is certainly the value of some linear combination.

Note that by definition, a linear combination involves only finitely many vectors (except as described in **Generalizations** below).
However, the set *S* that the vectors are taken from (if one is mentioned) can still be infinite; each individual linear combination will only involve finitely many vectors.
Also, there is no reason that *n* cannot be zero; in that case, we declare by convention that the result of the linear combination is the zero vector in *V*.

Let the field *K* be the set **R** of real numbers, and let the vector space *V* be the Euclidean space **R**^{3}.
Consider the vectors **e**_{1} = (1,0,0), **e**_{2} = (0,1,0) and **e**_{3} = (0,0,1).
Then *any* vector in **R**^{3} is a linear combination of **e**_{1}, **e**_{2}, and **e**_{3}.

To see that this is so, take an arbitrary vector (*a*_{1},*a*_{2},*a*_{3}) in **R**^{3}, and write:

Let *K* be the set **C** of all complex numbers, and let *V* be the set C_{C}(*R*) of all continuous functions from the real line **R** to the complex plane **C**.
Consider the vectors (functions) *f* and *g* defined by *f*(*t*) := *e*^{it} and *g*(*t*) := *e*^{−it}.
(Here, *e* is the base of the natural logarithm, about 2.71828..., and *i* is the imaginary unit, a square root of −1.)
Some linear combinations of *f* and *g* are:

On the other hand, the constant function 3 is *not* a linear combination of *f* and *g*. To see this, suppose that 3 could be written as a linear combination of *e*^{it} and *e*^{−it}. This means that there would exist complex scalars *a* and *b* such that *ae*^{it} + *be*^{−it} = 3 for all real numbers *t*. Setting *t* = 0 and *t* = π gives the equations *a* + *b* = 3 and *a* + *b* = −3, and clearly this cannot happen. See Euler's identity.

Let *K* be **R**, **C**, or any field, and let *V* be the set *P* of all polynomials with coefficients taken from the field *K*.
Consider the vectors (polynomials) *p*_{1} := 1, *p*_{2} := *x* + 1, and *p*_{3} := *x*^{2} + *x* + 1.

Is the polynomial *x*^{2} − 1 a linear combination of *p*_{1}, *p*_{2}, and *p*_{3}?
To find out, consider an arbitrary linear combination of these vectors and try to see when it equals the desired vector *x*^{2} − 1.
Picking arbitrary coefficients *a*_{1}, *a*_{2}, and *a*_{3}, we want

Two polynomials are equal if and only if their corresponding coefficients are equal, so we can conclude

This system of linear equations can easily be solved.
First, the first equation simply says that *a*_{3} is 1.
Knowing that, we can solve the second equation for *a*_{2}, which comes out to −1.
Finally, the last equation tells us that *a*_{1} is also −1.
Therefore, the only possible way to get a linear combination is with these coefficients.
Indeed,

On the other hand, what about the polynomial *x*^{3} − 1? If we try to make this vector a linear combination of *p*_{1}, *p*_{2}, and *p*_{3}, then following the same process as before, we get the equation

However, when we set corresponding coefficients equal in this case, the equation for *x*^{3} is

which is always false.
Therefore, there is no way for this to work, and *x*^{3} − 1 is *not* a linear combination of *p*_{1}, *p*_{2}, and *p*_{3}.

For some sets of vectors **v**_{1},...,**v**_{n},
a single vector can be written in two different ways as a linear combination of them:

If that is possible, then **v**_{1},...,**v**_{n} are called *linearly dependent*; otherwise, they are *linearly independent*.
Similarly, we can speak of linear dependence or independence of an arbitrary set *S* of vectors.

If *S* is linearly independent and the span of *S* equals *V*, then *S* is a basis for *V*.

By restricting the coefficients used in linear combinations, one can define the related concepts of affine combination, conical combination, and convex combination, and the associated notions of sets closed under these operations.

Because these are more *restricted* operations, more subsets will be closed under them, so affine subsets, convex cones, and convex sets are *generalizations* of vector subspaces: a vector subspace is also an affine subspace, a convex cone, and a convex set, but a convex set need not be a vector subspace, affine, or a convex cone.

These concepts often arise when one can take certain linear combinations of objects, but not any: for example, probability distributions are closed under convex combination (they form a convex set), but not conical or affine combinations (or linear), and positive measures are closed under conical combination but not affine or linear – hence one defines signed measures as the linear closure.

Linear and affine combinations can be defined over any field (or ring), but conical and convex combination require a notion of "positive", and hence can only be defined over an ordered field (or ordered ring), generally the real numbers.

If one allows only scalar multiplication, not addition, one obtains a (not necessarily convex) cone; one often restricts the definition to only allowing multiplication by positive scalars.

All of these concepts are usually defined as subsets of an ambient vector space (except for affine spaces, which are also considered as "vector spaces forgetting the origin"), rather than being axiomatized independently.

From this point of view, we can think of linear combinations as the most general sort of operation on a vector space – saying that a vector space is an algebra over the operad of linear combinations is precisely the statement that *all possible* algebraic operations in a vector space are linear combinations.

The basic operations of addition and scalar multiplication, together with the existence of an additive identity and additive inverses, cannot be combined in any more complicated way than the generic linear combination: the basic operations are a generating set for the operad of all linear combinations.

Ultimately, this fact lies at the heart of the usefulness of linear combinations in the study of vector spaces.

If *V* is a topological vector space, then there may be a way to make sense of certain *infinite* linear combinations, using the topology of *V*.
For example, we might be able to speak of *a*_{1}**v**_{1} + *a*_{2}**v**_{2} + *a*_{3}**v**_{3} + ⋯, going on forever.
Such infinite linear combinations do not always make sense; we call them *convergent* when they do.
Allowing more linear combinations in this case can also lead to a different concept of span, linear independence, and basis.
The articles on the various flavors of topological vector spaces go into more detail about these.

If *K* is a commutative ring instead of a field, then everything that has been said above about linear combinations generalizes to this case without change.
The only difference is that we call spaces like this *V* modules instead of vector spaces.
If *K* is a noncommutative ring, then the concept still generalizes, with one caveat:
Since modules over noncommutative rings come in left and right versions, our linear combinations may also come in either of these versions, whatever is appropriate for the given module.
This is simply a matter of doing scalar multiplication on the correct side.

A more complicated twist comes when *V* is a bimodule over two rings, *K*_{L} and *K*_{R}.
In that case, the most general linear combination looks like

where *a*_{1},...,*a*_{n} belong to *K*_{L}, *b*_{1},...,*b*_{n} belong to *K*_{R}, and **v**_{1},…,**v**_{n} belong to *V*.

An important application of linear combinations is to wave functions in quantum mechanics.