Find the general solution of linear system of equations (homework assignement) Assuming that $\lambda$ is any number, does below set of equations have a solution? If it has, find the general solution for this system.
$$\lambda x_1+x_2+x_3=1$$
$$x_1+\lambda x_2+x_3=\lambda$$
$$x_1+x_2+\lambda x_3=\lambda^2$$
I understand how this problem should be solved, however when transform this set to a matrix and then row reduce it to an echolon form I get:
$$B=\left(\begin{array}{ccc|c}
1 & 1 & \lambda & \lambda\\
0 & \lambda-1 & 1-\lambda & \lambda-\lambda^2\\
0 & 0 & (\lambda-1)(\lambda+2) & \lambda^3+\lambda^2-\lambda-1\end{array}\right)$$
But from this point I start to struggle, don't really know where I'm making mistake.
 A: $$\lambda x_1+x_2+x_3=1$$
$$x_1+\lambda x_2+x_3=\lambda$$
$$x_1+x_2+\lambda x_3=\lambda^2$$
Adding all three equations together gives
$$(\lambda+2)(x_1+x_2+x_3)=1+\lambda+\lambda^2$$
If $\lambda=-2$ we have $0=1+(-2)+(-2)^2=3$, which is absurd. Thus we can divide by $\lambda+2$:
$$x_1+x_2+x_3=\frac{1+\lambda+\lambda^2}{\lambda+2}$$
Subtracting this from all three original equations gives
$$(\lambda-1)x_1=1-\frac{1+\lambda+\lambda^2}{\lambda+2}$$
$$(\lambda-1)x_2=\lambda-\frac{1+\lambda+\lambda^2}{\lambda+2}$$
$$(\lambda-1)x_3=\lambda^2-\frac{1+\lambda+\lambda^2}{\lambda+2}$$
If $\lambda=1$, all three of the original equations reduce to $x_1+x_2+x_3=1$, whose solution is simply
$$x_1=p,x_2=q,x_3=1-p-q\qquad p,q\in\mathbb R\tag1$$
Otherwise, dividing by $\lambda-1$ gives the unique solution of
$$x_1=\frac{1-\frac{1+\lambda+\lambda^2}{\lambda+2}}{\lambda-1}=\frac1{\lambda+2}-1\\
x_2=\frac{\lambda-\frac{1+\lambda+\lambda^2}{\lambda+2}}{\lambda-1}=\frac1{\lambda+2}\\
x_3=\frac{\lambda^2-\frac{1+\lambda+\lambda^2}{\lambda+2}}{\lambda-1}=\frac{(\lambda+1)^2}{\lambda+2}\tag2$$
In conclusion, the solutions of the linear system are


*

*as in $(1)$ if $\lambda=1$

*none if $\lambda=-2$

*as in $(2)$ otherwise.

A: Your work is good. Now you are at a crossroads, but either $\lambda=1$ or $\lambda\ne1$.
In the latter case, you can divide the second row by $\lambda-1$
$$
\left( \begin{array}{ccc|c}
1 & 1 & \lambda & \lambda\\
0 & 1 & -1 & -\lambda\\
0 & 0 & (\lambda-1)(\lambda+2) & (\lambda-1)(\lambda+1)^2
\end{array} \right)
$$
and also the third row by $\lambda-1$, to get
$$
\left( \begin{array}{ccc|c}
1 & 1 & \lambda & \lambda\\
0 & 1 & -1 & -\lambda\\
0 & 0 & \lambda+2 & (\lambda+1)^2
\end{array} \right)
$$
Now, if $\lambda=-2$, the system has no solution. If $\lambda\ne-2$ you can find the unique solution by standard methods.
If $\lambda=1$, the matrix becomes
$$
\left( \begin{array}{cc}
1 & 1 & 1 & 1\\
0 & 0 & 0 & 0\\
0 & 0 & 0 & 0
\end{array} \right)
$$
which is easy to deal with.
