[tex]\text{Given that,}\\\\P(x) = x^3 -x^2 -18x+k\\\\\text{If the roots are}~ \alpha, ~ \beta,~\text{and}~ \gamma, ~ \text{then},\\\\\alpha +\beta+\gamma= -\dfrac{(-1)}1 = 1\\\\\alpha \beta +\beta \gamma + \gamma \alpha= -\dfrac{18}1 = -18\\ \\\text{Now, sum of the squares of the roots,}\\\\\alpha^2 + \beta^2 + \gamma^2 = ( \alpha + \beta + \gamma)^2 -2(\alpha \beta + \gamma \beta + \gamma \alpha)\\ \\~~~~~~~~~~~~~~~~~~=1^2 - 2(-18)\\\\~~~~~~~~~~~~~~~~~~=1+36\\\\~~~~~~~~~~~~~~~~~~=37[/tex]