Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Write a Vector as a Linear Combination

A linear combination is a sum of scaled vectors, c1v1+c2v2+⋯c_1\mathbf{v}_1 + c_2\mathbf{v}_2 + \cdots. Writing a given b\mathbf{b} that way means finding the weights, and finding the weights means solving a linear system.

Recognize the task

A target vector and a list of vectors: "express (7,4)(7, 4) in terms of (1,2)(1, 2) and (3,1)(3, 1)", "is b\mathbf{b} a combination of v1,v2\mathbf{v}_1, \mathbf{v}_2?", "find c1,c2c_1, c_2 with c1v1+c2v2=bc_1\mathbf{v}_1 + c_2\mathbf{v}_2 = \mathbf{b}". Test: are the unknowns the scalars in front of known vectors?
Linear combinations are defined in the linear combinations lesson; the link to systems is in Linear Combinations and Systems of Equations.

Steps

StepOn b=(7,4)\mathbf{b} = (7, 4), v1=(1,2)\mathbf{v}_1 = (1, 2), v2=(3,1)\mathbf{v}_2 = (3, 1)
1Write the vector equation. One unknown weight per vector (the vector equation form).c1(1,2)+c2(3,1)=(7,4)c_1(1, 2) + c_2(3, 1) = (7, 4)
2Turn it into a system, one equation per component. The given vectors become the columns of the coefficient matrix.c1+3c2=7c_1 + 3c_2 = 7,  2c1+c2=4\ 2c_1 + c_2 = 4
3Solve the system. Small systems by substitution; larger ones by Gaussian elimination on [v1 v2∣b][\mathbf{v}_1\ \mathbf{v}_2 \mid \mathbf{b}].R2−2R1R_2 - 2R_1:  −5c2=−10\ -5c_2 = -10, so c2=2c_2 = 2, c1=1c_1 = 1
4Read the answer. A contradiction such as 0=10 = 1 means b\mathbf{b} is not a linear combination of the vectors. Free variables mean many choices of weights.b=1 v1+2 v2\mathbf{b} = 1\,\mathbf{v}_1 + 2\,\mathbf{v}_2
5Check by computing the combination. Scale each vector and add.Component-wise addition ↗(1,2)+(6,2)=(7,4)(1, 2) + (6, 2) = (7, 4) ✓

Worked examples

Example 1 · evaluate a combination

basic
2(1,−1,0)−3(0,2,1)2(1, -1, 0) - 3(0, 2, 1)
scale each vector
=(2,−2,0)−(0,6,3)= (2, -2, 0) - (0, 6, 3)
=(2,−8,−3)= (2, -8, -3)
subtract components

Example 2 · find the weights

two unknowns
c1(1,1)+c2(1,−1)=(1,5)c_1(1, 1) + c_2(1, -1) = (1, 5)
c1+c2=1c_1 + c_2 = 1,  c1−c2=5\ c_1 - c_2 = 5
add: 2c1=62c_1 = 6
c1=3c_1 = 3, c2=−2c_2 = -2
check: (3,3)+(−2,2)=(1,5)(3, 3) + (-2, 2) = (1, 5)

Example 3 · not a combination

inconsistent
c1(1,0,1)+c2(0,1,1)=(1,2,4)c_1(1, 0, 1) + c_2(0, 1, 1) = (1, 2, 4)
three equations, two unknowns
c1=1c_1 = 1, c2=2c_2 = 2 from the first two
third: c1+c2=3≠4c_1 + c_2 = 3 \neq 4, so no weights exist
b is off the plane
Move the weights in the linear combination visualizer. Whether a vector is in a span at all is the span test.

See it happen

Think of v1\mathbf{v}_1 and v2\mathbf{v}_2 as two directions you may walk in, any distance, forwards or backwards. The weights say how far to walk in each to land on b\mathbf{b}. In the plane, two non-parallel directions reach every point; in space, two directions reach only a plane, which is why the third equation can fail.

Common mistakes

Putting the vectors in as rows

✗ coefficient matrix with rows (1,2)(1, 2) and (3,1)(3, 1) for the trace problem
✓ the vectors are the columns: (1321)\begin{pmatrix} 1 & 3 \\ 2 & 1 \end{pmatrix}

Ignoring the extra equation

✗ c1=1c_1 = 1, c2=2c_2 = 2, so (1,2,4)=v1+2v2(1, 2, 4) = \mathbf{v}_1 + 2\mathbf{v}_2
✓ check all three components; the third fails, so there is no combination

Swapping the weights

✗ b=2 v1+1 v2\mathbf{b} = 2\,\mathbf{v}_1 + 1\,\mathbf{v}_2
✓ c1c_1 belongs to v1\mathbf{v}_1: b=1 v1+2 v2\mathbf{b} = 1\,\mathbf{v}_1 + 2\,\mathbf{v}_2