Solve in $\mathbb{Z}$ the following equations:

(i) $x-1 \mid x+3$.

(ii) $x+2 \mid x^{2}+2$
(i) For $x \in \mathbb{Z}$,

$$
\begin{aligned}
x-1 \mid x+3 & \Longleftrightarrow x-1 \mid (x+3)-(x-1) \\
& \Longleftrightarrow x-1 \mid 4
\end{aligned}
$$

The set of divisors of 4 is $\{-4,-2,-1,1,2,4\}$. Therefore, the set of solutions is $\{-3,-1,0,2,3,5\}$

(ii) For $x \in \mathbb{Z}$,

$$
\begin{aligned}
x+2 \mid x^{2}+2 & \Longleftrightarrow x+2 \mid x^{2}+2-(x+2)^{2} \\
& \Longleftrightarrow x+2 \mid -2-4x \\
& \Longleftrightarrow x+2 \mid 4(x+2)-6 \\
& \Longleftrightarrow x+2 \mid 6 .
\end{aligned}
$$

The set of divisors of 6 is $\{-6,-3,-2,-1,1,2,3,6\}$. Therefore, the set of solutions is $\{-8,-5,-4,-3,-1,0,1,4\}$