There are 50 apple trees in an orchard, and each tree produces an average of 200 apples each year. For each additional tree planted within the orchard, the average number of apples produces drop by 5. What is the optimal number of trees to plant in the orchard?

Yield of apples is given by the formula:

y=(200-(x-50)*5)*x, where x is the number of trees, x>50,

or

y=200*x, x≤50;

y(x)=450x-5x

^{2}, x>50y(x)=200x, x≤50

Find the derivative:

y'(x)=450-10x, x>50;

y'(x)=200, x≤50

Since derivative is nowhere zero, the only points to consider are x=0 and x=50. Obviously, x=0 is a minimum, then x=50 is the maximum. So 50 trees shall be planted.