Yes you can use derivative, wasn't sure if this was a calculus or pre-calculus question. The positive values for both x and y occur between the 2 roots of the parabola and nowhere else as a quick sketch will show so,

and

That range for y is a bit sneaky... if you pick x to range between 0 and 300 then y will range between 0 and 150 but i suppose the roles of x and y can be reversed without fear so technically you get both between 0 and 300.

The indent may have something to do with your settings but i don't know what, i'm using the same code as you but i don't get that indent.

P.S. If you're going to use calculus you will need to prove x = 150 gives the maximum by using the 1st derivative test.