Ta có :
\(P=x\left(x+a\right)\left(x-a\right)\left(x+2a\right)+a^4\)
\(=\left(x^2+ax\right)\left(x^2-ax+2ax-2a^2\right)+a^4\)
\(=\left(x^2+ax\right)\left(x^2+ax-2a^2\right)+a^4\)
\(=\left(x^2+ax\right)^2-2\left(x^2+ax\right)a^2+a^4\)
\(=\left(x^2+ax-a^2\right)^2\) là scp \(\left(đpcm\right)\)