x=additional trees planted
total yield = numtrees*yield per tree
numtrees = x+25
yield per tree = 500-10x
total yield = (x+25)(500-10x)
to maximize yield, differentiate and set equal to 0
y' = (x+25)*-10 + (500-10x) = 0
10(x+25) = 500-10x
20x = 250
x = 12.5
to maximize yield 25+12.5 trees should be planted