Obtain the inverse of the following matrix using elementary operations :$A=\begin{bmatrix}3 & 0 & -1\\2 & 3 & 0\\0 & 4& 1\end{bmatrix}$

Toolbox:
• The following are three operations applied on the rows (or columns) of a matrix.
• (i) Interchange any two rows(columns)
• (ii) Multiplying all elements of a row (column) of a matrix by a non-zero scalar.
• (iii) Adding to the element of a row (column),the corresponding elements of any other row (column) multiplied by any scalar.
• In order to find the inverse of a non-singular square matrix A by elementary operations,we write $A=IA$
• Now we perform a sequence of elementary row operations successively on A on the LHS and the pre factor $I$ on RHS till we obtain $I=BA$
Step 1:
Let $A=\begin{bmatrix} 3 & 0 &-1\\2 & 3 & 0\\0 & 4 &1\end{bmatrix}$
Let $\begin{bmatrix}3 & 0 &-1\\2 &3 &0\\0 &4 & 1\end{bmatrix}=\begin{bmatrix}1 & 0 &0\\0 & 1 & 0\\0 & 0 &1\end{bmatrix}A$
Step 2:
Let us perform the transformation
$C_1\rightarrow C_1+2C_3$
$\begin{bmatrix}1 & 0 &-1\\2 &3 &0\\2 &4 & 1\end{bmatrix}=\begin{bmatrix}1 & 0 &0\\0 & 1 & 0\\2 & 0 &1\end{bmatrix}A$
Step 3:
Perform the transformation :
$C_3\rightarrow C_1+C_3$
$\begin{bmatrix}1 & 0 &0\\2 &3 &2\\2 &4 & 3\end{bmatrix}=\begin{bmatrix}1 & 0 &1\\0 & 1 & 0\\2 & 0 &3\end{bmatrix}A$
Step 4:
Perform the transformation :
$C_2\rightarrow C_2-C_3$
$\begin{bmatrix}1 & 0 &0\\0 &1 &2\\-1 &1 & 3\end{bmatrix}=\begin{bmatrix}0 & -1 &1\\0 & 1 & 0\\-1 & -3 &3\end{bmatrix}A$
Step 5:
Perform the transformation :
$C_3\rightarrow C_3-2C_2$
$\begin{bmatrix}1 & 0 &0\\0 &1 &0\\-1 &1 & 1\end{bmatrix}=\begin{bmatrix}0 & -1 &3\\0 & 1 & -2\\-1 & -3 &9\end{bmatrix}A$
Step 6:
Perform the transformation :
$C_1\rightarrow C_1+C_3$
$\begin{bmatrix}1 & 0 &0\\0 &1 &0\\0 &1 & 1\end{bmatrix}=\begin{bmatrix}3 & -1 &3\\-2 & 1 & -2\\8 & 3 &9\end{bmatrix}A$
Step 7:
Perform the transformation :
$C_2\rightarrow C_2-C_3$
$\begin{bmatrix}1 & 0 &0\\0 &1 &0\\0 &0 & 1\end{bmatrix}=\begin{bmatrix}3 & -4 &3\\-2 & 3 & -2\\8 & -12 &9\end{bmatrix}A$
Step 8:
Hence the inverse of the matrix $A^{-1}$ is $\begin{bmatrix}3 & -4 &3\\-2 &3 &-2\\8 &-12 & 9\end{bmatrix}$