2. Determine the real numbers $a$ and $b$ for which the polynomial $a x^{3}+b x+2$ is divisible by $(x-1)^{2}$.
First solution.

By division:

![](https://cdn.mathpix.com/cropped/2024_05_30_460b0238d86ae9459a11g-2.jpg?height=259&width=1148&top_left_y=2289&top_left_x=461)

we obtain the remainder $(3a + b)x + (-2a + 2)$

(10 points)

The polynomial $p(x) = ax^3 + bx + 2$ is divisible by $(x-1)^2 = x^2 - 2x + 1$ if and only if the remainder of the division of the polynomial $p(x)$ by $(x-1)^2$ is zero, so it must be $3a + b = 0$ and $-2a + 2 = 0$.

(5 points)

Solving this system, we get $a = 1, b = -3$.

(5 points)

Note. For $P(x)$ to be divisible by $(x-1)^2$, it must be $P(1) = 0$ and $P'(1) = 0$, so we get $a + b + 2 = 0, 3a + b = 0$, from which it follows that $a = 1, b = -3$.

Second solution.

We will express the polynomial $p(x) = ax^3 + bx + 2$ in terms of powers of $(x-1)$.

\[
\begin{aligned}
ax^3 + bx + 2 & = a[(x-1) + 1]^3 + b[(x-1) + 1] + 2 \\
& = a(x-1)^3 + 3a(x-1)^2 + 3a(x-1) + a + b(x-1) + b + 2 \\
& = a(x-1)^3 + 3a(x-1)^2 + (3a + b)(x-1) + (a + b + 2)
\end{aligned}
\]

(10 points)

is divisible by $(x-1)^2$ if and only if $3a + b = 0$ and $a + b + 2 = 0$.

(5 points)

Solving this system, we get $a = 1$ and $b = -3$.

(5 points)