Depending on the parameter p in C, find all solutions (in complex numbers) In the title it's $p \in \mathbb{C}$
$\begin{cases}
x+py-z=3 \\
px+y-z=9 \\
x+y-pz=1 \\
\end{cases}$
I decided to use Cramer's rule
$det_m=\begin {bmatrix}
1&p&-1 \\
p&1&-1 \\
1&1&-p \\
\end {bmatrix}=p^3-3p+2=(p-1)^2(p+2)\neq0 \Rightarrow (p\neq1 \land p\neq-2)$
1 solution for $p \in \mathbb{C} \setminus \{1,-2\}$
$det_x=9p^2-4p-5=0 \ $ it's equal $0$ only for $p=1$
$det_y=3p^2-10p+7=0 \ $ equal $0$ only for $p=1$
$det_z=-p^2+12p-11=0 \ $ equal $0$ only for $p=1$
infinity of solutions for $p=1$
no solution for $p=-2$
So if I understand this correctly, all I have to do is to write answer:
$x=\frac{9p^2-4p-5}{p^3-3p+2}$
$y=\frac{3p^2-10p+7}{p^3-3p+2}$
$z=\frac{-p^2+12p-11}{p^3-3p+2}$
where $(p \neq 1 \land p\neq-2)\land p\in \mathbb{C}$
Did I solve this assignment correctly?
 A: Hint: Plugging $$z=x+py-3$$ in the second equation we get
$$(p-1)(x-y)=0$$
A: Cramer's rule is indeed a good idea here. 
The relevant data is
\begin{align*}
\det\left[\begin{array}{rrr}
1 & p & -1 \\
p & 1 & -1 \\
1 & 1 & -p
\end{array}\right] &= {\left(p + 2\right)} {\left(p - 1\right)}^{2} \\
\det\left[\begin{array}{rrr}
3 & p & -1 \\
9 & 1 & -1 \\
1 & 1 & -p
\end{array}\right] &= {\left(9 \, p + 5\right)} {\left(p - 1\right)} \\
\det\left[\begin{array}{rrr}
1 & 3 & -1 \\
p & 9 & -1 \\
1 & 1 & -p
\end{array}\right] &= {\left(3 \, p - 7\right)} {\left(p - 1\right)} \\
\det\left[\begin{array}{rrr}
1 & p & 3 \\
p & 1 & 9 \\
1 & 1 & 1
\end{array}\right] &= -{\left(p - 1\right)} {\left(p - 11\right)}
\end{align*}
So, for $p\neq -2$ and $p\neq 1$, the solution to $A\vec{x}=\vec{b}$ has coordinates
\begin{align*}
x_1 &= \frac{9 \, p + 5}{{\left(p + 2\right)} {\left(p - 1\right)}} & x_2 &= \frac{3 \, p - 7}{{\left(p + 2\right)} {\left(p - 1\right)}} & x_3 &= -\frac{p - 11}{{\left(p + 2\right)} {\left(p - 1\right)}}
\end{align*}
Now, we solve the system for $p=-2$ and $p=1$. Here, the relevant information is
\begin{align*}
\operatorname{rref}\left[\begin{array}{rrr|r}
1 & -2 & -1 & 3 \\
-2 & 1 & -1 & 9 \\
1 & 1 & 2 & 1
\end{array}\right] &= \left[\begin{array}{rrr|r}
1 & 0 & 1 & 0 \\
0 & 1 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right] \\
\operatorname{rref}\left[\begin{array}{rrr|r}
1 & 1 & -1 & 3 \\
1 & 1 & -1 & 9 \\
1 & 1 & -1 & 1
\end{array}\right] &= \left[\begin{array}{rrr|r}
1 & 1 & -1 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 0 & 0
\end{array}\right]
\end{align*}
Here, we find that the system is actually unsolvable for $p=-2$ and $p=1$.
