For factor a expression like:
$x^2 + px + q$, we need to use: $(x + a)(x + b), p = a + b, q = ab$
Ok, I know and I understand how to do it.
Sure, it's easy to get for low values, with error and test, but how for high values ? What algorithms exist for this ( instead of trying infinitely)?
You have the quadratic formula you can apply for your case:
$$a = \frac{p - \sqrt{p^2-4q}}{2}$$
$$b = \frac{p + \sqrt{p^2-4q}}{2}$$
But, that isn't necessarily faster than ones you can "see" like $x^2+5x+6$ (where it's clear that $2+3=5;2\cdot 3=6$).