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):

\text{AM} \geq \text{GM} \geq \text{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:

A = xy = \frac{1}{2} \cdot 2y \cdot x = \frac{1}{2} \cdot 2y \cdot (40 - 2y)

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.

Rectangular plot along a river with fencing on three sidesA rectangle representing the plot. The bottom edge is labelled river with no fence. The top edge is labelled x equals 20 metres, and the two vertical edges are each labelled y equals 10 metres. The area 200 square metres is written inside the rectangle. A second smaller rectangle nearby shows a non-optimal case with y equals 5 and x equals 30, area 150. x = 20 m y = 10 m A = 200 m² river (no fence) x = 30 m y = 5 m A = 150 m² non-optimal: less area
The optimal rectangle (shaded) has $x = 20$, $y = 10$, and area $200$ m$^2$. A different split like $x = 30$, $y = 5$ satisfies the same fencing constraint but encloses only $150$ m$^2$. The AM-GM inequality guarantees that equal factors give the largest product.

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:

\frac{a+b}{2} \geq \sqrt{ab}

with equality if and only if a = b.

The proof is short. Start with the fact that a square is never negative:

(\sqrt{a} - \sqrt{b})^2 \geq 0

Expand:

a - 2\sqrt{ab} + b \geq 0

Rearrange:

a + b \geq 2\sqrt{ab}

Divide both sides by 2:

\frac{a+b}{2} \geq \sqrt{ab}

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.

Geometric view of AM greater than or equal to GM for two numbersA semicircle with diameter a plus b. A vertical line from the point where a and b meet on the diameter to the semicircle has length equal to the geometric mean square root of ab. The radius of the semicircle, which equals the arithmetic mean, is always at least as long as this vertical line. AM = (a+b)/2 a b GM = √(ab) a b
Place a segment of length $a + b$ as a diameter. The radius (AM) reaches the top of the semicircle. A perpendicular from the point dividing the diameter into $a$ and $b$ meets the semicircle at height $\sqrt{ab}$ (the GM). The radius is always at least as long as this perpendicular — a visual proof that AM $\geq$ GM. Equality holds when $a = b$, i.e. the perpendicular goes through the centre.

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:

\text{GM}^2 = ab = \text{AM} \times \text{HM}

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:

\text{AM} \geq \text{GM} \geq \text{HM}

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:

\frac{a+b}{2} \geq \sqrt{ab} \geq \frac{2ab}{a+b}

with equality throughout if and only if a = b.

Number line showing AM, GM, and HM for a equals 2 and b equals 8A horizontal number line from 0 to 6. Three points are marked: HM equals 3.2, GM equals 4, and AM equals 5. The points are ordered left to right confirming HM is less than or equal to GM is less than or equal to AM. 0 1 2 3 4 5 6 a = 2 HM = 3.2 GM = 4 AM = 5 b = 8 HM ≤ GM ≤ AM, always in this order for positive numbers
For $a = 2$ and $b = 8$: AM $= 5$, GM $= 4$, HM $= 3.2$. The three means sit in the order HM $\leq$ GM $\leq$ AM on the number line. As $a$ and $b$ get closer to each other, the three means squeeze together and coincide when $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)

\frac{a_1 + a_2 + \dots + a_n}{n} \geq \sqrt[n]{a_1 \cdot a_2 \cdots a_n}

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:

\frac{a_1 + a_2 + a_3 + a_4}{4} = \frac{A_{12} + A_{34}}{2} \geq \sqrt{A_{12} \cdot A_{34}}

By the two-variable AM-GM, A_{12} \geq \sqrt{a_1 a_2} and A_{34} \geq \sqrt{a_3 a_4}. So:

\sqrt{A_{12} \cdot A_{34}} \geq \sqrt{\sqrt{a_1 a_2} \cdot \sqrt{a_3 a_4}} = \sqrt[4]{a_1 a_2 a_3 a_4}

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:

\frac{a_1 + a_2 + \dots + a_{n-1} + A}{n} = \frac{(n-1)A + A}{n} = A

By the n-variable AM-GM:

A \geq \sqrt[n]{a_1 a_2 \cdots a_{n-1} \cdot A}

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:

A \geq \sqrt[n-1]{a_1 a_2 \cdots a_{n-1}}

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.

