To find the amount spent on marketing (represented by \( x \)) that achieves the maximum profit, we need to determine the vertex of the quadratic function given by:
\[ P(x) = -5x^2 + 1000x + 5000 \]
The formula for the vertex \( x \) of a quadratic equation in the form \( ax^2 + bx + c \) is given by:
\[ x = -\frac{b}{2a} \]
In this case, \( a = -5 \) and \( b = 1000 \). Plugging in these values, we get:
\[ x = -\frac{1000}{2 \times -5} = -\frac{1000}{-10} = 100 \]
Thus, the amount of spending directed toward marketing to achieve maximum profit is:
\[ \boxed{100} \text{ (in thousands of dollars)} \]