Example 1 Given that $a$ is a positive integer. If the roots of the equation
$$
x^{3}+(a+17) x^{2}+(38-a) x-56=0
$$

are all integers, find the value of $a$ and the integer roots of the equation.
(2007, National Junior High School Mathematics League)
It is known that the equation has an integer root $x_{1}=1$, then
$$
(x-1)\left(x^{2}+(a+18) x+56\right)=0 \text {. }
$$

Thus, the equation in terms of $x$
$$
x^{2}+(a+18) x+56=0
$$

has integer roots.
Therefore, its discriminant $\Delta=(a+18)^{2}-224$ should be a perfect square.
Let $(a+18)^{2}-224=k^{2}$ (where $k$ is a non-negative integer). Then
$$
(a+18)^{2}-k^{2}=224 \text {, }
$$

which means $(a+18+k)(a+18-k)=224$.
Obviously, $a+18+k$ and $a+18-k$ have the same parity, and $a+18+k \geqslant 18$.
Since $224=112 \times 2=56 \times 4=28 \times 8$, we have
$\left\{\begin{array}{l}a+18+k=112, \\ a+18-k=2 ;\end{array}\left\{\begin{array}{l}a+18+k=56, \\ a+18-k=4 ;\end{array}\right.\right.$
$\left\{\begin{array}{l}a+18+k=28, \\ a+18-k=8 .\end{array}\right.$
Since $a$ is a positive integer, it can only be
$$
\left\{\begin{array} { l } 
{ a = 3 9 , } \\
{ k = 5 5 ; }
\end{array} \left\{\begin{array}{l}
a=12, \\
k=26 .
\end{array}\right.\right.
$$

When $a=39$, the equation (1) becomes
$$
x^{2}+57 x+56=0 \text {, }
$$

with roots -1 and -56, so the three roots of the original equation are
$$
x_{1}=1, x_{2}=-1, x_{3}=-56 .
$$

When $a=12$, the equation (1) becomes
$$
x^{2}+30 x+56=0 \text {, }
$$

with roots -2 and -28, so the three roots of the original equation are
$$
x_{1}=1, x_{2}=-2, x_{3}=-28 .
$$

In summary, the values of $a$ are 12 and 39: when $a=12$, the integer roots of the equation are $1, -2, -28$; when $a=39$, the integer roots of the equation are $1, -1, -56$.