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.
 A: We can write the function in following form where $c>0$.
$(x-a)^2((x-b)^2+c)=0$
$(x^2-2ax+a^2)(x^2-2bx+b^2+c)=0$
$x^4-(2a+2b)x^3+(a^2+b^2+4ab+c)x^2-(2ab^2+2ac+2a^2b)x+a^2b^2+a^2c=0$
Therefore,
$b=-a, c={1-a^4\over a^2} > 0$
$2ab^2+2ac+2a^2b=2a^3+{2-2a^4\over a}-2a^3=-2,a^4-a-1=0$
$1-2r=a^2+b^2+4ab+c=2a^2-4a^2+{1-a^4\over a^2}={1-3a^4\over a^2}=-{3a+2\over a^2}$
$r={a^2+3a+2\over 2a^2}$
We take the real root where $a^4<1$ in $a^4-a-1=0$ which is around $-0.72449$ and gives $r$ around $0.33476$. And yes, there is a closed formula for quartic equation using radicals so $r$ also has an exact formula as well, but it should be pretty messy.
A: 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.
$$
A: Equation $$x^4 + x^2 (1 - 2 r) - 2 x + 1 = 0$$
has only one real solution if the curve $y=x^4 + x^2 (1 - 2 r) - 2 x + 1$ is tangent to $x$-axis, that is: the curve has a absolute minimum, provided that $y''=2 (1-2 r)+12 x^2$ is positive, which means $1-2r>0\to r<\frac{1}{2}$
Derivative is $y'=4 x^3 +2 (1-2 r) x-2$. We have $y'=0$ for $r=\frac{2 x^3+x-1}{2 x}$.
Substitute in the given equation
$$x^4 + x^2 \left(1 - 2\cdot \frac{2 x^3+x-1}{2 x}\right) - 2 x + 1 = 0$$
which gives
$$x^4+x-1=0$$
Real solutions are
$$x_1=-1.22074;\;x_2= 0.724492$$
Correspondent $r$ values are
$$r_1=2.3998;\; r_2=0.33475$$
$r_1$ must be discarded because it is larger than $1/2$ so the unique solution is
$$r = 0.33475$$
