To find the amount spent on marketing that will achieve the maximum profit, we can analyze the quadratic profit function:
\[ P = -5x^2 + 1000x + 5000 \]
This is a quadratic function in the standard form \(P = ax^2 + bx + c\), where:
- \(a = -5\)
- \(b = 1000\)
- \(c = 5000\)
Since \(a < 0\), this parabola opens downwards, which means it has a maximum point.
The \(x\)-coordinate of the vertex of a parabola given by the function \(P = ax^2 + bx + c\) can be found using the formula:
\[ x = -\frac{b}{2a} \]
Substituting in the values of \(a\) and \(b\):
\[ x = -\frac{1000}{2 \cdot -5} = -\frac{1000}{-10} = 100 \]
Thus, the maximum profit occurs when \(x = 100\).
Therefore, the amount spent on marketing to achieve maximum profit is:
\[ \boxed{100} \text{ (in thousands of dollars)} \]