Proving the product of two real numbers is maximum when the numbers are equal given their sum is constant Let us consider two real numbers $x$ and $y$. How can we prove value of $xy$ is greatest when $x=y$ given the condition $x+y=$ constant?
I have already found a proof, but I am not entirely happy with it yet.

Start with this lemma. Given real numbers $a, b, c \geq 0$, we have:
$$a(a + b + c) \leq (a + c)(a + b)$$
The proof is easy - just expand out the products on both sides. The RHS has an extra $bc$ term.
From this, we can prove what the question asks for the case where $x, y \geq 0$. Suppose $x + y = C$. Then WLOG $x \leq y$ and so $y = x + 2b$ for some $b \geq 0$. And so:
$$xy = x(x + 2b) = x(x + b + b) \leq (x + b)(x + b) = \left(\frac{C}{2}\right)^2$$
So the product is clearly maximised when $x = y = \frac{C}{2}$.
Generalisation
Using the above lemma, we can go further, and generalise the result to the product of $n$ real numbers $x_1, x_2, \dots, x_n \geq 0$ where $\sum x_i = C$. We want to show that the product $\prod x_i$ is maximised when $x_i = \frac{C}{n}$ for all $i$.
We can prove this by induction. In the base case we have $n = 1$ and the only choice is $x_1 = C$ which trivially maximises the result.
In the inductive case, we want to show:
$\prod_{i=1}^{n+1} x_i \leq \left(\frac{C}{n+1}\right)^{n+1}$
The product can be rewritten as:
$x_{n+1} \prod_{i=1}^n x_i$
Let $B = \sum_{i=1}^n x_i$. By I.H. we have:
$x_{n+1} \prod_{i=1}^n x_i \leq x_{n+1}\left(\frac{B}{n}\right)^n$
Now, let $\Delta = \frac{B}{n} - \frac{C}{n+1}$. We know that since $x_{n+1} = C - B$, then:
$$x_{n+1} = \frac{C}{n+1} - n\Delta$$
Define a sequence $S_i$ for $0 \leq i \leq n$ as follows:
$$S_i = \left(x_{n+1} + i\Delta\right)\left(\frac{C}{n+1}\right)^i\left(\frac{B}{n}\right)^{n-i}$$
Let's show that $S_i$ is monotonically non-decreasing i.e. $S_i \leq S_{i+1}$ for all $i < n$. Well:
$$S_i = \left(x_{n+1} + i\Delta\right)\left(\frac{B}{n}\right) \left(\frac{C}{n+1}\right)^i\left(\frac{B}{n}\right)^{n-(i+1)} \\= \left(\frac{C}{n+1} - (n - i)\Delta\right)\left(\frac{C}{n+1} + \Delta\right) \left(\frac{C}{n+1}\right)^i\left(\frac{B}{n}\right)^{n-(i+1)}$$
Now consider the leading terms $\left(\frac{C}{n+1} - (n - i)\Delta\right)$ and $\left(\frac{C}{n+1} + \Delta\right)$. Let's consider the cases for $\Delta$:

*

*If $\Delta = 0$, then $\left(\frac{C}{n+1} - (n - i)\Delta\right) = \left(\frac{C}{n+1} + \Delta\right) = \frac{C}{n+1}$ and so $S_i = \left(\frac{C}{n+1}\right)^{n+1}$ for all $i$. So certainly $S_i$ is non-decreasing as it is constant in this case.

*If $\Delta < 0$ then $\frac{C}{n+1} - (n - i)\Delta = \frac{C}{n+1} + (n - i - 1)(-\Delta) - \Delta$ and so by our above lemma, $\left(\frac{C}{n+1} - (n - i)\Delta\right)\left(\frac{C}{n+1} + \Delta\right) \leq \left(\frac{C}{n+1} - (n - i - 1)\Delta\right)\left(\frac{C}{n+1}\right)$ and so $S_i \leq S_{i+1}$.

*If $\Delta > 0$, then $\frac{C}{n+1} + \Delta = \left(\frac{C}{n+1} - (n - i)\Delta\right) + (n - i)\Delta + \Delta$ and so again we can apply the lemma to get that $\left(\frac{C}{n+1} - (n - i)\Delta\right)\left(\frac{C}{n+1} + \Delta\right) \leq \left(\frac{C}{n+1} - (n - i - 1)\Delta\right)\left(\frac{C}{n+1}\right)$ and so $S_i \leq S_{i+1}$.

Putting it all together then:
$$\prod_{i=1}^{n+1} x_i = x_{n+1} \prod_{i=1}^n x_i \leq x_{n+1}\left(\frac{B}{n}\right)^n = S_0 \leq S_1 \leq S_2 \dots \leq S_n = \left(\frac{C}{n+1}\right)^{n+1}$$
Which completes the proof.
