The value of the determinant $\left|\begin{array}{ccc}x & x+y & x+2 y \\ x+2 y & x & x+y \\ x+y & x+2 y & x\end{array}\right|$ is
(a) $9 x^{2}(x+y)$
(b) $9 y^{2}(x+y)$
(c) $3 y^{2}(x+y)$
(d) $7 x^{2}(x+y)$
$\left|\begin{array}{ccc}x & x+y & x+2 y \\ x+2 y & x & x+y \\ x+y & x+2 y & x\end{array}\right|$
$=\left|\begin{array}{ccc}-2 y & y & y \\ x+2 y & x & x+y \\ -y & 2 y & -y\end{array}\right|$ [Applying $R_{1} \rightarrow R_{1}-R_{2}$ and $R_{3} \rightarrow R_{3}-R_{2}$ ]
$=y^{2}\left|\begin{array}{ccc}-2 & 1 & 1 \\ x+2 y & x & x+y \\ -1 & 2 & -1\end{array}\right|$ [Taking $(y)$ common from $R_{1}$ and from $R_{3}$ ]
$=y^{2}\left|\begin{array}{ccc}-2 & -3 & 3 \\ x+2 y & 3 x+4 y & -y \\ -1 & 0 & 0\end{array}\right|$ [Applying $C_{2} \rightarrow C_{2}+2 C_{1}$ and $C_{3} \rightarrow C_{3}-C_{1}$ ]
$=y^{2}[-1(3 y-9 x-12 y)]$
$=y^{2}[9 y+9 x]$
$=9 y^{2}(y+x)$
Hence, the correct option is (b).