Do \(y_1,y_2\) là hai nghiệm của PT \(y^2+3y+1=0\) nên theo hệ thức Vi-et ta có: \(\left\{{}\begin{matrix}y_1+y_2=-3\\y_1.y_2=1\end{matrix}\right.\).
Do \(x_1,x_2\) là hai nghiệm của PT \(x^2+px+q=0\) nên ta có \(\left\{{}\begin{matrix}x_1+x_2=-p\\x_1x_2=q\end{matrix}\right.\)
Lại có \(x_1=y_1^2+2y_2;x_2=y_2^2+2y_1\)
\(\Rightarrow\left\{{}\begin{matrix}-p=y_1^2+y_2^2+2\left(y_1+y_2\right)\\q=\left(y_1^2+2y_2\right)\left(y_2^2+2y_1\right)\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}-p=\left(y_1+y_2\right)^2-2y_1y_2+2\left(y_1+y_2\right)\\q=\left(y_1y_2\right)^2+4y_1y_2+2\left(y_1^3+y_2^3\right)\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}-p=\left(y_1+y_2\right)^2-2y_1y_2+2\left(y_1+y_2\right)\\q=\left(y_1y_2\right)^2+4y_1y_2+2\left[\left(y_1+y_2\right)\left(\left(y_1+y_2\right)^2-3y_1y_2\right)\right]\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}-p=\left(-3\right)^2-2.1+2.\left(-3\right)=1\\q=1^2+4.1+2\left(\left(-3\right).\left(3^2-3.1\right)\right)=31\end{matrix}\right.\Rightarrow\left\{{}\begin{matrix}p=-1\\q=31\end{matrix}\right.\)