To determine the amount of marketing spending that maximizes the profit, we can use the formula for the vertex of a quadratic equation. The profit function \( P(x) = -5x^2 + 1000x + 5000 \) is a quadratic equation in the form \( P(x) = ax^2 + bx + c \), where \( a = -5 \), \( b = 1000 \), and \( c = 5000 \).
The x-coordinate of the vertex of a quadratic function \( ax^2 + bx + c \) can be found using the formula \( x = -\frac{b}{2a} \).
Plugging in the values:
\[ x = -\frac{1000}{2 \cdot -5} = -\frac{1000}{-10} = 100 \]
Therefore, to achieve the maximum profit, the company should spend 100 thousand dollars on marketing.