To find the amount spent on marketing that will achieve the maximum profit, we need to determine the vertex of the quadratic function given by:
\[ P = -5x^2 + 1000x + 5000 \]
The vertex \( x \) of a quadratic function in the form \( ax^2 + bx + c \) can be calculated using the formula:
\[ x = -\frac{b}{2a} \]
In this equation:
- \( a = -5 \)
- \( b = 1000 \)
Substituting the values of \( a \) and \( b \) into the vertex formula:
\[ x = -\frac{1000}{2 \times -5} = -\frac{1000}{-10} = 100 \]
Thus, the amount that should be spent on marketing to achieve the maximum profit is:
\[ \boxed{100} \text{ (in thousands of dollars)} \]