A={{2,1,4},{1,-2,-3},{-1,3,5}};
solucion=RowReduce[A];
a=solucion[[1,3]];
b=solucion[[2,3]];
p[x_]:=4*x^2-3*x+5;
q[x_]:=2*x^2+x-1;
r[x_]:=x^2-2*x+3;
combinacion[x_]:=a*q[x]+b*r[x];
Expand[combinacion[x]];
p[x]==combinacion[x]//Simplify