Use both!
You want to minimize P, so differentiate P with respect to x and set the derivative equal to 0 and solve for any critical points.
P = 8/x + 2x
dP/dx = -8/x² + 2 = 0
8/x² = 2
x² = 8/2 = 4
x = ± √4 = ± 2
You can then use the second derivative to determine the concavity of P, and its sign at a given critical point decides whether it is a minimum or a maximum.
We have
d²P/dx² = 16/x³
When x = -2, the second derivative is negative, which means there's a relative maximum here.
When x = 2, the second derivative is positive, which means there's a relative minimum here.
So, P has a relative maximum value of 8/(-2) + 2(-2) = -8 when x = -2.