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