Last updated September 23, 2026 · Report an error
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).
- Enter dimension / number of vectors.
- Enter v₁: component 1.
- Enter v₁: component 2.
- Enter v₁: component 3 (only if 3D).
- Enter v₂: component 1.
- Enter v₂: component 2.
- Enter v₂: component 3 (only if 3D).
- Enter v₃: component 1 (only if 3D).
- Enter v₃: component 2 (only if 3D).
- Enter v₃: component 3 (only if 3D).
- Enter target b: component 1.
- Enter target b: component 2.
- Enter target b: component 3 (only if 3D).
- 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.