To maximize the average annual yield, first get an expression for it so as to get intuition. So solve to find the point M where the derivative of the average annual yield is 0.
Doing so, I get that point occurs when
at this point it'll be helpful to denote the right hand side of this equation, the average annual yield, as AAY.
Now looking at the graph, when M ~ 33 years, y(33)=33*500 > AAY, since the integrand in the expression for AAY would have to be a constant for them to have a chance to be equal. In partiuclar, y(M)>AAY for all values of M<33 years. This means we need to go out further in time, so as to add more area to AAY, while y(M) itself decreases since the function is concave down. 50 years seems reasonable.