I want to know how to answer this question:
Find all polynomial in $\mathbb{R}[X]$ such that the derivative $P' \ | \ P$.
My effort:
We know that
An $n$ degree polynomial has $n$ roots in $\mathbb{C}$.
$P(x) = P'(x) \cdot (ax+b).$
Thus we can suppose that $$P' = b(x-a_1)(x-a_2)\dots(x-a_{n-1}),$$ and $$P = c(x-a_1)(x-a_2)\dots(x-a_{n-1}) (x-a_{n})$$ where $b, c\in \mathbb{R}$ and $a_1,\dots,a_n \in \mathbb{C}$. Take the derivative we have $$P' = c(x-a_2)(x-a_3)\dots(x-a_n)+c(x-a_1)(x-a_2)\dots(x-a_n)+ \dots + c(x-a_2)(x-a_3)\dots(x-a_{n-1}).$$ Since $P'(a_1) = 0$, we then have $c(a_1-a_2)\dots(a_1-a_n) = 0$, thus $x\in \{{a_2,\dots, a_n}\}$. Suppose that $a_1=a_2$. Then $$P = c(x-a_1)^2(x-a_3)\dots(x-a_{n-1}) (x-a_{n}).$$ Hopefully at some point, I can get $P = c(x-a_1)^n$.
Write $P(x) = P'(x) L(x)$, where $L$ has degree $1$.
Write $P(x) = L(x)^m Q(x)$, where $Q$ is coprime with $L$.
Then $P' = m L^{m-1} L' Q + L^m Q'$ and so $L^m Q = P = P'L = m L^{m} L' Q + L^{m+1} Q'$. Therefore, $Q$ divides $ L^{m+1} Q'$. Since, $Q$ is coprime with $L$, $Q$ must divide $Q'$, and this happens iff $Q$ is constant.
Thus, $P=q L^m$.