📘 CodingMarble Learn

AM–GM Inequality

For two positive numbers a and b, the arithmetic mean (a+b)/2 is never smaller than the geometric mean √(ab). They are equal only when a = b. This gives the biggest product when the sum is fixed, and the smallest sum when the product is fixed.

🎬 Step-by-step story

  1. Here is a green rectangle. Its sides are a = 8 and b = 2. Add them: a + b = 10. Multiply them: a × b = 16, which is the area.
  2. The blue square uses the same fence length (perimeter) as the rectangle. Its side is the average (a + b) / 2 = 5. This average is called the AM. Its area is 25. That is bigger than 16.
  3. The orange square has the same area as the rectangle, 16. Its side is √(a × b) = 4. This number is called the GM. See: AM = 5 is bigger than GM = 4.
  4. Slide a from 8 down to 5, keeping a + b = 10. The rectangle gets fatter and the orange square grows. When a = b = 5, the rectangle is a square, and AM = GM.
  5. Now keep the area fixed at 16 instead. Move a from 8 to 4. The AM falls from 5 to 4 and stops there. For the same area, a square needs the shortest fence.
  6. Your turn. Drag the slider, and switch between 'sum fixed' and 'product fixed'. The blue square is never smaller than the orange one.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

What are a and b here, and what does a + b tell us?

They are the two sides of the rectangle. Half the fence is a + b, and the area is a × b. Look at the readout below the 3D.

Why is the AM the side of the same-perimeter square?

A square with the same fence has four equal sides, each (a + b)/2, because the perimeter is 2(a + b). So its side is the average.

Why is the GM the side of the same-area square?

A square of side g has area g². To match the area ab we need g = √(ab).

When exactly is AM equal to GM?

Only when a = b. Slide a to 5 and see the rectangle become a square and the orange and blue squares become the same.

How does this give a minimum, not a maximum?

If the area is fixed, the GM is fixed and the AM is at least that. So the sum a + b is smallest when a = b.

Can I use it with 0 or negative numbers?

No. The slider only allows positive values because the rule is proved only for positive a and b.

AM and GM: two kinds of average

Take two positive numbers a and b.

The arithmetic mean (AM) is the usual average: (a + b) / 2. It is the middle point between a and b on the number line.

The geometric mean (GM) is √(ab). It is the side of a square that has the same area as the a × b rectangle.

Example: for 4 and 16, AM = (4 + 16)/2 = 10 and GM = √64 = 8.

The AM–GM inequality and its proof

Statement: for all positive a and b, (a + b)/2 ≥ √(ab). The two sides are equal only when a = b.

Proof, step by step. A square of any real number is never negative. So (√a − √b)² ≥ 0.

Open the bracket: a − 2√(ab) + b ≥ 0.

Move the middle term across: a + b ≥ 2√(ab).

Divide by 2: (a + b)/2 ≥ √(ab). Done. The square is zero only if √a = √b, that is a = b.

Why we need positive numbers: √a and √b must exist. If a and b are negative, the inequality can break (for −2 and −8, the AM is −5 but the GM is 4).

See it in 3D: rectangle and squares

In the 3D scene the blue square has the same perimeter as the rectangle, so its side is the AM. The orange square has the same area as the rectangle, so its side is the GM. The blue square always holds at least as much area as the rectangle: ((a+b)/2)² ≥ ab. This is the same inequality, drawn as a picture. The gap between the two areas is ((a − b)/2)². It becomes zero only when a = b.

Maximum and minimum problems

Rule 1 (sum fixed, product is largest): if a + b = S, then ab ≤ (S/2)². The biggest product is (S/2)² and it happens at a = b = S/2.

Rule 2 (product fixed, sum is smallest): if ab = P, then a + b ≥ 2√P. The smallest sum is 2√P and it happens at a = b = √P.

Handy forms: x + 1/x ≥ 2 for x > 0 (equal at x = 1). Also a/b + b/a ≥ 2 for positive a, b. And a² + b² ≥ 2ab for any real a, b.

How to solve (3 checks): (1) Are all terms positive? (2) Is the product (or the sum) a constant, with no x left? (3) Can the terms become equal? If yes, the answer is reached when they are equal. Example: x + 9/x. The product x · 9/x = 9 is constant, so x + 9/x ≥ 2√9 = 6, equal when x = 9/x, that is x = 3.

More numbers: for n positive numbers, the AM is still ≥ the GM, with equality only when all numbers are equal.

Try it at home

Take a 24 cm string. Make a rectangle with it: first 10 × 2, then 8 × 4, then 6 × 6. Draw each on squared paper and count the squares inside: 20, 32, 36. Predict first, then count. The square wins. In the 3D, set 'sum fixed' and drag a to 5 to see the same thing.

Key formulas and definitions

Worked examples

1. Find the AM and GM of 4 and 16. Check that AM ≥ GM.

AM = (4 + 16)/2 = 10. GM = √(4 × 16) = √64 = 8. Since 10 ≥ 8, AM ≥ GM holds. They are not equal because 4 ≠ 16.

2. Two positive numbers add up to 14. What is the largest possible product?

The sum S = 14 is fixed. The product is largest when both numbers are equal: 7 and 7. Largest product = 7 × 7 = 49. Check: 6 × 8 = 48 is smaller.

3. A farmer has 60 m of fence for a rectangular field. Find the largest area.

Two sides a and b use half the fence: a + b = 30. The product ab is largest when a = b = 15. Largest area = 15 × 15 = 225 m².

4. Find the minimum value of x + 16/x for x > 0.

Both terms are positive. Their product x · 16/x = 16 is constant. So x + 16/x ≥ 2√16 = 8. Equality when x = 16/x, so x² = 16 and x = 4. Minimum = 8 at x = 4.

5. Prove that a² + b² ≥ 2ab for all real a and b.

(a − b)² ≥ 0 because a square is never negative. Open it: a² − 2ab + b² ≥ 0. Move 2ab to the right: a² + b² ≥ 2ab. Equal only when a = b.

6. Find the minimum value of 2x + 8/x for x > 0, and the x where it happens.

The product of the two terms is 2x · 8/x = 16, a constant. So 2x + 8/x ≥ 2√16 = 8. Equality when 2x = 8/x, so x² = 4 and x = 2. Minimum = 8 at x = 2.

7. For 0 < x < 6, find the largest value of x(6 − x).

The two numbers x and 6 − x are positive and add to 6, a constant. So the product is largest when x = 6 − x, that is x = 3. The largest value is 3 × 3 = 9.

Common mistakes

Practice quiz

1. The geometric mean of 4 and 9 is:
2. AM = GM happens when:
3. If a + b = 20 (a, b > 0), the largest value of ab is:
4. The smallest value of x + 1/x for x > 0 is:
5. Which is always true for positive a and b?

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is the AM–GM inequality in simple words?

The ordinary average of two positive numbers is at least as big as their geometric mean, the square root of their product. They match only when the two numbers are equal.

Why does AM–GM need positive numbers?

Because the geometric mean uses a square root of the product, and the proof uses √a and √b. With negative numbers the statement can fail.

Where is AM–GM used?

To find the biggest area for a fixed fence, the cheapest box for a fixed volume, and the minimum of expressions like x + k/x. It appears in school maths, entrance exams and Olympiad problems.

Where this is taught

China高一Ch.2 Quadratic functions, equations, inequalities

Learn first

Learn next

Related lessons

All Maths lessons