Find the least possible value of $n$ such that there exist $P(x), Q(x) \in \mathbb{Z}[x]$ Find the least possible value of $n, n \geq 2015$ such that there exists polynomial $P(x)$ with degree $n$, integer coefficients, the coefficient of the term $x^n$ is positive and polynomial $Q(x)$ with integer coefficients satisfying the following equation for all $x \in \mathbb{R}$:
$$x(P(x))^2 - 2P(x) = (x^3-x)(Q(x))^2$$
Source: This problem is from my school competition. I tried a few attempts in the exam room but they didn't seem to work. So far I concluded $degQ=degP-1$ and the two leading coefficients of $P(x)$ and $Q(x)$ are equal (assuming that the first coefficient of $Q(x)$ is positive, otherwise we could consider $-Q(x)$ instead), and $x$ divides $P(x)$
 A: Let us first consider the equation$$(U(x))^2 - 1 = (x^2 - 1)(V(x))^2,\tag*{$(1)$}$$with $U$, $V \in \mathbb{R}[x]$, with highest coefficients of $U(x)$, $V(x)$ both positive.

Lemma 1. $(1)$ has at most one solution per degree of $P(x) \ge 1$.

Proof. Let $k$ be the degree of $U(x)$. We get $n > 0$, else we would have $V(x) = 0$ for all $x$, whose highest coefficient is not positive. $U(x)$ and $V(x)$ have no common root. Taking the derivative, we get then that $V(x)$ divides $U'(x)$ and so, since they have same degrees, $V(x) = \alpha U'(x)$. The equation is then$$(U(x))^2 - 1 = \alpha^2(x^2 - 1)(U'(x))^2.$$Taking the derivative, we get$$U(x) = \alpha^2(xU'(x) + (x^2 - 1)U^{\prime\prime}(x)).$$Looking at coefficients identification, we get that $\alpha^2 = 1/k^2$ and that all coefficients are fully defined when $a_n$ is chosen. Then plugging $x = 1$ into the original equation, we get $U(1)^2 = 1$ and so $a_k$ is determined and so at most one solution per degree.$$\tag*{$\square$}$$

Lemma 2. $(1)$ has exactly one solution per degree of $U(x) \ge 1$.

Proof. Let $U_k(x)$ be the uniquely polynomial defined as $\cos kx = U_k(\cos x)$. Let $V_k(x)$ be the unique polynomial defined as $\sin kx = (\sin x)V_k(\cos x)$. The degree of $U_k(x)$ is $k$ while the degree of $V_k(x)$ is $k - 1$. The highest coefficient of $U_k(x)$ is greater than $0$. We have$$(U_k(\cos x))^2 - 1 = \cos^2 kx - 1 = -\sin^2 kx = -(\sin^2x) (V_k(\cos x))^2 = (\cos^2x - 1)(V_k(\cos(x))^2.$$And so$$(U_k(x))^2 - 1 = (x^2 - 1)(V_k(x))^2.$$And so, for degree $k \ge 1$, the only solution to $(1)$ is $(U_k(x), \pm V_k(x))$, where the $\pm$ depends on the sign of the highest degree coefficient in $V_k(x)$.$$\tag*{$\square$}$$We head back to the original equation. The equation may be written as$$(xP(x) - 1)^2 - 1 = (x^2 - 1)(xQ(x))^2.$$And so $xP(x) - 1 = U_k(x)$ since highest coefficients are positive, and $xQ(x) = \pm V_k(x)$.


*

*If $n \equiv 1 \text{ mod }2$: $U_k(0) = U_k(\cos \pi/2) = \cos k\pi/2 = 0$, and so no suitable $P(x)$.

*If $n \equiv 0 \text{ mod }4$: $U_k(0) = U_k(\cos \pi/2) = \cos k\pi/2 = 1$, and so no suitable $P(x)$.

*If $n \equiv 2 \text{ mod }4$: $U_k(0) = U_k(\cos \pi/2) = \cos k\pi/2 = -1$, and one suitable $P(x) = (U_k(x) + 1)/x$.


And so solutions exist only when the degree of $P(x)$ is in the form $4n + 1$. Hence, the answer is $n = 2017$.
