Maths WorkshopMaths problems with full solutions
Exercise 2071Calculus › Multivariable calculus › Optimisation in several variablesOlympiadAdded 2 Nov 2026

The AM-GM inequality via optimisation

#inequality#AM-GM#optimisation#proof

Statement

Using Lagrange multipliers, prove that for all x1,…,xn>0x_1,\ldots,x_n > 0,
x1⋯xnn≤x1+⋯+xnn.\sqrt[n]{x_1 \cdots x_n} \le \frac{x_1 + \cdots + x_n}{n}.

Hint

Maximize the product P=x1⋯xnP = x_1 \cdots x_n under the constraint x1+⋯+xn=Sx_1 + \cdots + x_n = S fixed. The maximum is attained at x1=⋯=xn=S/nx_1 = \cdots = x_n = S/n.

Show solutionHide solution

Solution

Lagrange. Maximize ln⁡P=∑ln⁡xi\ln P = \sum \ln x_i under the constraint ∑xi=S\sum x_i = S. The system is
1xi=λfor all i.\frac{1}{x_i} = \lambda \quad \text{for all } i.
So all xix_i are equal to 1/λ1/\lambda, and the constraint gives xi=S/nx_i = S/n for all ii.

Maximum. At this point, P=(S/n)nP = (S/n)^n. Since the domain xi>0x_i > 0, ∑xi=S\sum x_i = S is bounded and the product tends to 00 on the boundary (if some xi→0x_i \to 0), the maximum is indeed attained at this point.

Conclusion. For all xi>0x_i > 0 with sum SS,
x1⋯xn≤(Sn)n=(x1+⋯+xnn)n.x_1 \cdots x_n \le \left(\frac{S}{n}\right)^n = \left(\frac{x_1+\cdots+x_n}{n}\right)^n.
Taking the nn-th root gives the AM-GM inequality.