\(a,x^4+5x^3-8x-40=x^3\left(x+5\right)-8\left(x+5\right)\\ =\left(x^3-8\right)\left(x+5\right)=\left(x-2\right)\left(x^2+2x+4\right)\left(x+5\right)\\ b,3x^2-6x-12y^2+3=3\left(x^2-2x-4y^2+1\right)\\ =3\left[\left(x-1\right)^2-4y^2\right]=3\left(x-2y-1\right)\left(x+2y-1\right)\)