1) m^3-m-am^2+a= (m^3-m)-(am^2-a)= m(m^2-1) -a(m^2-1)=(m^2-1)*(m-a)
2) ay-2ab+2by-y^2= (ay-2ab)+(2by-y^2)= a(y-2b)+y(2b-y) = (2b-y)*(a+y)
3) x^2+4yz-xy-xz= (x^2-xz)+(4yz-xy)= x(x-z) + 4y(z-x) = (x-z)*(x+4y)
4) ay^2+2a^2-a^3-2y^2= (ay^2-2y^2)+(2a^2-a^3)= y^2(a-2)+a^2(2-a)= (a-2)*(y^2+a^2)