(** SISTEMI LINEARI **)

(* ESEMPIO CON SCAMBIO DI RIGHE *)

Clear[a];

a={{1,-3,4,5},{2,-6,4,-1},{5,-5,2,3},{-1,-2,7,6}};
MatrixForm[a]

a1={a[[1]],2a[[1]]-a[[2]],5*a[[1]]-a[[3]],a[[1]]+a[[4]]};
MatrixForm[a1]

a2={a1[[1]],a1[[3]],a1[[2]],a1[[4]]}; (* SCAMBIO *)
MatrixForm[a2]

a3={a2[[1]],a2[[2]],a2[[4]],a2[[3]]};  (* SCAMBIO *)
MatrixForm[a3]

a4={a3[[1]],a3[[2]],a3[[2]]-2*a3[[3]],a3[[4]]};
MatrixForm[a4]

a5={a4[[1]],a4[[2]],a4[[3]],a4[[3]]+a4[[4]]};
MatrixForm[a5]

(* ESEMPIO CON NESSUNA SOLUZIONE *)

Clear[a,a1,a2,a3,a4,a5,b];
a={{1,2,3,1},{2,4,6,3},{-1,0,2,-2}};
MatrixForm[a]

a1={a[[1]],a[[2]]-2*a[[1]],a[[3]]+a[[1]]};
MatrixForm[a1]

a2={a1[[1]],a1[[3]],a1[[2]]};
MatrixForm[a2]

(* ESEMPIO CON INFINITE SOLUZIONI *)

Clear[a,a1,a2,a3,a4,a5,b];
a={{1,2,3,1},{2,4,6,2},{-1,0,2,-2}};
MatrixForm[a]

a1={a[[1]],a[[2]]-2*a[[1]],a[[3]]+a[[1]]};
MatrixForm[a1]

a2={a1[[1]],a1[[3]],a1[[2]]};
MatrixForm[a2]