now, a double root, or a root with a multiplicity of 2, means the root is there twice, namely, for a quadratic, that has a root of say "a", like x² + bx + c, the roots will be 0 = (x + a)(x + a), which produces a root of "a" twice, or a zero with a multiplicity of 2.
so. hmmmm let's use that, keeping in mind that, in the trinomial, the middle term, as you know from factoring, is ax + ax, or 2ax. The constant or last term is just the product of a * a, or a², thus
[tex]\bf 0=(x+a)(x+a)\implies x^2+2ax+a^2
\\\\\\
\textit{but we know the coefficient of the middle term is }p-2
\\\\\\
therefore\qquad 2a~=~p-2\implies \boxed{2a+2=p}\\\\
-------------------------------\\\\
\textit{and we also know the constant is }3p+1
\\\\\\
therefore\qquad a^2=3p+1\implies a^2=3\left( \boxed{2a+2} \right)+1
\\\\\\
a^2=6a+6+1\implies a^2-6a-7=0
\\\\\\
(a-7)(a+1)=0\implies a=
\begin{cases}
7\\
-1
\end{cases}[/tex]