How to do junior math Olympiad question Let $a$ and $b$ be such that $0<a<b$. Suppose that $a^3 = 3a-1$ and $b^3 =  3b-1$.   Find $b^2 -a$.

Since $0<a<b$ and $a^3=3a-1$ and $b^3=3b-1$, then we need to find the two positive real roots of $x^3-3x+1=0$ with $a$ being the smaller root and $b$ being the bigger root.
Following Cardano's solution, if we let $x=u+v$ then
$$
\begin{align*}
x^3-3x+1&=0\\
(u+v)^3-3(u+v)+1&=0\\
u^3+3u^2v+3uv^2+v^3-3u-3v+1&=0\\
u^3+v^3+1+3u^2v-3u+3uv^2-3v&=0\\
(u^3+v^3+1)+3(u+v)(uv-1)&=0\\
\end{align*}
$$
So we want to find the simultaneous solution to the following system:
$$
\begin{align*}
u^3+v^3&=-1\\
uv&=1.
\end{align*}
$$
By substituting $u=\frac1v$ into the first equation we have
$$
\frac1{v^3}+v^3=-1\iff v^6+v^3+1=0.
$$
Then the quadratic formula tells us
$$v^3=\frac{-1+i\sqrt{3}}{2}=e^{2\pi i/3}\iff v=e^{2\pi i/9}\implies u=e^{-2\pi i/9}$$
or
$$v^3=\frac{-1-i\sqrt{3}}{2}=e^{4\pi i/3}\iff v=e^{4\pi i/9}\implies u=e^{-4\pi i/9}.$$
So the two real positive solutions are
$$
\begin{align*}
a&=e^{-4\pi i/9}+e^{4\pi i/9}=2\cos\left(\frac{4\pi}{9}\right)\\
b&=e^{-2\pi i/9}+e^{2\pi i/9}=2\cos\left(\frac{2\pi}{9}\right)\\
\end{align*}
$$
and we see that
$$
\begin{align*}
b^2-a&=4\cos^2\left(\frac{2\pi}{9}\right)-2\cos\left(\frac{4\pi}{9}\right)\\
&=4\cos^2\left(\frac{\frac{4\pi}{9}}{2}\right)-2\cos\left(\frac{4\pi}{9}\right)\\
&=4\left(\frac{1+\cos\left(\frac{4\pi}{9}\right)}{2}\right)-2\cos\left(\frac{4\pi}{9}\right)\\
&=2+2\cos\left(\frac{4\pi}{9}\right)-2\cos\left(\frac{4\pi}{9}\right)\\
&=2.
\end{align*}
$$
