In order to use the Pythagorean Theorem to find out if a triangle has a right angle, you have to determine If the squares of the two shorter sides add up to the square of the hypotenuse, then you know the triangle contains a right angle.
I'm fairly certain you have an error in your equation as the curve you suggests opens upward so has no maximum profit. Profit becomes positive on completion of the 7th unit. (curve crosses x axis at (6.056, 0))
I will GUESS that the equation should read
P(x) = - 2x² + 120x – 800
Maximum will occur when the derivative is zero (zero slope)