2x +y+3z=-1,(a+3)x+2y+8z=2,3x+y(a+1)z=1 solve for a, by gauss-jordan elimination

To solve the system of equations using Gauss-Jordan elimination, we need to perform a series of row operations to get the system into row-echelon form and then reduce it to reduced row-echelon form. Let's go step by step:

Step 1: Write down the augmented matrix of the system:
```
[ 2 1 3 | -1 ]
[ a+3 2 8 | 2 ]
[ 3 1 a+1 | 1 ]
```

Step 2: Perform row operations to convert the matrix into row-echelon form:
a) Let's eliminate the coefficients below the leading coefficient of the first row:
- Multiply row 1 by (a+3) and subtract row 2 multiplied by 2 from it.
- Multiply row 1 by 3 and subtract row 3 from it.

The resulting matrix:
```
[ 2 1 3 | -1 ]
[ 0 -2(a+3) -2(a+5) | 4(a+2) ]
[ 0 0 -3(a+3) | 4-3(a) ]
```

Step 3: Simplify the matrix further:
a) Divide row 2 by -2(a+3) and row 3 by -3(a+3).
b) Simplify the expressions in the matrix.

The resulting matrix:
```
[ 2 1 3 | -1 ]
[ 0 1 a+5 | -2(a+2) ]
[ 0 0 1 | 3(a-4) ]
```

Step 4: Perform row operations to convert the matrix into reduced row-echelon form:
a) Let's eliminate the coefficients above and below the leading coefficients of the second and third rows:
- Multiply row 2 by 2(a+5) and subtract row 1 multiplied by (a+5) from it.
- Multiply row 3 by (a-4) and subtract row 1 multiplied by (a-4) from it.

The resulting matrix:
```
[ 2 0 0 | a-1 ]
[ 0 1 0 | -2 ]
[ 0 0 1 | 3 ]
```

Step 5: Simplify the matrix further:
a) Divide row 1 by 2.

The resulting matrix:
```
[ 1 0 0 | (a-1)/2 ]
[ 0 1 0 | -2 ]
[ 0 0 1 | 3 ]
```

From the reduced row-echelon form of the matrix, we can see that:
- The value of `a` is given by `(a-1)/2`.

Therefore, `a = 2` is the solution to the system of equations.