\(a^2b-a^2c+b^2c-b^2a+ac^2-bc^2\)
\(=ab\left(a-b\right)-ac\left(a-c\right)+bc\left(b-c\right)\)
\(=a\left(ba-b^2-ac+c^2\right)+bc\left(b-c\right)\)
\(=a\left[a\left(b-c\right)-\left(b^2-c^2\right)\right]+bc\left(b-c\right)\)
\(=a^2\left(b-c\right)-\left(b-c\right)\left(b+c\right)+bc\left(b-c\right)\)
\(=\left(b-c\right)\left[a^2-b-c+bc\right]\)