10.18. Provide an example of a polynomial $P(x)$ that is divisible by $x^{2}+1$, and at the same time $P(x)-1$ is divisible by $x^{3}+1$.
10.18. Answer: $P(x)=-\frac{1}{2}\left(x^{2}+1\right)\left(x^{2}+x-1\right)$.

Let $P(x)=U(x)\left(x^{2}+1\right)$ and $P(x)=V(x)\left(x^{3}+1\right)+1$. Then $U(x)\left(x^{2}+1\right)-V(x)\left(x^{3}+1\right)=1$. To find such polynomials $U$ and $V$, we need to apply the Euclidean algorithm to $a=x^{3}+1$ and $b=x^{2}+1$:

$$
\begin{array}{rlr}
a & =x b+r_{1} & \left(r_{1}=1-x\right), \\
b & =-x r_{1}+r_{2} & \left(r_{2}=x+1\right), \\
r_{1} & =-r_{2}+2 . &
\end{array}
$$

Expressing $r_{1}$ and $r_{2}$ sequentially in terms of $a$ and $b$, we get:

$$
\begin{aligned}
b & =-x(a-b x)+r_{2} \\
a-b x & =-b-x a+x^{2} b+2
\end{aligned}
$$

Thus, $(x+1) a+\left(-x^{2}-x+1\right) b=2$. Therefore, we can set $U(x)=-\frac{1}{2}\left(x^{2}+x-1\right)$ and $V(x)=-\frac{1}{2}(x+1)$.