How do you write a four term polynomial that can be factored by grouping?
We can construct such a polynomial by reversing the factorisation.
For example, to get an example cubic, pick any numbers
#(ax+b)(cx^2+d) = acx^3+bcx^2+adx+bd#
#x^3+3x^2-4x-12 = (x^3+3x^2)-(4x+12)#
#color(white)(x^3+3x^2-4x-12) = x^2(x+3)-4(x+3)#
#color(white)(x^3+3x^2-4x-12) = (x^2-4)(x+3)#
#color(white)(x^3+3x^2-4x-12) = (x-2)(x+2)(x+3)#
Note that in this example, I chose
If we want clean factorisations like this, we could use the alternative pattern:
#(ax+b)(cx-d)(cx+d) = (ax+b)(c^2x^2-d^2)#
#color(white)((ax+b)(cx-d)(cx+d)) = ac^2x^3+bc^2x^2-ad^2x-bd^2#
Here is one way I've done it when writing exam questions.
Make sure that the first two terms have a common factor. Not a constant common factor, but something involving the variable.
Warning: This may lead to a polynomial that cannot be factored completely over the integers.
For example we might start with
There is a common factor of
The other factor is
For our third and fourth terms we need a multiple of
We could use the following:
Which factors as
Neither of these factor can be factored over the integers.