The roots of polynomial $ p(p) $ are:
$$ \begin{aligned}p_1 &= 1.4029\\[1 em]p_2 &= -2.5458 \end{aligned} $$Step 1:
Combine like terms:
$$ \color{blue}{-5p} + \color{red}{p^2} \color{green}{-8} + \color{red}{6p^2} + \color{blue}{13p} \color{green}{-17} = \color{red}{7p^2} + \color{blue}{8p} \color{green}{-25} $$Step 2:
The solutions of $ 7p^2+8p-25 = 0 $ are: $ p = -\dfrac{ 4 }{ 7 }-\dfrac{\sqrt{ 191 }}{ 7 } ~ \text{and} ~ p = -\dfrac{ 4 }{ 7 }+\dfrac{\sqrt{ 191 }}{ 7 }$.
You can use step-by-step quadratic equation solver to see a detailed explanation on how to solve this quadratic equation.