\(a.=x^3+3x^2y+3x^2y+9xy^2+3xy^2+9y^3\)
\(=x^2\left(x+3y\right)+3xy\left(x+3y\right)+3y^2\left(x+3y\right)\)
\(=\left(x+3y\right)\left(x^2+3xy+3y^2\right).\)
\(b.=9x^3+3x^2y+9x^2y+3xy^2+3xy^2+y^3\)
\(=3x^2\left(3x+y\right)+3xy\left(3x+y\right)+y^2\left(3x+y\right)\)
\(=\left(3x^2+3xy+y^2\right)\left(3x+y\right)\).