The roots of polynomial $ p(x) $ are:
$$ \begin{aligned}x_1 &= 9.3007\\[1 em]x_2 &= -4.3007 \end{aligned} $$The solutions of $ x^2-5x-40 = 0 $ are: $ x = \dfrac{ 5 }{ 2 }-\dfrac{\sqrt{ 185 }}{ 2 } ~ \text{and} ~ x = \dfrac{ 5 }{ 2 }+\dfrac{\sqrt{ 185 }}{ 2 }$.
You can use step-by-step quadratic equation solver to see a detailed explanation on how to solve this quadratic equation.