Maximising a Product of Numbers With Constant Sum

How do we maximise the product of three positive numbers subject to the sum being a constant?
Let the numbers be
$a, \; b, \; c$
so that
$a+b+c=K$
for some constant
$K$
. We want to maximise
$P=abc$
.
Rearrange
$a+b+c=K$
to give
$a=K-b-b$
then
$P=(K-b-c)bc=Kbc-b^2c-bc^2$
.
For a maximum the partial derivatives with respect to
$b$
and
$c$
will be zero, so
$\frac{\partial P}{\partial b}=Kc-2bc-c^2=c(K-2b-c)=0$

$\frac{\partial P}{\partial c}=Kb-b^2-2bc=b(K-b-2c)0$

Obviously
$b, \; c \neq 0$
since then
$P=0$
so
$K-2b-c=K-b-2c=0$
.
The solution is
$b=c= \frac{K}{3}$
so then
$a= \frac{K}{3}$
and the maximum value of
$P$
is
$\frac{K}{3} \times \frac{K}{3} \times \frac{K}{3} = \frac{K^3}{27}$
.
We can use the same method for any number of variables.