Practical Linear Algebra: A Geometry Toolbox, Third edition
Gerald Farin & Dianne Hansford
CRC Press, Taylor & Francis Group, An A K Peters Book, 2013

Linear combinations and linear systems
Given three vectors a,b,c, how can we write c as a linear combination of a and b, i.e., what are s and t in

	 sa + tb = c?
In matrix form, with M=[a,b] and v=(({{s}, {t}})):
	Mv = c.
	
Another way of saying this would be: what vector v is mapped to c by matrix M?
	
Solution: multiply both sides by the inverse (M^(-1)) (assuming it exists!)

	v=(M^(-1))c

(* Input vectors *)
(* Write c as a linear combination of a and b *)
a ={1,1};
b={0,1};
c={1,1};

(* Form a matrix with a and b as column vectors *)
mat= Transpose[{a,b}];

Print["Find s and t such that "];
Print["c = s",MatrixForm[a]," + t",MatrixForm[b]];
Print["Solve Mv = c where M = [a b] = ",MatrixForm[mat]];

v = Inverse[mat].c;
Print["direct solution: v = M^{-1}c = ", MatrixForm[v]];
Print["check: ",MatrixForm[mat],".",MatrixForm[v]," = ",MatrixForm[mat.v]];

(* Alternatively (and recommend for larger systems) *)

v=LinearSolve[mat,c];
Print["Solution with LinearSolve: ", MatrixForm[v]];
Print["(Recommended for systems larger than 3x3)"];
Print["check: ",MatrixForm[mat],".",MatrixForm[v]," = ",MatrixForm[mat.v]];