Answer
The equation is correct.
Work Step by Step
Multiplying the third column with $(-1)$ and adding the output to the two columns (the first column and the second column), we have
$$\left|\begin{array}{ccc}
a+b & a & a \\
a & a+b & a \\
a & a & a+b
\end{array}\right|=\left|\begin{array}{ccc}
b & 0 & a \\
0 & b & a \\
-b & -b & a+b
\end{array}\right|=b^{2} \left|\begin{array}{ccc}
1 & 0 & a \\
0 & 1 & a \\
-1 & -1 & a+b
\end{array}\right| $$
Adding the first row to the third row, we get
$$\left|\begin{array}{ccc}
a+b & a & a \\
a & a+b & a \\
a & a & a+b
\end{array}\right|=b^{2} \left|\begin{array}{ccc}
1 & 0 & a \\
0 & 1 & a \\
0 & -1 & 2a+b
\end{array}\right| $$
Adding the second row to the third row, we see that
$$\left|\begin{array}{ccc}
a+b & a & a \\
a & a+b & a \\
a & a & a+b
\end{array}\right|=b^{2} \left|\begin{array}{ccc}
1 & 0 & a \\
0 & 1 & a \\
0 & 0 & 3a+b
\end{array}\right|=b^{2} (3a+b) $$