Three real roots of equation is the length of three sides of a right triangle, find the parameter Three real roots of the equation $x^3-2p(p+1)x^2+(p^4+4p^3-1)x-3p^3=0$ is the length of three sides of a right triangle, what is the value of $p$?

Hint: let $a,b,c$ be the roots, then by Vieta's relations:
$$\require{cancel}
\begin{align}
a^2+b^2+c^2 &= (a+b+c)^2 - 2(ab+bc+ca) \\
 &= \left(2p(p+1)\right)^2 - 2(p^4+4p^3-1) \\
 &= 4p^2(p^2+\bcancel{2p}+1) - 2p^4-\bcancel{8p^3}+2 \\
 &= 2(p^4 + 2p^2+1) \\
 &= 2(p^2+1)^2
\end{align}
$$
For the roots to be the sides of a right triangle, one of them, say $a\,$, must satisfy $a^2=b^2+c^2$.
