Find all integers $n$ for which $x^6 + nx^2 − 1$ can be written as a product of two non-constant polynomials with integer coefficients. Find all integers $n$ for which $x^6 + nx^2 − 1$ can be written as a product of two non-constant polynomials with integer coefficients.
I first tried expanding: $(x^3+ax^2+bx+1)(x^3+cx^2+dx-1)$ and equating coefficients.
This yields the following relationships:
$$a+c = 0$$
$$ac+b+d = 0$$
$$-b+d = 0$$
and
$$n = -a+bd+c$$
Is this the right approach? How should I go about doing it?
 A: This is not too difficult to do case-by-case. Write $f(x)=x^6+nx^2-1$.

*

*By the rational root theorem, the only possible linear factors are $x\pm1$. They are both factors if and only if $n=0$, when $f(x)=(x-1)(x+1)(x^4+x^2+1)$.

*The OP is well on their way to solving the case of two cubics. As the other steps also use this technique, let us record the fact that $f(x)$ is even. In other words $f(x)=f(-x)$. We combine this with the uniqueness of factorization of polynomials (up to unit factors). When concentrating on the case of a factorization into two irreducible cubics, $f(x)=p(x)q(x)$, we see that without loss of generality we can assume $p$ and $q$ to both be monic. As also $f(x)=p(-x)q(-x)$ we have two possibilities. Either $p(-x)=-p(x)$ or $p(-x)=-q(x)$. The former case is impossible, because then $p(0)=0$, and hence also $0=f(0)=1$, which is a contradiction. So if
$p(x)=x^3+ax^2+bx+c$ then $q(x)=x^3-ax^2+bx-c$. Without loss of generality we can assume that $c=1$ (interchange $p$ and $q$ otherwise). In this case
$$
\begin{aligned}f(x)&=p(x)q(x)\\
&=(x^3+bx)^2-(ax^2+1)^2\\
&=x^6+(2b-a^2)x^4+(b^2-2a)x^2-1.
\end{aligned}
$$
A look at the degree four terms tells us that $a$ must be even, say $a=2k$, and $b=2k^2$. Therfore the coefficient of the quadratic term is
$$n=(2k^2)^2-2\cdot(2k)=4k^4-4k.$$
Here the parameter $k$ can be any integer. The corresponding factorization is
$$f(x)=(x^3+2kx^2+2k^2x+1)(x^3-2kx^2+2k^2x-1).$$

*Let us then consider the case of $f(x)=p(x)q(x)$, where $p(x)$ is an irreducible quadratic factor. As above, we conclude that $p(-x)$ is also a factor. Either $p(x)=p(-x)$ or $q(x)=p(-x)r(x)$ where $r(x)$ is yet another irreducible quadratic factor. As $r(-x)$ must also be a factor, in all cases we have either $p(x)=p(-x)$ or $r(x)=r(-x)$, and can conclude that $f(x)$ has a factor without the linear term. In other words $x^2-m\mid f(x)$ for some $m\in\Bbb{Z}$. Plugging in $x^2=m$ tells us that
$$f(\sqrt m)=m^3+nm-1=0.$$
Therefore
$$m(m^2+n)=1.$$
This allows us to conclude that either $m=1$, $n=0$ (a case covered earlier) or $m=-1$, $n=-2$. The new possibility we got out of this is thus
$$
f(x)=x^6-2x^2-1=(x^2+1)(x^4-x^2-1).
$$

Either $n=-2$ or $n=4k^4-4k$ for some integer $k$.

