In short
For any set of positive real numbers, the arithmetic mean (AM) is always greater than or equal to the geometric mean (GM), which in turn is always greater than or equal to the harmonic mean (HM):
Equality holds throughout if and only if all the numbers are equal. For two positive numbers a and b, this reads \frac{a+b}{2} \geq \sqrt{ab} \geq \frac{2ab}{a+b}. The AM-GM inequality is one of the most useful tools in mathematics for finding minimum and maximum values and for proving other inequalities.
A farmer has 40 metres of fencing and wants to enclose a rectangular plot along a riverbank (so only three sides need fencing). Two sides of length y run perpendicular to the river, and one side of length x runs parallel. The constraint is x + 2y = 40, so x = 40 - 2y. The area is A = xy = y(40 - 2y) = 40y - 2y^2. What values of x and y make the area as large as possible?
You could complete the square or use calculus. But there is a slicker path. Rewrite the area as a product of two positive quantities whose sum you control:
Now 2y and (40 - 2y) are two positive numbers that add up to 40. The product of two positive numbers with a fixed sum is largest when the two numbers are equal — that is, when 2y = 40 - 2y, giving y = 10 and x = 20. The maximum area is A = 20 \times 10 = 200 square metres.
The principle hiding behind that step — "the product is maximised when the factors are equal" — is a direct consequence of the AM-GM inequality. This article proves the inequality, first for two numbers and then for n numbers, and shows how it becomes a tool for optimisation and for proving other inequalities.
The inequality for two numbers
Take two positive real numbers a and b. Their arithmetic mean is \frac{a+b}{2} and their geometric mean is \sqrt{ab}. The AM-GM inequality says:
with equality if and only if a = b.
The proof is short. Start with the fact that a square is never negative:
Expand:
Rearrange:
Divide both sides by 2:
The only way (\sqrt{a} - \sqrt{b})^2 = 0 is when \sqrt{a} = \sqrt{b}, i.e. a = b. So equality holds exactly when the two numbers are equal.
The semicircle picture gives you a way to see the inequality. The AM is the radius — it reaches the top of the semicircle. The GM is the altitude from the division point — it can reach the semicircle but never beyond it. The AM is longer unless a = b, in which case the altitude goes through the centre and both coincide.
Bringing in the harmonic mean
The harmonic mean of two positive numbers a and b is \text{HM} = \frac{2ab}{a+b}. There is a clean relationship:
since \text{AM} \times \text{HM} = \frac{a+b}{2} \cdot \frac{2ab}{a+b} = ab = \text{GM}^2.
Because \text{AM} \geq \text{GM} and \text{GM}^2 = \text{AM} \cdot \text{HM}, you get:
Here is the chain of reasoning: from \text{AM} \geq \text{GM} and \text{AM} \cdot \text{HM} = \text{GM}^2, divide both sides of the second equation by \text{AM}: \text{HM} = \frac{\text{GM}^2}{\text{AM}} \leq \frac{\text{GM}^2}{\text{GM}} = \text{GM}. So \text{HM} \leq \text{GM}, completing the chain.
Equality in \text{AM} = \text{GM} = \text{HM} holds if and only if a = b.
AM-GM-HM Inequality (two variables)
For positive real numbers a and b:
with equality throughout if and only if a = b.
Extending to n numbers
The two-variable inequality generalises naturally. For n positive real numbers a_1, a_2, \dots, a_n:
AM-GM Inequality (general)
with equality if and only if a_1 = a_2 = \dots = a_n.
The proof uses a clever strategy: first prove the inequality for n = 2^k (powers of 2) by repeated application of the two-variable case, then fill in the gaps.
Step 1: Powers of 2.
The case n = 2 is proved. For n = 4, apply the two-variable AM-GM twice. Let A_{12} = \frac{a_1 + a_2}{2} and A_{34} = \frac{a_3 + a_4}{2}. Then:
By the two-variable AM-GM, A_{12} \geq \sqrt{a_1 a_2} and A_{34} \geq \sqrt{a_3 a_4}. So:
Combining: \frac{a_1 + a_2 + a_3 + a_4}{4} \geq \sqrt[4]{a_1 a_2 a_3 a_4}. The same doubling argument works for n = 8, 16, 32, \dots — each step applies the n = 2 case to pairs of already-established results.
Step 2: Fill in the gaps (backward induction).
Suppose the AM-GM inequality holds for n variables. To prove it for n - 1 variables, set a_n = \frac{a_1 + a_2 + \dots + a_{n-1}}{n-1} = A (the AM of the first n - 1 numbers). Then:
By the n-variable AM-GM:
Raise both sides to the n-th power: A^n \geq a_1 a_2 \cdots a_{n-1} \cdot A. Divide by A (positive): A^{n-1} \geq a_1 a_2 \cdots a_{n-1}. Take the (n-1)-th root:
That is AM-GM for n - 1 variables. Since you have it for all powers of 2, the backward step fills in every positive integer between consecutive powers of 2: from 4 you get 3, from 8 you get 7, 6, 5, and so on.
Applications in optimisation
The AM-GM inequality is a direct route to many optimisation problems. The key idea: if you need to minimise (or maximise) a product subject to a fixed sum (or a sum subject to a fixed product), AM-GM gives you the answer and the equality condition tells you where the optimum occurs.
Pattern. If x_1 + x_2 + \dots + x_n = S (constant) and all x_i > 0, then:
with equality when x_1 = x_2 = \dots = x_n = \frac{S}{n}.
Conversely, if the product is fixed, the sum is minimised when all terms are equal.
Classic example. Among all rectangles with perimeter 40, which has the largest area? If the sides are x and y, then 2(x + y) = 40, so x + y = 20. The area is A = xy. By AM-GM:
Equality when x = y = 10 — the square. Maximum area = 100.
Applications in proving inequalities
AM-GM is also a workhorse for establishing inequalities — showing that some expression is always at least (or at most) a certain value.
Technique. To prove that f(a, b) \geq c for positive a, b, try to decompose f into terms whose AM-GM gives c.
Example. For positive x, prove that x + \frac{1}{x} \geq 2.
Apply AM-GM to x and \frac{1}{x}:
So x + \frac{1}{x} \geq 2. Equality when x = \frac{1}{x}, i.e. x = 1.
This single-line proof replaces a longer argument involving calculus or completing the square. The more you work with AM-GM, the more you develop an eye for splitting expressions into factors or terms that the inequality can handle.
Worked examples
Example 1: Find the minimum value of $\frac{a}{b} + \frac{b}{a}$ for positive reals $a, b$
Step 1. Identify the terms.
Set x = \frac{a}{b} and y = \frac{b}{a}. Both are positive since a, b > 0.
Why: renaming simplifies the expression and reveals its structure — it is x + y where xy = 1.
Step 2. Note the constraint.
xy = \frac{a}{b} \cdot \frac{b}{a} = 1. So the product of the two terms is fixed at 1.
Why: a fixed product is the signal to apply AM-GM in the "\text{sum} \geq something" direction.
Step 3. Apply AM-GM.
So x + y \geq 2, meaning \frac{a}{b} + \frac{b}{a} \geq 2.
Why: AM-GM directly converts the fixed-product condition into a lower bound on the sum.
Step 4. Identify the equality case.
Equality holds when x = y, i.e. \frac{a}{b} = \frac{b}{a}, which gives a^2 = b^2, so a = b (since both are positive).
Why: the equality condition of AM-GM always tells you where the extremum occurs — the values must be equal.
Result: \frac{a}{b} + \frac{b}{a} \geq 2, with equality when a = b.
The graph confirms the algebra: the curve never dips below 2, and it touches 2 exactly at x = 1. The AM-GM proof gave both the minimum value and its location in three lines.
Example 2: Three positive numbers $a$, $b$, $c$ satisfy $abc = 64$. Find the minimum value of $a + b + c$.
Step 1. Recognise the setup.
The product is fixed (abc = 64) and you want the minimum sum. This is the "\text{sum} \geq something when product is fixed" pattern — AM-GM applies directly.
Why: AM-GM with a fixed product gives a lower bound on the sum.
Step 2. Apply AM-GM to three variables.
Why: the three-variable AM-GM says the arithmetic mean is at least the geometric mean.
Step 3. Solve for the sum.
Why: multiplying both sides by 3 gives the bound on the sum directly.
Step 4. Check the equality condition.
Equality in AM-GM requires a = b = c. If a = b = c and abc = 64, then a^3 = 64, so a = 4. Check: a + b + c = 4 + 4 + 4 = 12 and abc = 64. Consistent.
Why: always verify that the equality case satisfies all constraints — this confirms the minimum is achievable.
Result: The minimum value of a + b + c is 12, achieved when a = b = c = 4.
The bar diagram makes the point visually: when one bar shrinks, the others must grow to keep the product at 64, and the total height (sum) increases. The most compact arrangement is the equal one.
Common confusions
-
"AM-GM works for any real numbers." No — the numbers must be positive. If you allow zero, the GM is zero and the inequality becomes \text{AM} \geq 0, which is weaker and less useful. If you allow negatives, the GM is undefined (or complex) when an odd number of factors are negative, and the inequality fails.
-
"AM \geq GM means AM is always much larger." Not necessarily. When the numbers are close to each other, AM and GM are nearly equal. In the extreme case a = b, they are exactly equal. The gap between AM and GM is a measure of how "spread out" the numbers are.
-
"I can apply AM-GM to any random grouping of terms." You can, but the result may not be useful. The art of using AM-GM is choosing which terms to group so that either the sum or the product is a known constant. Without a constraint linking the terms, the inequality gives a bound that depends on the other quantity, which may not simplify.
-
"The equality condition is optional." In an optimisation problem, the equality condition is the answer — it tells you the exact values where the minimum or maximum is achieved. Ignoring it means you found a bound but never confirmed it is tight.
-
"AM-GM and the Cauchy-Schwarz inequality are the same thing." They are different inequalities with different hypotheses. AM-GM relates a sum to a product; Cauchy-Schwarz relates sums of products to products of sums. They sometimes prove the same result, but they are distinct tools.
Going deeper
If you came here to understand the AM-GM-HM chain, see the proofs, and apply the inequality to optimisation and proof problems, you have everything you need. The rest of this section is for readers who want to see the weighted version and the connection to convexity.
Weighted AM-GM
When the terms have unequal "importance," you use the weighted version. For positive reals a_1, \dots, a_n and positive weights w_1, \dots, w_n with w_1 + w_2 + \dots + w_n = 1:
The ordinary AM-GM is the special case w_i = \frac{1}{n} for all i. The weighted version is especially useful when a constraint involves unequal coefficients — for instance, minimising 2x + 3y subject to x^2 y^3 = c.
Connection to convexity
The AM-GM inequality is a special case of Jensen's inequality applied to the function f(x) = \ln x, which is concave. Jensen's inequality states that for a concave function:
Applying this with f(x) = \ln x:
Exponentiating both sides recovers AM \geq GM. This perspective shows that AM-GM is not an isolated fact — it is part of a vast family of inequalities that arise from the curvature of functions.
The power mean generalisation
The AM, GM, and HM are three members of a continuous family called power means. The power mean of order p for positive numbers a_1, \dots, a_n is:
AM corresponds to p = 1, HM to p = -1, and GM is the limit as p \to 0. The power mean inequality states that if p < q, then M_p \leq M_q. The AM-GM-HM chain is the special case p = -1 < 0 < 1 = q.
Where this leads next
- Arithmetic Mean — the definition and properties of the AM, which sits at the top of the AM-GM-HM chain.
- Geometric Mean — the definition and properties of the GM, the middle member of the chain.
- Harmonic Mean — the definition and properties of the HM, the bottom of the chain, and its applications in rate and ratio problems.
- Quadratic Inequalities — many AM-GM applications reduce to analysing quadratic expressions, and the techniques complement each other.
- Mathematical Induction — the forward-backward proof of AM-GM for n variables uses a flavour of induction, and induction also proves many inequalities that AM-GM establishes.