The profit is a max (or min) if dP/dx = 0.
Is it a maximum?
d2P/dx2 = -0.04 < 0 for all x, so we have a maximum.
When x = 200, P = $800.
So if the company refines 200 barrels per day, the maximum profit of $800 is reached.