Skip to content
D DocNectar

Free Linear Combination Calculator

Express a target vector as a linear combination of 2 or 3 given vectors, solving for the scalar coefficients.

100% Free No Signup Works on all devices

Last updated September 23, 2026 · Report an error

Thanks for rating!

A linear combination writes one vector as a weighted sum of others, like b = c₁v₁ + c₂v₂ — a foundational idea behind span, basis, and vector spaces. This tool solves for the unknown weights (scalar coefficients) directly.

How it works

The vectors are arranged as columns of a coefficient matrix, and the target vector as the right-hand side — turning c₁v₁+c₂v₂[+c₃v₃]=b into a standard linear system, solved via Cramer's rule (the same determinant-based method used elsewhere on the site).

  1. Enter dimension / number of vectors.
  2. Enter v₁: component 1.
  3. Enter v₁: component 2.
  4. Enter v₁: component 3 (only if 3D).
  5. Enter v₂: component 1.
  6. Enter v₂: component 2.
  7. Enter v₂: component 3 (only if 3D).
  8. Enter v₃: component 1 (only if 3D).
  9. Enter v₃: component 2 (only if 3D).
  10. Enter v₃: component 3 (only if 3D).
  11. Enter target b: component 1.
  12. Enter target b: component 2.
  13. Enter target b: component 3 (only if 3D).
  14. Click Calculate to see your results.

Examples

A 2D example

Given v₁=(1,0), v₂=(0,1), and b=(4,5), the coefficients are simply c₁=4, c₂=5 (since v₁ and v₂ are the standard basis vectors).

A less trivial 2D example

Given v₁=(1,1), v₂=(1,-1), and b=(4,2), the coefficients solve to c₁=3, c₂=1, since 3(1,1)+1(1,-1)=(4,2).

Who should use it

  • Linear algebra coursework on span, linear combinations, and basis vectors.
  • Verifying a hand-solved linear combination problem.

Industry applications

  • Linear algebra and engineering education
  • Computer graphics (basis and coordinate transformations)

Advantages

  • Uses the same verified Cramer's rule / determinant machinery as the site's other linear systems tools.
  • Clearly flags when no unique combination exists.

Limitations

  • Limited to the square case: 2 vectors in 2D or 3 vectors in 3D.

Common mistakes to avoid

  • Trying to express a vector as a combination of vectors that don't span the full space (a linearly dependent set).

Best practices

  • Check the determinant of the vector matrix first — a non-zero determinant guarantees a unique combination exists before you even solve for it.

Tips

  • If the given vectors are the standard basis vectors (like (1,0) and (0,1) in 2D), the coefficients are always just the target vector's own components.

Frequently asked questions

If the vectors are linearly dependent (their determinant is 0), they don't span the full space uniquely, so b either has no valid combination or infinitely many — this tool flags that case explicitly.
This tool only handles the "square" case (2 vectors in 2D, or 3 in 3D) where Cramer's rule applies directly and gives a single unique answer.

Get new calculators and guides in your inbox

No spam — just new tools like Linear Combination Calculator and practical guides.

Favorites