🧮
🧮 Math & statistics

Linear Combination Calculator (find c₁, c₂, … with c₁v₁ + c₂v₂ + … = b)

Results update as you type.

Your numbers

Understanding the linear combination calculator — concept and principle

This calculator decides whether a target vector b can be written as a linear combination c₁v₁ + c₂v₂ + … of given vectors and, if so, finds the coefficients. It reports whether the coefficients are unique and the rank of the vector set. Use it for linear algebra homework on span, consistency and bases.

Linear combinationb = 2·v₁ + 1·v₂ + 0·v₃2 · v₁(2, 4, 2)1 · v₂(0, 1, 2)+0 · v₃(0, 0, 0)+b(2, 5, 4)rank 3 → yes, in the span, coefficients unique
Scale each vector, add them, and check the total matches b.

How it is calculated

Build the augmented matrix [v₁ v₂ … v_k | b] with the vectors as columns.

Row-reduce it:

The principle

Writing b = c₁v₁ + … + c_kv_k component by component gives a system of linear equations with the c's as unknowns. So "is b a combination of these vectors?" is the same question as "does this system have a solution?", and also "is b in the column space?". Row reduction answers all three at once. If the vectors are independent, each reachable b has exactly one recipe.

Worked example

Default inputs: v₁ = (1, 2, 1), v₂ = (0, 1, 2), v₃ = (1, 0, −1), b = (2, 5, 4).

  1. Augmented matrix [1 0 1 | 2; 2 1 0 | 5; 1 2 −1 | 4].
  2. Row reduction gives a pivot in every vector column and none in the last column: rank 3.
  3. Yes — b is in the span, with coefficients 2, 1, 0.
  4. b written out: 2·v₁ + v₂ = (2, 4, 2) + (0, 1, 2) = (2, 5, 4).
  5. Unique coefficients? yes.

How to read the result

With three independent vectors in ℝ³, the span is all of ℝ³, so every b is reachable and the answer is always unique. A coefficient of 0, as for v₃ here, simply means that vector is not needed for this particular b. If the rank were less than the number of vectors, some vectors would be redundant and the coefficients would not be unique.

Common mistakes

Keep in mind: With decimal data, near-zero pivots can be rounding noise; very ill-conditioned vector sets can give misleading results.

Frequently asked questions

What is a linear combination?

A sum of vectors each multiplied by a scalar: c₁v₁ + c₂v₂ + …

How do I check if b is in the span?

Row-reduce [v₁ … v_k | b]; b is in the span if there is no pivot in the last column.

When are the coefficients unique?

When the vectors are linearly independent.

Sources: D. Margalit & J. Rabinoff, Interactive Linear Algebra, §2.7 Basis and Dimension · A. Davis, P. Zachlin et al., Coordinated Linear Algebra (University of Nebraska–Lincoln), §2.4

Checked 9 Nov 2026. D. Margalit & J. Rabinoff, Interactive Linear Algebra, §2.7 Basis and Dimension (the span of v₁, …, v(m) is the column space of the matrix with those columns; pivot columns); Coordinated Linear Algebra (University of Nebraska–Lincoln), §2.4 (linear combination equations solved by row-reducing the matrix of vectors).

🧮 All math & statistics tools →🌍 Calculators by country →