find the maximum profit of P(x)=4000-(1000/(x-2))

This is undefined at x = 2

If x is slightly less than 2 it will be huge positive
If x is slightly more than 2 it will be huge negative
So it gets big as x approaches 2 from the origin, and becomes infinite as x approaches 2