<s>[INST] If $a + b = 20$, then what is the maximum value of $ab^2$? Knowing that
$$a + b = 20$$
and $a,b \in \mathbb{Z}_{+}$
What is the maximum value that $ab^2$ can take?
If $b$ is even then so is $a$. Hence, let $b = 2k$ and $a = 20 - 2k$, where $k \in \{1, 2, 3, \cdots, 9\}$
$$ab^2 = (20 - 2k)(2k)^2 = 80k^2 - 8k^3$$
The value of $k$ which maximizes $ab^2$ is therefore $k = 7$ which gives $ab^2 = 1176$.
However this only shows that this is the maximum for even values of $a$ and $b$. It turns out that the maximum of $ab^2$ is when both are odd. 
How do I solve this question since my approach is clearly not very elegant? 
My solution:
$$a = 20 - b \Longrightarrow ab^2 = (20 - b)b^2$$
Differentiate to find the maximum value of $b$
$$40b - 3b^2 = b(40-3b) = 0$$ 
$$\Longrightarrow b = \left\lfloor \frac{40}{3} \right\rfloor$$ $$\Longrightarrow b = \left\lceil \frac{40}{3} \right\rceil$$
Therefore $a, b = 7, 13$ or $a, b = 6, 14$. Inspecting these $2$ cases yields the former.
So the maximum value $ab^2$ can take is $1183$.
 [/INST] By AM-GM 
\begin{eqnarray*}
\frac{1}{3} \left( a + \frac{b}{2} +\frac{b}{2} \right) \geq \sqrt[3]{\frac{ab^2}{4}}.
\end{eqnarray*}
So 
\begin{eqnarray*}
4 \left( \frac{20}{3} \right)^3 \geq ab^2.
\end{eqnarray*}
Now the restriction that $a$ and $b$ are integers suggest $(a,b)=(6,14)$ or $(7,13)$ computing these gives $(a,b)=(7,13)$ and a largest value of $1183$.
</s>