a) \(x^3-3x+3y-y^3=\left(x-y\right)\left(x^2+xy+y^2\right)-3\left(x-y\right)=\left(x-y\right)\left(x^2+xy+y^2-3\right)\)
\(a,=\left(x-y\right)\left(x^2+xy+y^2\right)-3\left(x-y\right)\\ =\left(x-y\right)\left(x^2+xy+y^2-3\right)\\ b,=\left(x+2\right)^2-\left(x-1\right)^2\\ =\left(x+2-x+1\right)\left(x+2+x-1\right)\\ =3\left(2x+1\right)\)
b) \(\left(x+2\right)^2-x^2+2x-1=\left(x+2\right)^2-\left(x^2-2x+1\right)=\left(x+2\right)^2-\left(x-1\right)^2=\left(x+2+x-1\right)\left(x+2-x+1\right)=3\cdot\left(2x+1\right)\)