To find the amount spent on marketing to achieve the maximum profit, we will analyze the quadratic profit function given by:
\[ P = -5x^2 + 1000x + 5000 \]
This is a quadratic equation of the form \( P = ax^2 + bx + c \), where:
- \( a = -5 \)
- \( b = 1000 \)
- \( c = 5000 \)
For a quadratic equation, the x-coordinate of the vertex gives us the maximum (or minimum) point, depending on the orientation (concave up or down). Since \( a < 0 \) in this case (the parabola opens downwards), the vertex represents the maximum profit.
The x-coordinate of the vertex can be found using the formula:
\[ x = -\frac{b}{2a} \]
Substituting the values of \( a \) and \( b \):
\[ x = -\frac{1000}{2 \times -5} = -\frac{1000}{-10} = 100 \]
Thus, the amount spent on marketing to achieve the maximum profit is:
\[ \boxed{100} \text{ (in thousands of dollars)} \]
This means that the company should spend $100,000 on marketing to achieve the maximum profit.