5. Find all ordered integer pairs $(p, q)$ such that the quartic equation
$$
x^{4}+2 p x^{2}+q x+p^{2}-36=0
$$

has four integer roots (repeated roots are allowed).
5. Suppose the original equation has four integer roots $a, b, c, -a-b-c$.
By Vieta's formulas, we have
$$
\begin{array}{l}
2 p=a b+b c+c a-(a+b+c)(a+b+c) \\
=-\left(a^{2}+b^{2}+c^{2}+a b+b c+c a\right), \\
-q=a b c-(a b+b c+c a)(a+b+c) .
\end{array}
$$

Then $-4 p=(a+b)^{2}+(b+c)^{2}+(c+a)^{2}$,
$$
q=(a+b)(b+c)(c+a) \text {. }
$$

From equation (1), we know that $a+b, b+c, c+a$ are all even.
Let $a+b=2 u, b+c=2 v, c+a=2 w$, where $u, v, w$ are all integers. Then
$$
\left\{\begin{array}{l}
-p=u^{2}+v^{2}+w^{2}, \\
q=8 u v w,
\end{array} \text { and } \left\{\begin{array}{l}
a=u-v+w, \\
b=u+v-w, \\
c=-u+v+w .
\end{array}\right.\right.
$$

By Vieta's formulas, we have
$$
\begin{array}{l}
p^{2}-36=-a b c(a+b+c) . \\
\text { Hence }\left(u^{2}+v^{2}+w^{2}\right)^{2}-36 \\
=-(u-v+w)(u+v-w)(-u+v+w) . \\
\quad(u+v+w) \\
=u^{4}+v^{4}+w^{4}-2 u^{2} v^{2}-2 v^{2} w^{2}-2 w^{2} u^{2},
\end{array}
$$

which simplifies to $u^{2} v^{2}+v^{2} w^{2}+w^{2} u^{2}=9$.
Without loss of generality, assume
$$
\left((u v)^{2},(v w)^{2},(w u)^{2}\right)=(9,0,0)
$$

or $\left((u v)^{2},(v w)^{2},(w u)^{2}\right)=(4,4,1)$.
If $\left((u v)^{2},(v w)^{2},(w u)^{2}\right)=(9,0,0)$, then $w=0, u v= \pm 3$.
Thus, $p=-10, q=0$.
In this case, the quartic equation
$$
\begin{array}{l}
x^{4}-20 x^{2}+64 \\
=(x+4)(x-4)(x+2)(x-2)=0
\end{array}
$$

has four integer roots.
If $\left((u v)^{2},(v w)^{2},(w u)^{2}\right)=(4,4,1)$, then $u^{2}=w^{2}=1, v^{2}=4$.
Thus, $p=-6, q= \pm 16$.
In this case, the quartic equations
$$
\begin{array}{l}
x^{4}-12 x^{2}+16 x=x(x-2)^{2}(x+4)=0, \\
x^{4}-12 x^{2}-16 x=x(x+2)^{2}(x-4)=0
\end{array}
$$

both have four integer roots.
In summary, the integer pairs $(p, q)$ that satisfy the conditions are
$$
(p, q)=(-10,0),(-6,16),(-6,-16) \text {. }
$$