p4-7p2+1
=p^4-7p²+1
=p^4+2p²-2p²-7p²+1
=p^4+2p²+1-9p²
=(p²+1)²-(3p)²
=(p²+1+3p)(p²+1-3p)
=(p²+3p+1)(p²-3p+1)
x4+4x2+3x+4
=x^4+4x²+3x+4
=x^4-x²+x²+4x²+3x+x-x+4
=(x²+x)(x²-x)+4x²+4x+x²-x+4
=(x²+x)(x²-x)+4(x²+x)+(x²-x+4)
=(x²+x)[(x²-x)+4]+(x²-x+4)
=(x²-x+4)(x²+x+1)