Answer: (i)(a) If \(\theta\neq -1\), \(\operatorname{rank}(\mathbf A)=3\).
(i)(b) If \(\theta=-1\), \(\operatorname{rank}(\mathbf A)=2\).
(ii) For \(\theta\neq -1\), \(x=\dfrac67\), \(y=-\dfrac47\), \(z=1\).
(iii) For \(\theta=-1\), the general solution is \(z=t\), \(y=-\dfrac{3t+1}{7}\), \(x=\dfrac{8t-2}{7}\), where \(t\in\mathbb R\).
(iv) If \(\theta=-1\) and \(\phi\neq -1\), the system is inconsistent, so there is no solution.
Start by reducing the coefficient matrix
\(\mathbf A=\begin{pmatrix}1&5&1\\1&-2&-2\\2&3&\theta\end{pmatrix}\).
Use \(R_2\leftarrow R_2-R_1\) and \(R_3\leftarrow R_3-2R_1\):
\(\begin{pmatrix}1&5&1\\0&-7&-3\\0&-7&\theta-2\end{pmatrix}\).
Then use \(R_3\leftarrow R_3-R_2\):
\(\begin{pmatrix}1&5&1\\0&-7&-3\\0&0&\theta+1\end{pmatrix}\).
(i)(a) If \(\theta\neq -1\), the final pivot \(\theta+1\) is non-zero, so there are three non-zero rows. Hence \(\operatorname{rank}(\mathbf A)=3\).
(i)(b) If \(\theta=-1\), the final row is zero, so there are two non-zero rows. Hence \(\operatorname{rank}(\mathbf A)=2\).
(ii) Apply the same row operations to the augmented system
\(\begin{pmatrix}1&5&1&-1\\1&-2&-2&0\\2&3&\theta&\theta\end{pmatrix}\).
This gives the equivalent equations
\(x+5y+z=-1,\)
\(-7y-3z=1,\)
\((\theta+1)z=\theta+1.\)
Since \(\theta\neq -1\), the last equation gives \(z=1\). Then
\(-7y-3=1\), so \(y=-\dfrac47\).
Finally,
\(x+5\left(-\dfrac47\right)+1=-1\), so \(x=\dfrac67\).
Therefore
\(x=\dfrac67,\quad y=-\dfrac47,\quad z=1\).
(iii) When \(\theta=-1\), the final equation becomes \(0=0\), so one parameter is free. Let \(z=t\). Then
\(-7y-3t=1\), so \(y=-\dfrac{3t+1}{7}\).
Using \(x+5y+z=-1\),
\(x=-1-5\left(-\dfrac{3t+1}{7}\right)-t=\dfrac{8t-2}{7}\).
So the general solution is
\(z=t,\quad y=-\dfrac{3t+1}{7},\quad x=\dfrac{8t-2}{7}\), where \(t\in\mathbb R\).
(iv) With \(\theta=-1\), the augmented system \(\mathbf A\mathbf x=\begin{pmatrix}-1\\0\\\phi\end{pmatrix}\) reduces to
\(x+5y+z=-1,\)
\(-7y-3z=1,\)
\(0=\phi+1.\)
If \(\phi\neq -1\), then \(\phi+1\neq0\), so the last equation is impossible. Hence the system has no solution.