$A^2=\begin{bmatrix}3 & 1\\7 & 5\end{bmatrix}\begin{bmatrix}3 & 1\\7 & 5\end{bmatrix}$
$\quad=\begin{bmatrix}3(3)+1(7) & 3(1)+1(5)\\7(3)+5(7) & 7(1)+5(5)\end{bmatrix}$
$\quad=\begin{bmatrix}9+7 & 3+5\\21+35 & 7+25\end{bmatrix}$
$\quad=\begin{bmatrix}16 & 8\\56 & 32\end{bmatrix}$
$A^2+xI=yA$
$\begin{bmatrix}16 & 8\\56& 32\end{bmatrix}+x\begin{bmatrix}1 & 0\\0 & 1\end{bmatrix}=y\begin{bmatrix}3 & 1\\7 & 5\end{bmatrix}$
$\Rightarrow \begin{bmatrix}16 & 8\\56 & 32\end{bmatrix}+\begin{bmatrix}x & 0\\0 & x\end{bmatrix}=y\begin{bmatrix}3 & 1\\7 & 5\end{bmatrix}$
$\Rightarrow \begin{bmatrix}16 & 8\\56 & 32\end{bmatrix}+\begin{bmatrix}x & 0\\0 & x\end{bmatrix}=\begin{bmatrix}3y & y\\7y & 5y\end{bmatrix}$
$\Rightarrow \begin{bmatrix}16+x & 8+0\\56+0 & 32+x\end{bmatrix}=\begin{bmatrix}3y & y\\7y & 5y\end{bmatrix}$
16+x=3y---(1)
8=y------(2)
56=7y-----(3)
32+x=5y----(4)
From equation (2) we have
y=8.
From equation (1) we have
16+x=3y
16+x=3(8)
16+x=24
x=24-16
x=8.
Therefore x=8,y=8.