When graphed, the equation p = x² - 25x + 5000 is a parabola, rising from the vertex.
Since it has a minimum point and opens upward, the problem is to find the vertex (which is the location of the minimum point).
This can be done in several ways: one way is to graph it, another is to use a formula, and a third is to "complete the square".
The following explains how to complete the square:
First, move the constant term to the other side:
---> p - 5000 = x² - 25x
Second, divide the coefficeint of the linear term by 2, and square the result:
---> -25 ÷ 2 = -12.5
---> (-12.5)² = 156.25
Third, add this value to both sides:
---> p - 5000 + 156.25 = x² - 25x + 156.25
Fourth, simplify the left side and factor the right side:
---> p - 4843.75 = (x - 12.5)²
Fifth, determine the vertex:
---> x = 12.5, y = 4843.75
The minimum value is the y-value: 4843.75