\(a,=\left(m-y\right)\left(m+y\right)+a\left(m+y\right)=\left(m+y\right)\left(m-y+a\right)\\ b,=3x\left(y-1\right)+\left(y-1\right)\left(y+1\right)=\left(y-1\right)\left(3x+y+1\right)\)
a: \(=\left(m-y\right)\left(m+y\right)+a\left(m+y\right)\)
\(=\left(m+y\right)\left(m-y+a\right)\)