5. Given the sets
$$
\begin{array}{l}
M_{1}=\{x \mid(x+2)(x-1)>0\}, \\
M_{2}=\{x \mid(x-2)(x+1)>0\} .
\end{array}
$$

Then the set equal to $M_{1} \cup M_{2}$ is ( ).
(A) $\left\{x \mid\left(x^{2}-4\right)\left(x^{2}-1\right)>0\right\}$
(B) $\left\{x \mid\left(x^{2}+4\right)\left(x^{2}-1\right)>0\right\}$
(C) $\left\{x \mid\left(x^{2}-4\right)\left(x^{2}+1\right)>0\right\}$
(D) $\left\{x \mid\left(x^{2}+4\right)\left(x^{2}+1\right)>0\right\}$
5.B.

From $M_{1}$ we have $x1$.
From $M_{2}$ we have $x2$.
Since the union of $x>1$ and $x2$ are respectively
$$
\begin{array}{l}
|x|>1, \\
|x|>2,
\end{array}
$$

thus, the union of equations (1) and (2) is $|x|>1$, which is $x^{2}-1>0$.
Therefore, $\left(x^{2}+4\right)\left(x^{2}-1\right)>0$.