Forward-backward induction strategy for proving AM-GM for all nA number line with marks at n equals 2, 3, 4, 5, 6, 7, 8. Arrows go forward from 2 to 4 to 8 labelled doubling. Arrows go backward from 4 to 3, and from 8 to 7, 6, and 5, labelled backward step. 2 3 4 5 6 7 8 doubling doubling forward (doubling) then backward (subtracting one variable)
The forward-backward proof strategy. Red dots mark powers of $2$ — proved by doubling. Open circles are filled in by the backward step: from $n = 4$, derive $n = 3$; from $n = 8$, derive $n = 7, 6, 5$. Together, every positive integer $n \geq 2$ is covered.

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:

x_1 x_2 \cdots x_n \leq \left(\frac{S}{n}\right)^n

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:

\frac{x + y}{2} \geq \sqrt{xy} \implies 10 \geq \sqrt{xy} \implies xy \leq 100

Equality when x = y = 10 — the square. Maximum area = 100.

Interactive: area of a rectangle with fixed perimeterA graph of area equals x times (20 minus x) for x from 0.5 to 19.5. The curve is a downward parabola peaking at x equals 10 with area 100. A draggable point moves along the curve showing the current x, y, and area values. x Area 0 5 10 15 20 100 50 drag to change x
The area $A = x(20 - x)$ peaks at $x = 10$ (the square). Drag the point to see how the area changes. The AM-GM inequality guarantees $xy \leq 100$ with equality at $x = y = 10$.

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}:

\frac{x + \frac{1}{x}}{2} \geq \sqrt{x \cdot \frac{1}{x}} = \sqrt{1} = 1

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.

\frac{x + y}{2} \geq \sqrt{xy} = \sqrt{1} = 1

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.

Graph of f of x equals x plus 1 over x showing minimum at x equals 1A curve of f(x) = x + 1/x for x from 0.3 to 5. The curve has a minimum at x equals 1 where f equals 2. A horizontal dashed line at y equals 2 shows the minimum value. The curve approaches infinity as x approaches 0 and grows linearly for large x. x f(x) 0 1 2 3 4 5 2 4 min = 2 at x = 1
The function $f(x) = x + \frac{1}{x}$ for $x > 0$. The minimum value $2$ occurs at $x = 1$, exactly where AM-GM predicts equality. The curve shoots up for small $x$ (the $\frac{1}{x}$ term dominates) and grows linearly for large $x$ (the $x$ term dominates).

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.

\frac{a + b + c}{3} \geq \sqrt[3]{abc} = \sqrt[3]{64} = 4

Why: the three-variable AM-GM says the arithmetic mean is at least the geometric mean.

Step 3. Solve for the sum.

a + b + c \geq 3 \times 4 = 12

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.

Three bars showing equal versus unequal splits with the same productTwo groups of three bars. The left group has three equal bars of height 4, labelled a equals b equals c equals 4 with sum 12. The right group has bars of height 1, 8, and 8 labelled a equals 1 b equals 8 c equals 8 with sum 17. Both groups have the same product 64 but the equal split has the smaller sum. Equal split 4 4 4 sum = 12 product = 64 Unequal split 1 8 8 sum = 17 product = 64 Same product, but equal factors minimise the sum.
Both triples have product $64$. The equal split $(4, 4, 4)$ gives sum $12$ — the minimum guaranteed by AM-GM. The unequal split $(1, 8, 8)$ gives sum $17$. Making any factor smaller forces the others to compensate, driving the sum up.

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

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:

w_1 a_1 + w_2 a_2 + \dots + w_n a_n \geq a_1^{w_1} \cdot a_2^{w_2} \cdots a_n^{w_n}

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:

f\left(\frac{x_1 + x_2 + \dots + x_n}{n}\right) \geq \frac{f(x_1) + f(x_2) + \dots + f(x_n)}{n}

Applying this with f(x) = \ln x:

\ln\left(\frac{a_1 + \dots + a_n}{n}\right) \geq \frac{\ln a_1 + \dots + \ln a_n}{n} = \ln\left(\sqrt[n]{a_1 \cdots a_n}\right)

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:

M_p = \left(\frac{a_1^p + a_2^p + \dots + a_n^p}{n}\right)^{1/p}

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