In mathematics, **linear combinations** are a concept 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 generalisations given at the end of the article.

DefinitionSuppose thatKis a field andVis a vector space overK. As usual, we call elements ofVvectorssand call elements ofKscalars. Ifv_{1},...,v_{n}are vectors anda_{1},...,a_{n}are scalars, then thelinear combination of those vectors with those scalars as coefficientsis

a_{1}v_{1}+a_{2}v_{2}+a_{3}v_{3}+ ... +a_{n}v_{n}.

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*, where both the coefficients and the vectors are unspecified, except that the vectors must belong to the set

`S``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`).

Note that you can only take a linear combination of finitely many vectors (except as described in **Generalisations** below); that is, the number `n` may be finite.
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's no reason that the finite number `n` can't be zero; in that case, we declare by convention that the result of the linear combination is the zero vector in `V`.

### Examples and counterexamples

#### 1: Examples related to analytic geometry

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:

- (
`a`_{1},`a`_{2},`a`_{3}) = (`a`_{1},0,0) + (0,`a`_{2},0) + (0,0,`a`_{3}) =`a`_{1}(1,0,0) +`a`_{2}(0,1,0) +`a`_{3}(0,0,1) =`a`_{1}`e`_{1}+`a`_{2}`e`_{2}+`a`_{3}`e`_{3}.

#### 2: Examples related to functional analysis

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:

- cos
`t`= (1/2)`e`^{it}+ (1/2)`e`^{−it}; - 2 sin
`t`= (−`i`)`e`^{it}+ (`i`)`e`^{−it}.

*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.

#### 3: Examples related to algebraic geometry

Multiplying the polynomials out, this means- (
`a`_{1}) + (`a`_{2}`x`+`a`_{2}) + (`a`_{3}`x`^{2}+`a`_{3}`x`+`a`_{3}) =`x`^{2}− 1,

`x`, we get

`a`_{3}`x`^{2}+ (`a`_{2}+`a`_{3})`x`+ (`a`_{1}+`a`_{2}+`a`_{3}) = 1`x`^{2}+ 0`x`+ (−1).

`a`_{3}= 1,`a`_{2}+`a`_{3}= 0,`a`_{1}+`a`_{2}+`a`_{3}= −1.

`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,

`x`^{2}− 1 = −1 − (`x`+ 1) + (`x`^{2}+`x`+ 1) = −`p`_{1}−`p`_{2}+`p`_{3},

`x`

^{2}− 1

*is*a linear combination of

`p`

_{1},

`p`

_{2}, and

`p`

_{3}.

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'll get the equation

- 0
`x`^{3}+`a`_{3}`x`^{2}+ (`a`_{2}+`a`_{3})`x`+ (`a`_{1}+`a`_{2}+`a`_{3}) = 1`x`^{3}+ 0`x`^{2}+ 0`x`+ (−1).

`x`

^{3}is

- 0 = 1,

`x`

^{3}− 1 is

*not*a linear combination of

`p`

_{1},

`p`

_{2}, and

`p`

_{3}.

### The linear span

Take an arbitrary field `K`, an arbitrary vector space `V`, and let `v`_{1},...,`v`_{n} be vectors (in `V`).
It is interesting to consider the set of *all* linear combinations of these vectors.
This set is called the *linear span* (or just *span*) of the vectors, say S ={`v`_{1},...,`v`_{n}}. We write the span of S as span(S) or sp(S):

- Sp(
`v`_{1},...,`v`_{n}) := {`a`_{1}`v`_{1}+ ... +`a`_{n}`v`_{n}:`a`_{1},...,`a`_{n}∈`K`}.

**Theorem 1:**
Sp(`v`_{1},...,`v`_{n}) is a subspace of `V`.
Furthermore, this span is the smallest subspace of `V` that the vectors `v`_{1},...,`v`_{n} all belong to.

This fact (which is proved later in this section) is one reason why the span is important.

Now let `S` be a subset of the vector space `V`.
The *linear span* of `S` consists of all linear combinations of elements of `S`.
In symbols,

- Sp(
`S`) = {`a`_{1}`v`_{1}+ ... +`a`_{k}`v`_{k}:`k`∈**N**,`a`_{1},...,`a`_{k}∈`K`,`v`_{1},...,`v`_{k}∈`S`},

**N**is the set of natural numbers (including zero). Notice that this time the number of vectors involved in the linear combination can vary, from zero on up, but it must still be finite each time.

**Theorem 2:**
Sp(`S`) is also a subspace of `V`.
Furthermore, this span is the smallest subspace of `V` that is a superset of `S`.

The rest of this section is a proof of Theorem 1. Theorem 2 is very similar, but it's a bit messier to write down, since the vectors involved in any given linear combination can vary.

*Proof of Theorem 1:*

Property 1:

The most general possible two elements of the span are `x` := `a`_{1}`v`_{1} + ... + `a`_{n}`v`_{n} and `y` := `b`_{1}`v`_{1} + ... + `b`_{n}`v`_{n}.
We have to show that `x` + `y` is also a linear combination.
By using associativity and commutativity of addition and the distributive law, we can write

`x`+`y`= (`a`_{1}+`b`_{1})`v`_{1}+ ... + (`a`_{n}+`b`_{n})`v`_{n},

`a`

_{i}+

`b`

_{i}is a scalar for every

`i`, we see that

`x`+

`y`is indeed a linear combination of the given vectors.

Property 2:

Let `c` be a scalar and again take `x` := `a`_{1}`v`_{1} + ... + `a`_{n}`v`_{n}.
We have to show that `c``x` is also a linear combination.
Now,

`c``x`= (`c``a`_{1})`v`_{1}+ ... + (`c``a`_{n})`v`_{n},

`c`

`a`

_{i}is a scalar for every

`i`, we are done.

Property 3:

The zero element 0_{V} of `V` is a linear combination because we can write

- 0
_{V}= 0_{K}`v`_{1}+ 0_{K}`v`_{2}+ ... + 0_{K}`v`_{n}.

_{K}is the zero element of the field

`K`.) This equation is true because in every vector space we have 0

_{K}

`v`= 0

_{V}.

Minimality:

Suppose `W` is another subspace of `V` which contains the vectors `v`_{1},...,`v`_{n}.
Then `W` is closed under scalar multiplication and addition of vectors, so we can prove by mathematical induction that `a`_{1}`v`_{1} + ... + `a`_{n}`v`_{n} is an element of `W` for any scalars `a`_{1},...,`a`_{n}.
Thus, sp(`v`_{1},...,`v`_{n}), the set of all such linear combinations, is a subset of `W`.

### Other related concepts

Sometimes, some single vector can be written in two different ways as a linear combination of `v`_{1},...,`v`_{n}.
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`.

We can think of linear combinations as the most general sort of operation on a vector space. The basic operations of addition and scalar multiplication, together with the existence of an additive identity and additive inverses, can't be combined in any more complicated way than the generic linear combination. Ultimately, this fact lies at the heart of the usefulness of linear combinations in the study of vector spaces.

### Generalisations

If `V` is a topological vector space, then there may be a way to make sense of certain *infinite* linear combination, 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 don't 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 flavours 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 generalises to this case without change.
The only difference is that we call spaces like `V` modules instead of vector spaces.
If `K` is a noncommutative ring, then the concept still generalises, 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

`a`_{1}`v`_{1}`b`_{1}+ ... +`a`_{n}`v`_{n}`b`_{n},

`a`

_{1},...,

`a`

_{n}belong to

`K`

_{L},

`b`

_{1},...,

`b`

_{n}belong to

`K`

_{R}, and

`v`

_{1},...,

`v`

_{n}belong to

`V`.