Answer
a. $P(x)=(x-1)(x+1)(x^2+9)$
b. $P(x)=(x+1)(x-1)(x-3i)(x+3i)$
Work Step by Step
a) See The Rational Zero Theorem:
If $\frac{p}{q}$ is a zero of the polynomial $f$ with integer coefficients, then $p$ is a factor of the constant term, $a_{0}$, and $q$ is a factor of the leading coefficient, $a_{n}$.
------------------------
$P(x)=x^4+8x^2-9$
Candidates for zeros, $\frac{p}{q}:$
$p:\qquad \pm 1,\pm3,\pm9$
$q:\qquad \pm 1$
$\displaystyle \frac{p}{q}:\qquad\pm 1, \pm3,\pm9$
Try for $x=1$.
$\begin{array}{lllll}
\underline {1}| & 1& 0 & 8&0& -9\\
& 1& 1 & 9&9\\
& -- & -- & -- & --\\
& 1&1& 9& 9 & |\underline{0}
\end{array}$
$1$ is a zero,
$P(x)=(x-1)(x^3+x^2+9x+9)$,
Factor the quadrinomial:
$x^2(x+1)+9(x+1)=(x^2+9)(x+1)$
thus, $P(x)=(x-1)(x+1)(x^2+9)$
b. Factor the polynomial completely:
$x^2+9=0\Rightarrow x=\pm3i$
$P(x)=(x+1)(x-1)(x-3i)(x+3i)$