You can do this by trying to find a pair of numbers that that have a sum which is equal to the coefficient of the middle term, and a product that is equal to the product of the coefficients of the first and last term. In other words, you want two numbers, "a" and "b" which add up to 5, and which have a product of -24:
a + b = 5
a × b = -24
In this case, the numbers we need would be eight and negative three. We can then plug them into our equation, by splitting the middle term into the sum of those two numbers:
x2 + 5x - 24
= x2 + 8x - 3x - 24
Now we can take pairs of those terms, and divide by common factors:
= x(x + 8) - 3(x + 8)
And finally, group like terms:
= (x - 3)(x + 8)
x3 + x2 + 4x + 4 = (x2 + 4)(x + 1)
x + 4
x2(x3 + 1) is the best you can do there.
Factor x2 plus 12xp plus 36p2 is (x+6p)(x+6p).
That does not factor neatly.
You can't factor it
1
Not factorable
x2 + 5x - 120 can not be factored.
x2+10x-336
x2 - 13 + 30 = x2 + 17, which has no real factors.
x2 + 7x + 6 = (x + 6) (x + 1)