<s>[INST] Find $r$ such that the equation $x^4+x^2(1-2r)-2x+1=0$ has only one real solution I'm looking for $r$ such that the equation $$x^4+x^2(1-2r)-2x+1=0$$
has only one real solution. I've made some attempts to this problem, but it seems that I even didn't get close to the solution. The approximation for $r$ is 0.3347498 
Is it possible to find analytic solution for $r$ and if yes then how?
Thanks for all the help.
 [/INST] Has noted, the polynomial should have a real double root and two conjugate complex roots, so its general form is
$$
(x-a)^2[(x+p)^2+q^2]
$$
Expanding this, and comparing with our initial polynomial we have the relations
\begin{alignat}{2}
&-&&a^2 p^2-a^2 q^2+1=0,\\
&-&&2 a^2 p+2 a p^2+2 a q^2-2=0,\\
&-&&a^2+4 a p-p^2-q^2-2 r+1=0,\\
&&&2 a-2 p=0
\end{alignat}
From forth equation we have $p=a$, so the system reduce to
\begin{alignat}{2}
&-&&a^4-a^2 q^2+1=0,\\
&&&2 a q^2-2=0,\\
&&&2 a^2-q^2-2 r+1=0
\end{alignat}
From the second we have $q^2=1/a>0$
so the system reduces to
\begin{alignat}{2}
&-&&a^4-a+1=0,\\
&&&2 a^2-\frac{1}{a}-2 r+1=0
\end{alignat}
So the problem is reduced to look for a positive solution to
$$
-a^4-a+1=0
$$
and once found, we have, from the second
$$
r=\frac{2 a^3+a-1}{2 a}
$$
The only positive solution for $a$ is
$$
a=0.7244919590005157
$$
so that
$$
r=0.3347498141075979.
$$
</s>