Charles Link said:
Edit: and I still recommend everyone try Vieta's substitution that I mentioned in post 12 to get the exact solution to this thing by hand. In the form the cubic is in, (first mentioned by
@anuttarasammyak in post 4 ) without the ## x^2 ## term, it is ideal for Vieta's substitution.
@Gavran 's cubic (with the ## x ## distance between the two points as the variable) needs the translation to the ## x_ 1## term to get it in the form that is ideal for Vieta's substitution. (The ## x^2 ## term in the cubic needs to get eliminated). See
https://mathworld.wolfram.com/VietasSubstitution.html
Analytical solution by using Vieta's substitution:
## \begin{align}
&a^3-9a^2+21a-3=0\nonumber\\
&a^3-3a^23+3a9-27-3a9+27+21a-3=0\nonumber\\
&(a-3)^3-6a+24=0\nonumber\\
&(a-3)^3-6a+18-18+24=0\nonumber\\
&(a-3)^3-6(a-3)+6=0\nonumber\\
&a-3=w+\frac{6}{3w}=w+\frac{2}{w}\implies w^3+\frac{2^3}{w^3}+6=0\nonumber\\
&w^6+6w^3+2^3=0\nonumber\\
&w^3_{1,2}=\frac{-6\pm\sqrt{36-32}}{2}=-3\pm1\implies w_{1,2}=\sqrt[3]{-3\pm1}\nonumber\\
&a_{1,2}=3+\sqrt[3]{-3\pm1}+\frac{2}{\sqrt[3]{-3\pm1}}=\frac{\sqrt[3]{(-3\pm1)^2}+3\sqrt[3]{-3\pm1}+2}{\sqrt[3]{-3\pm1}}\nonumber\\
&a_1=\frac{\sqrt[3]{(-3+1)^2}+3\sqrt[3]{-3+1}+2}{\sqrt[3]{-3+1}}=-\frac{\sqrt[3]{4}-3\sqrt[3]{2}+2}{\sqrt[3]{2}}\nonumber\\
&a_2=\frac{\sqrt[3]{(-3-1)^2}+3\sqrt[3]{-3-1}+2}{\sqrt[3]{-3-1}}=-\frac{\sqrt[3]{16}-3\sqrt[3]{4}+2}{\sqrt[3]{4}}\nonumber\\
&a_2=-\frac{\sqrt[3]{2}\sqrt[3]{8}-3\sqrt[3]{2}\sqrt[3]{2}+\sqrt[3]{2}\sqrt[3]{4}}{\sqrt[3]{2}\sqrt[3]{2}}=-\frac{2-3\sqrt[3]{2}+\sqrt[3]{4}}{\sqrt[3]{2}}\nonumber\\
&a_1=a_2=a\nonumber\\
&b=\frac{a}{3-a}=-\frac{2-3\sqrt[3]{2}+\sqrt[3]{4}}{2+\sqrt[3]{4}}\nonumber\\
&\sqrt{a^2+b^2}=-(2-3\sqrt[3]{2}+\sqrt[3]{4})\sqrt{\frac{\sqrt[3]{4}+4+4\sqrt[3]{4}+\sqrt[3]{16}}{\sqrt[3]{4}(2+\sqrt[3]{4})^2}}\nonumber\\
&\sqrt{a^2+b^2}=-\frac{2-3\sqrt[3]{2}+\sqrt[3]{4}}{\sqrt[3]{2}(2+\sqrt[3]{4})}\sqrt{5\sqrt[3]{4}+4+2\sqrt[3]{2}}=0.1618203139\nonumber\\
\end{align} ##