Modelling the number of apples an orchard yields with diminishing returns per tree This is Exercise 7.9  in the University of Washington's precal book.

Sylvia has an apple orchard.
One season, her 100 trees yielded 140 apples
per tree. She wants to increase her production
by adding more trees to the orchard. However,
she knows that for every 10 additional trees
she plants, she will lose 4 apples per tree (i.e.,
the yield per tree will decrease by 4 apples).
How many trees should she have in the orchard to maximize her production of apples?

Instructing a precal class, I walked through my approach to answering this in class (without preparing) and ended up doing something strange that may have confused the students. How would you clearly explain a way to get the function for the number of apples that we are trying to maximize? More generally, how would approach answering this question? It'd be nice to collect a some different approaches to demonstrate to my students that there is not a single rigid correct way to solve a problem.
Let $t=\text{the number of trees}$
Let $y=\text{the yield per tree}$
We know that when $t=100$, $y=140$. Furthermore, we know that for every $10$ additional trees, the yield decreases by $4$. I'm going to assume that this means that for every additional tree, the yield decreases by $0.4$ (obviously this is an average yield). If I increase the number of trees by $M$, then $t$ and $y$ change as follows:
\begin{align}
t&amp;=100+M \\
y&amp;=140-0.4M
\end{align}
We want the total yield to be as large as possible. This means that $ty$ has to be as large as possible:
\begin{align}
ty&amp;=(100+M)(140-0.4M) \\
&amp;=14000-40M+140M-0.4M^2 \\
&amp;=-0.4M^2+100M+14000 \\
&amp;=-0.4(M^2-250M-35000)
\end{align}
Completing the square on $M^2-250M-35000$, we have
\begin{align}
M^2-250M-35000&amp;=(M-125)^2-125^2-35000\\
&amp;=(M-125)^2-50,625
\end{align}
Hence,
\begin{align}
ty&amp;=-0.4[(M-125)^2-50,625] \\
&amp;=-0.4(M-125)^2+20,250
\end{align}
Since $-0.4(M-125)^2$ is always non-positive, the maximum yield is $20,250$, which occurs when $M=125$. Thus, the total number of trees in the orchard should be $225$.
The way I would explain this is by first recognizing that we are trying to maximize the number of apples. So we need an equation describing the total number of apples produced.
\begin{align}
Total\ Produced = \frac{apples}{tree}\times trees
\end{align}
The first term is the rate of production, for 100 trees $\frac{apples}{tree} = 140$ and $trees$ is the number of trees, i.e., 100.
Next, we need to get derive the equations for both of these terms as a function of the number of additional trees added. Let the letter $x$ denote how many additional trees are planted.

(remark) The question says that &quot;for every 10 additional trees she plants, she will lose 4 apples per tree&quot;, does this mean that if $9$ additional trees are planted that the trees don't produce fewer apples. The question is from a precal book so I am assuming that each additional tree decreases the number of apples produced by $0.4 = \frac{4}{10}$. Otherwise, you will have to give a really confusing explanation like the number of additional trees will have the form $x=9+10y$ because the first 9 trees have no effect on yield per tree and then optimize for $y$.

For the rate of production, we see that
\begin{align}
\frac{apples}{tree} = 140 - \frac{4}{10}x
\end{align}
because &quot;the yield per tree will decrease by 4 apples&quot;. The equation for the number of trees is,
\begin{align}
tress = 100 + x
\end{align}
because we started with $100$ and we are adding $x$ more.
Therefore, the total number of apples produced is $P(x) = (140-\frac{4}{10}x)(100+x)$.

(remark) I'm assuming that at this point they know about solving $\frac{dP}{dx}=0$ will give them a maximum. I would emphasize that setting $\frac{dP}{dx}=0$ gives a maximum and not a minimum because of sign of the $x^{2}$ term.

Differentiating $P$, $\frac{dP}{dx} = -\frac{8}{10}x + 100$, and setting it to zero to find the maximum we get that $x = \frac{1000}{8} = 125$.