To find the determinant of the given [tex]\(3 \times 3\)[/tex] matrix:
[tex]\[
\begin{vmatrix}
1 & 3 & 1 \\
1 & -2 & -1 \\
2 & 1 & 2
\end{vmatrix}
\][/tex]
we can use the rule for determinants of [tex]\(3 \times 3\)[/tex] matrices, which is given by:
[tex]\[
\begin{vmatrix}
a & b & c \\
d & e & f \\
g & h & i
\end{vmatrix} = a(ei - fh) - b(di - fg) + c(dh - eg)
\][/tex]
In our matrix:
[tex]\[
\begin{array}{ccc}
a = 1 & b = 3 & c = 1 \\
d = 1 & e = -2 & f = -1 \\
g = 2 & h = 1 & i = 2
\end{array}
\][/tex]
Substitute these values into the determinant formula:
[tex]\[
\begin{vmatrix}
1 & 3 & 1 \\
1 & -2 & -1 \\
2 & 1 & 2
\end{vmatrix} = 1((-2 \cdot 2) - (-1 \cdot 1)) - 3((1 \cdot 2) - (-1 \cdot 2)) + 1((1 \cdot 1) - (-2 \cdot 2))
\][/tex]
Now, calculate each term within the parentheses:
[tex]\[
1((-4) - (-1)) - 3((2) - (-2)) + 1((1) - (-4))
\][/tex]
Simplify the expressions in the parentheses:
[tex]\[
1(-4 + 1) - 3(2 + 2) + 1(1 + 4)
\][/tex]
[tex]\[
1(-3) - 3(4) + 1(5)
\][/tex]
Then, perform the multiplications:
[tex]\[
-3 - 12 + 5
\][/tex]
Finally, calculate the sum of these terms:
[tex]\[
-3 - 12 + 5 = -10
\][/tex]
Thus, the determinant of the matrix is:
[tex]\[
\boxed{-10}
\][/tex]