4. The three roots of the polynomial $x^{3}-14 x^{2}+B x-84$ are the sides of a right triangle. Find $B$.
Solution. Let $u, v$ and $w$ be the three roots and suppose that $w^{2}=u^{2}+v^{2}$. By Cardano's relations, $u+v+w=14, uv+uw+vw=B$ and $uvw=84$. If $s=u+v$ and $p=uv$, then we have $s+w=14, pw=84$ and $s^{2}=w^{2}+2p$. Substituting in this last equation the values of $s$ and $p$ in terms of $w$ and simplifying, we get $w^{2}-7w+6=0$, hence $w=1$ or 6. If $w=1$, we would have $s=13, p=84$ and $u$ and $v$ would be the roots of $x^{2}-13x+84=0$, which has no real solutions. Therefore, $w=6, s=8, p=14$ and $B=p+ws=62$. (Indeed, the three roots of $x^{3}-14x^{2}+62x-84$ are $6, 4+\sqrt{2}$ and $4-\sqrt{2}$ and $6^{2}=(4+\sqrt{2})^{2}+(4-\sqrt{2})^{2}$).