Factoring a polynomial with four terms