# Solving linear equation using maple

Use Maple to find the general solution to the following system of linear equations: $$\begin{eqnarray} 2x1 + x2 - x3 + 3x4 = 2\\ x1 + 2x2 - x4 = -1\\ 3x1 + 2x2 - 2x3 + x4 = 1\\ \end{eqnarray}$$

-
-1: "This question does not show any research effort; it is unclear or not useful" –  Alex Becker Mar 2 '12 at 13:31
Perhaps phrasing this as a question (rather than a demand) will make people more willing to help. –  Holdsworth88 Mar 2 '12 at 13:44

With rank of 3, this system of three equations in four variables has 1 free parameter in the solution.

with(LinearAlgebra):

eqs:={x2 = 3*x4-2, x1 = -5*x4+3, x3 = -4*x4+2}:

A,b:=GenerateMatrix(eqs,[x1,x2,x3,x4]):

Rank(A);

3

X:=LinearSolve(A,b,'free'=t):

Equate([x1,x2,x3,x4],X);

[x1 = 3 - 5 t[4], x2 = -2 + 3 t[4], x3 = 2 - 4 t[4], x4 = t[4]]

solve(eqs);

{x1 = -5 x4 + 3, x2 = 3 x4 - 2, x3 = -4 x4 + 2, x4 = x4}


Using LinearSolve, we can choose how such free parameters get named. Using solve instead, the degree or freedom is illustrated by the x4=x4 term in the solution. This all means that there are infinitely many solutions, depending on whatever value is taken for the free parameter.

-
  sys:={2*a+b-c+3*d=2,a+2*b-d=-1,3*a+2*b-2*c=1};