TITLE: $f$ is a polynomial and $f(0)\neq0$. Why is $fg+x$ a perfect square for some $g$?
QUESTION [5 upvotes]: On Hacker News, someone posted the following exercise: prove that every nonsingular complex symmetric matrix $M$ has a symmetric matrix square root.
This is old chestnut. As the poster indicated, essentially every nonsingular Jordan block $J$ has a square root that is a polynomial in $J$. Therefore, using Hermite interpolation (we need Hermite rather than Lagrange because the Jordan form can have multiple and different-sized Jordan blocks for the same eigenvalue), one can show that $M$ has a square root in the form of $p(M)$ for some polynomial $p$.
However, this implies that the minimal polynomial $f(x)$ of $M$ must divide $p(x)^2-x$. In other words,

given any non-constant polynomial $f\in\mathbb C[x]$ such that $f(0)\neq0$, there exists a polynomial $g$ such that $f(x)g(x)+x$ is a perfect square.

I think this bullet statement somehow must have an elementary proof that is based solely on abstract algebra, but I have forgotten most of what I learnt from class. Any idea?

REPLY [3 votes]: It suffices to find a polynomial $h(x)$ such that
$$h^2(x) \equiv x \bmod{f(x)}.$$
If we factor $f(x) = \prod_{i}(x - \lambda_i)^{a_i}$, then by the chinese remainder theorem, suffice to find $h_i(x)$ such that
$$h_i(x)^2 \equiv x \bmod{(x - \lambda_i)^{a_i}}.$$
Now use $\lambda_i \neq 0$ and Hensel lifting to finish the proof. Essentially, first note that $h_i^1(x) = \sqrt{\lambda_i}$ satisfies the above for $a_i = 1$, then inductively construct the $h_i$ that satisfies the above for arbitrary $a_i$.