You titled this "using a matrix". Written in matrix form, Ax= B, that would be
\(\displaystyle \begin{bmatrix}9 & a & 7 \\ 2 & 1 & b \\ 6 & 2 & 5 \end{bmatrix}\begin{bmatrix}x \\ y \\ z\end{bmatrix}= \begin{bmatrix}d \\ f \\ g \end{bmatrix}\). What methods have you learned for solving matrix equations? Do you know how to find the inverse of a matrix?