2. Find the value of the expression $\frac{p}{q}+\frac{q}{p}$, where $p$ and $q$ are the largest and smallest roots of the equation $x^{3}+6 x^{2}+6 x=-1$, respectively.
Answer: 23.

Solution. The given equation is equivalent to the following

$$
\left(x^{3}+1\right)+6\left(x^{2}+x\right)=0 \Leftrightarrow(x+1)\left(x^{2}-x+1\right)+6 x(x+1)=0 \Leftrightarrow(x+1)\left(x^{2}+5 x+1\right)=0 \text {, }
$$

from which $x=-1$ or $x=\frac{-5 \pm \sqrt{21}}{2}$. The largest root is $p=\frac{-5+\sqrt{21}}{2}$, and the smallest is $-q=\frac{-5-\sqrt{21}}{2}$. Then

$$
\frac{p}{q}+\frac{q}{p}=\frac{-5+\sqrt{21}}{-5-\sqrt{21}}+\frac{-5-\sqrt{21}}{-5+\sqrt{21}}=\frac{(-5+\sqrt{21})^{2}+(-5-\sqrt{21})^{2}}{(-5-\sqrt{21})(-5+\sqrt{21})}=\frac{2(25+21)}{4}=23 .
$$