Given a polynomial with degree 2

we can factor it as long as it has solutions. If we have

then we have

In this case, the solutions are given by two numbers that give -24 when multiplied, and 23 when summed. These numbers are clearly 24 and -1.
So, given the roots
, the factorization would be
