a: \(a\left(x-y\right)-b\left(y-x\right)+c\left(x-y\right)\)
\(=a\left(x-y\right)+b\left(x-y\right)+c\left(x-y\right)\)
\(=\left(x-y\right)\left(a+b+c\right)\)
b: \(a^m-a^{m+2}\)
\(=a^m-a^m\cdot a^2\)
\(=a^m\left(1-a^2\right)\)
\(=a^m\left(1-a\right)\left(1+a\right)\)