Factoring $x^4 + 12x^3 + 46x^2 + 59x + 18$ 
How do I factorize the following?
$$x^4 + 12x^3 + 46x^2 + 59x + 18$$

I've tried looking for a root by trial and error to no avail.
The answer is
$$(x^2 + 5x + 2)(x^2 + 7x + 9)$$
 A: There is an algorithm for factorizing quartic polynomials with rational coefficients.
The first step is to use the rational roots theorem to determine whether or not the polynomial has rational roots. Yours has none.
The second step is to replace your quartic by its reduced version: in your case it's$$q(x)=p(x-3)=x^4-8x^2-x+12.$$Now, let $r(x)$ be the resolvent cubic of $q(x)$, which is $y^3-16y^2+16y-1$. Does it have a rational root which happens to be the square of another rational number? Yes: $1(=1^2)$. Then it follows from what is described here that$$q(x)=\left(x^2-x-4\right) \left(x^2+x-3\right)$$and that therefore$$p(x)=r(x+3)=\left(x^2+5 x+2\right) \left(x^2+7 x+9\right)$$indeed.
A: There are quiet a few ways to do it.
First of all you can find the zeros of this polynomial by Ferrari's method. As you find it, you can surely factorize the polynomial.
Another way  is to use Descartes' rule of sign which gives you a hint where the roots of the equation $f(x)=0$ lie.
Also if $f(\alpha).f(\beta)<0$ then you are quiet sure that at least one root of $f(x)=0$ lies between $\alpha$ and $\beta$. By trial and error method, you can find that root.
A: The first step is check for linear factors.  By the rational roots theorem, the only possible rational roots are $\pm 1, \pm 3, \pm 9, \pm 2, \pm 6, \pm 18$.  Once you have eliminated linear factors, the only possible factorization is as two quadratics.
With that out of the way, a good general technique to look for factorizations is to reduce mod n for various n.  If $f(x)=p(x)q(x)$, then reducing mod n yields a factorization for $f(x) \pmod n$.  If $n$ is bigger than any of the coefficients of $p, q,$ or $f$, then we can read off the actual factorization from the modular factorization.
To figure out what primes we might attempt to reduce modulo, let us compute $f(k)$ for small values of $k$, as a factor here will yield that $k$ is a root mod that factor.
Working mod 2, we have $f(x)=x^4+x=x(x+1)(x^2+x+1)$, the last factor being irreducible mod 2.  Working mod 3, $f(x)=x^4+x^2-x=x(x+1)(x^2-x-1)$, the last term also being irreducible mod 3. Computing $f(k)$ for small values of $k$ and factoring to find primes such that $f(k)$ will have at least one linear factor, we see that $(x+8)$ will be a factor mod 13 and 17, and $(x-3)$ will b a factor mod 13.  We get $f(x)\equiv (x-3)^3(x+8) \pmod{13}$ and $f(x)\equiv (x+3)(x-1)(x-6)^2 \pmod{17}$.
Thus, either $p(x)\equiv (x-3)^2 \pmod{13}$ and $q(x)\equiv (x-3)(x+8) \pmod{13}$ or vice versa.  Similarly, $p(x)\equiv (x-6)^2,(x-6)(x-1),(x-6)(x+3)$, or $(x-1)(x+3)\pmod{17}.$
Just using the mod 13 and 17 information is enough to find the factors mod 221, which is enough to specify the factors entirely.  The mod 2 and 3 information serves as a good double-check.  There are still a few combinations to check, but it makes the problem tractable.
The advantage of this method is that when a factorization does NOT exist, this can potentially show that too, by narrowing down what the shape of the factorization would have to be, and getting contradictory information.  For example, if you had $f(x)=x^5+15x^2+3$, then mod 3, this would either factor as $x(x^4)$ or $x^2(x^3)$, and since the constant term is not divisible by $9$, neither of these can happen.  This particular case can be extended to Eisenstein's criterion, but the general idea is useful more broadly.
