a: \(=x\left(x^2+2xy+y^2-4\right)\)
\(=x\left(x+y-2\right)\left(x+y+2\right)\)
\(a,x^2+2x^2y+xy^2-4x=x\left(x^2+2xy+y^2-4\right)=x\left[\left(x+y\right)^2-4\right]=x\left(x+y-2\right)\left(x+y+2\right)\\ b,x^2-7xy+10y^2=\left(x^2-2xy\right)-\left(5xy-10y^2\right)=x\left(x-2y\right)-5y\left(x-2y\right)=\left(x-2y\right)\left(x-5y\right)\)