Given matrices \(A\) and \(B\):
\(A=\begin{bmatrix} 1 & 2 & x \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\),
\(B=\begin{bmatrix} 1 & -2 & y \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\),
We know \(AB = I_3\), where \(I_3\) is the identity matrix:
\(I_3=\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\).
To find \(AB\), we multiply matrices \(A\) and \(B\):
\(AB=\begin{bmatrix} 1 & 2 & x \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\begin{bmatrix} 1 & -2 & y \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\).
The product is computed as follows:
\(AB = \begin{bmatrix} (1 \cdot 1 + 2 \cdot 0 + x \cdot 0) & (1 \cdot -2 + 2 \cdot 1 + x \cdot 0) & (1 \cdot y + 2 \cdot 0 + x \cdot 1) \\ (0 \cdot 1 + 1 \cdot 0 + 0 \cdot 0) & (0 \cdot -2 + 1 \cdot 1 + 0 \cdot 0) & (0 \cdot y + 1 \cdot 0 + 0 \cdot 1) \\ (0 \cdot 1 + 0 \cdot 0 + 1 \cdot 0) & (0 \cdot -2 + 0 \cdot 1 + 1 \cdot 0) & (0 \cdot y + 0 \cdot 0 + 1 \cdot 1) \end{bmatrix}\).
This simplifies to:
\(AB = \begin{bmatrix} 1 & 0 & y+x \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\).
For \(AB\) to be equal to \(I_3\), we need:
\(y+x=0\).
Thus, solving for \(x+y\), we have:
\(x+y = 0\).
Therefore, the value of \(x+y\) is 0.