I am reading "A Course in Analysis 1" by Kazuo Matsuzaka.
In this book, the author wrote the following fact without a proof:
A polynomial $f(x)$ is divisible by $(x-a)^k$ but is not divisible by $(x-a)^{k+1}$ iff there is a polynomial $g(x)$ such that $f(x) = (x-a)^k g(x)$ and $g(a) \neq 0$.
A polynomial has the unique factorization. If I use this fact, it is easy to prove the above fact.
But in this book, the author didn't write about the unique factorization of a polynomial.
My attempt is here:
Suppose that a polynomial $f(x)$ is divisible by $(x-a)^k$ but is not divisible by $(x-a)^{k+1}$.
Then, there is a polynomial $g(x)$ such that $f(x) = (x-a)^k g(x)$.
If $g(a) = 0$, then, there is a polynomial $h(x)$ such that $g(x) = (x-a) h(x)$.
So, $f(x) = (x-a)^k (x-a) h(x) = (x-a)^{k+1} h(x)$.
So, $f(x)$ is divisible by $(x-a)^{k+1}$.
This is a contradiciton.
I cannot prove the converse.
Suppose that $f(x)=(x-a)^kg(x)$, $g(a)\neq 0$ and $f(x)=(x-a)^{k+1}h(x)=(x-a)^kg(x)$, this implies that $g(x)=(x-a)h(x)$ and $g(a)=0$ contradiction.