# Theorem about two real numbers 2

My question is: Prove-

If $a,b$ are two positive real numbers such that their sum is $a+b=k$. Then the product $ab$ is maximum if and only if $a=b=\displaystyle\frac{k}{2}$.

I proved the above theorem above using $(a+b)^2$ but I want to know how can it be proved using A.M. G.M. inequality.

-

AM-GM inequality: $\displaystyle\frac{a + b}{2} \geq \sqrt{ab}$, with equality if and only if $a = b$.

Substituting $a + b = k$ and taking squares gives us $$\frac{k^2}{4} \geq ab.$$ So the product $ab$ is bounded from above by a constant, and this upper bound can be achieved only by taking $a = b = \frac{k}{2}$.

-

This is a maximization problem:

$a+b=k$. Maximize $ab$.

$a=k-b$, so $ab=(k-b)b$.

$f(b)=(k-b)b$ is maximal if $$\frac{df}{db}=0$$

$\frac{df}{db}=(k-b)-b=k-2b$

This equals $0$ if and only if $k=2b$. Therefore, $$a=b=\frac{k}{2}$$

-