WDC Learn

Inequalities & Optimisation

Completing the square, AM-GM with equality cases and weighted forms, Cauchy–Schwarz in Titu form, the QM–AM–GM–HM chain, the rearrangement inequality, and bounding arguments for counting integer solutions.

≈2–4 problems per paper, usually #10–#259 lessons6 worked examples30 practice problems4 videos

On the AMC 12, inequality and optimisation questions ask for a minimum, a maximum or a range, or they ask how many integer solutions an inequality allows. They appear across the paper, from straightforward completing-the-square problems near #5 to multi-step constrained problems in the last few questions. The hardest ones combine two tools, for example a substitution suggested by the constraint followed by a two-step AM-GM argument.

Study in this order. Completing the square comes first, because every quadratic optimisation reduces to a sum of squares. Then learn AM-GM thoroughly, especially its equality case, since on this exam the equality case tells you whether a bound is achievable and therefore whether it is the answer. Cauchy–Schwarz in Titu form and the chain of means come next, and the rearrangement inequality is a short extra tool. Finish with bounding arguments, which is where inequalities meet counting.

A habit that separates strong solvers: before doing algebra, identify the equality configuration. If you can guess the point where the optimum occurs, usually equal variables or a ratio fixed by equal weights, you can choose the right inequality and confirm that it is tight. Then check the claimed answer numerically at a few test points. This takes seconds and catches sign and arithmetic slips before they cost a question.

Helpful first: Algebraic Manipulation, Counting & Combinatorics

1.Completing the square and the trivial inequality

Every real number squared is nonnegative. For any real tt, t2≥0t^2 \ge 0, with equality exactly when t=0t=0. This trivial inequality drives most of the optimisation on the AMC 12: a quadratic expression has a smallest or largest value because one of its pieces is a square that cannot go negative. The method is always the same. Rewrite the expression as a sum of squares plus a constant. The extreme value is then read off directly, because it is the constant, reached when every square is zero.

The tool that makes this rewriting possible is completing the square. For the start of a quadratic x2+bxx^2+bx, add and subtract (b2)2\left(\frac{b}{2}\right)^2 to get x2+bx=(x+b2)2−b24x^2+bx=\left(x+\frac{b}{2}\right)^2-\frac{b^2}{4}. Therefore x2+bx+c=(x+b2)2+(c−b24)x^2+bx+c=\left(x+\frac{b}{2}\right)^2+\left(c-\frac{b^2}{4}\right). The square is at least 00, so the smallest value of the whole expression is c−b24c-\frac{b^2}{4}, attained when x=−b2x=-\frac{b}{2}. Completing the square therefore finds both the optimal value and the place where it occurs.

The same idea works with several variables, where each variable gets its own square. Completing the square in xx and in yy separately gives x2−6x=(x−3)2−9x^2-6x=(x-3)^2-9 and y2+4y=(y+2)2−4y^2+4y=(y+2)^2-4, so x2+y2−6x+4y+20=(x−3)2+(y+2)2+7x^2+y^2-6x+4y+20=(x-3)^2+(y+2)^2+7. Both squares are nonnegative and vanish at (x,y)=(3,−2)(x,y)=(3,-2), so the minimum is 77.

A closely related fact is x2+y2≥2xyx^2+y^2\ge 2xy, which is just (x−y)2≥0(x-y)^2\ge 0 rearranged. Its equality case x=yx=y is the template for every AM-GM argument later in this topic. The logic of equality matters as much as the inequality itself: a bound of the form expression ≥\ge constant is only useful once you know exactly when equality holds, since that is where the optimum lives.

Practice problems usually hide the square. You must recognise t2+6t+13t^2+6t+13 or 4x2−12x+14x^2-12x+1 inside a larger expression, and that takes practice with the pattern (px+q)2=p2x2+2pqx+q2(px+q)^2=p^2x^2+2pqx+q^2. Multiply out a guess and compare coefficients. Note 4x2−12x+1=(2x−3)2−84x^2-12x+1=(2x-3)^2-8, so the minimum is −8-8, not 11. The constant left over after completing the square is the answer, not the original constant term.

Negative leading coefficients flip the direction of the inequality, which is the most common sign error. For instance −2x2+8x+11=19−2(x−2)2≤19-2x^2+8x+11=19-2(x-2)^2\le 19, so this expression has a maximum, not a minimum, and the maximum is 1919 at x=2x=2. Before applying the square trick, check the sign of the squared coefficient and decide whether you are bounding from below or from above.

KEY FACTS
  • t2≥0t^2\ge 0, with equality if and only if t=0t=0
  • x2+bx+c=(x+b2)2+c−b24x^2+bx+c=\left(x+\frac{b}{2}\right)^2+c-\frac{b^2}{4}
  • x2+y2≥2xyx^2+y^2\ge 2xy, with equality if and only if x=yx=y

Spot it: The expression is quadratic in one or more variables and you need its minimum, its maximum, or its range.

COMMON MISTAKES
  • Completing the square with the wrong shift: for x2+bxx^2+bx the shift is b2\frac{b}{2}, not bb.
  • Reporting the constant term as the optimum instead of the constant left after completing the square.
  • Ignoring the sign of the leading coefficient, so a maximum is reported as a minimum.
TRY IT

Find the minimum value of x2+y2−6x+4y+20x^2+y^2-6x+4y+20 over all real numbers xx and yy.

Practise this lesson (4 problems) →

2.Optimising quadratics and discriminant bounds

A quadratic f(x)=ax2+bx+cf(x)=ax^2+bx+c with a≠0a\ne 0 traces a parabola. If a>0a>0 it opens upward and has a minimum; if a<0a<0 it opens downward and has a maximum. The extreme value sits at the vertex x=−b2ax=-\frac{b}{2a}, and it equals c−b24ac-\frac{b^2}{4a}. To derive this, factor aa out of the first two terms and complete the square: ax2+bx+c=a(x+b2a)2+c−b24aax^2+bx+c=a\left(x+\frac{b}{2a}\right)^2+c-\frac{b^2}{4a}. Since aa multiplies the square, its sign decides whether the square adds to or subtracts from the constant, which is why the type of extremum flips with aa.

Vertex formulas answer "what is the best value", but many problems ask a different question: for which parameters does a quadratic stay nonnegative? The discriminant answers it. Suppose a>0a>0. Then ax2+bx+c≥0ax^2+bx+c\ge 0 for every real xx exactly when the minimum value c−b24ac-\frac{b^2}{4a} is nonnegative, which is the same as b2−4ac≤0b^2-4ac\le 0. Keep this as a two-line check: positive leading coefficient, nonpositive discriminant.

Two-variable quadratics reduce to this case once a linear constraint is imposed. Suppose you must find the range of x2+xy+y2x^2+xy+y^2 under x+y=sx+y=s. Substituting y=s−xy=s-x turns the expression into a one-variable quadratic in xx, whose vertex gives the answer. This reduction is the most reliable technique whenever a problem supplies a linear relation, and it avoids guessing where the optimum lies.

Domains need care. A vertex may lie outside the allowed interval, in which case the optimum sits at an endpoint. For instance the minimum of x2−4xx^2-4x over 0≤x≤10\le x\le 1 occurs at x=1x=1 with value −3-3, not at the vertex x=2x=2, which is not allowed. Always compare the vertex with the domain before you report an answer, and check both endpoints when the vertex is excluded.

Quadratics are also hidden inside other expressions. If u=t2+ku=t^2+k for some expression tt, then optimising uu is the same as optimising t2t^2, and the answer is kk at the point where t=0t=0. Recognising this structure lets you replace a messy expression by a single parabola through a substitution such as p=x+yp=x+y or t=x−3t=x-3.

Typical traps: computing the vertex and reporting it as the global answer without checking the sign of aa; applying the discriminant condition to a family in which aa can be zero, where the expression is linear rather than quadratic and must be handled separately; and mixing up which coefficient appears in the vertex formula. Check the formula on a known example such as x2−2xx^2-2x, whose vertex is x=1x=1.

KEY FACTS
  • Vertex of ax2+bx+cax^2+bx+c is at x=−b2ax=-\frac{b}{2a}, with extreme value c−b24ac-\frac{b^2}{4a}
  • ax2+bx+c≥0ax^2+bx+c\ge 0 for all real xx if and only if a>0a>0 and b2−4ac≤0b^2-4ac\le 0
  • The discriminant Δ=b2−4ac\Delta=b^2-4ac decides whether a quadratic has real roots

Spot it: A quadratic, or a constrained expression that reduces to one, must be optimised, or a parameter must make a quadratic always nonnegative or always negative.

COMMON MISTAKES
  • Forgetting the sign of aa: the vertex is a minimum when a>0a>0 and a maximum when a<0a<0.
  • Ignoring the domain, so an excluded vertex is reported as the optimum.
  • Applying the discriminant test when a=0a=0, where the expression is linear.
TRY IT

Find the maximum value of −3t2+12t−7-3t^2+12t-7 over all real tt.

Practise this lesson (4 problems) →

3.AM-GM: equality cases and the n-variable form

The arithmetic mean–geometric mean inequality states that for nonnegative reals a1,…,ana_1,\dots,a_n, a1+⋯+ann≥a1a2⋯ann\frac{a_1+\cdots+a_n}{n}\ge\sqrt[n]{a_1a_2\cdots a_n}, with equality if and only if all the aia_i are equal. It is the most used inequality in competition mathematics, because it converts a sum into a product or the reverse, and a product of fixed size is easy to control.

Proof for two variables. For a,b≥0a,b\ge 0 write a=(a)2a=(\sqrt a)^2 and b=(b)2b=(\sqrt b)^2. Then a+b−2ab=(a−b)2≥0a+b-2\sqrt{ab}=(\sqrt a-\sqrt b)^2\ge 0, so a+b2≥ab\frac{a+b}{2}\ge\sqrt{ab}. Equality holds exactly when a=b\sqrt a=\sqrt b, that is, a=ba=b. The squared form (a+b)2≥4ab(a+b)^2\ge 4ab is often easier to use, because it removes the square roots.

General nn. Applying the two-variable case twice gives four variables: a+b+c+d4≥ab+cd2≥abcd4\frac{a+b+c+d}{4}\ge\frac{\sqrt{ab}+\sqrt{cd}}{2}\ge\sqrt[4]{abcd}. Powers of two are therefore covered, and Cauchy's forward–backward induction covers the rest: prove the statement for n=2kn=2^k, then descend from nn to n−1n-1 by appending the mean of the first n−1n-1 numbers as an extra term. Contest solvers rarely write this out, but the idea of padding to a convenient count is worth remembering.

Equality cases carry most of the information. For x>0x>0, the bound x+16x≥216=8x+\frac{16}{x}\ge 2\sqrt{16}=8 is attained only when x=16xx=\frac{16}{x}, which gives x=4x=4. Because the bound is achieved, 88 is the true minimum rather than a mere lower bound. Always check that the equality configuration satisfies the constraints of the problem, since an unattainable bound proves nothing about the optimum.

Practical use. To bound a sum below you need the product of its summands to be constant. To bound a product above you need the sum to be constant. When neither holds, rewrite the expression until one does: a sum like x+kxx+\frac{k}{x} is AM-GM ready precisely because its two summands multiply to the constant kk. Looking for such a pair is the main skill of this topic.

Geometry gives the same fact. Among rectangles of fixed area, the square has the least perimeter, and among rectangles of fixed perimeter the square has the largest area. Both are AM-GM with sides w,hw,h: w+h2≥wh\frac{w+h}{2}\ge\sqrt{wh}. This picture is a good sanity check whenever a constrained optimum seems surprising.

Common mistakes. AM-GM needs nonnegative inputs: x+y≥2xyx+y\ge 2\sqrt{xy} fails for x=y=−1x=y=-1. Students also drop the factor 22 from the bound, writing ab\sqrt{ab} when they mean 2ab2\sqrt{ab}, and forget that equality must be feasible under the constraints. Finally, AM-GM is a lower bound on a sum; using it as an upper bound on a sum is an error.

KEY FACTS
  • a+b2≥ab\frac{a+b}{2}\ge\sqrt{ab} for a,b≥0a,b\ge 0, with equality if and only if a=ba=b
  • a1+⋯+ann≥a1⋯ann\frac{a_1+\cdots+a_n}{n}\ge\sqrt[n]{a_1\cdots a_n} for nonnegative reals
  • x+kx≥2kx+\frac{k}{x}\ge 2\sqrt{k} for x>0x>0, with equality at x=kx=\sqrt{k}
  • (a+b)2≥4ab(a+b)^2\ge 4ab, equivalent to (a−b)2≥0(a-b)^2\ge 0

Spot it: A sum whose summands have a fixed product must be bounded below, a product whose factors have a fixed sum must be bounded above, or a positive expression must be shown to be at least a constant.

COMMON MISTAKES
  • Applying AM-GM to negative numbers, where it can fail.
  • Dropping the factor 22 in the bound 2k2\sqrt{k} for x+kxx+\frac{k}{x}.
  • Claiming an AM-GM bound is the optimum without checking that equality is attainable under the constraints.
TRY IT

For x>0x>0, find the minimum value of x+16xx+\frac{16}{x}.

Practise this lesson (7 problems) →

4.Weighted AM-GM and making the product constant

Weighted AM-GM. For positive reals x,yx,y and positive weights p,qp,q, px+qyp+q≥xpp+qyqp+q\frac{px+qy}{p+q}\ge x^{\frac{p}{p+q}}y^{\frac{q}{p+q}}. The version you will use most is the linear one: minimise αx+βy\alpha x+\beta y when xy=Pxy=P is fixed, with α,β,P>0\alpha,\beta,P>0. It is worth deriving carefully, because the constants are where students slip.

Derivation. Put u=αxu=\alpha x and v=βyv=\beta y. Then uv=αβxy=αβPuv=\alpha\beta xy=\alpha\beta P is constant. Plain AM-GM gives u+v≥2uv=2αβPu+v\ge 2\sqrt{uv}=2\sqrt{\alpha\beta P}, with equality if and only if u=vu=v, that is αx=βy\alpha x=\beta y. So the minimum of αx+βy\alpha x+\beta y under xy=Pxy=P is exactly 2αβP2\sqrt{\alpha\beta P}, attained at the ratio αx=βy\alpha x=\beta y.

Example. Minimise 2x+y2x+y subject to xy=8xy=8. Here α=2\alpha=2, β=1\beta=1, P=8P=8, so the minimum is 216=82\sqrt{16}=8. Equality needs 2x=y2x=y. Combined with xy=8xy=8 this gives 2x2=82x^2=8, so x=2x=2 and y=4y=4, and indeed 2⋅2+4=82\cdot 2+4=8.

The general weighted form also follows from the unweighted one by repetition. A term with weight pp is written as pp equal copies, and the unweighted AM-GM is applied to all the copies at once. This is the splitting technique of the next concept, and it is the reason the exponents of a weighted mean end up as multiplicities. Recognising the repetition is often easier than remembering the formula.

The principle to carry into contests is that AM-GM bounds a sum from below by a product, so you must engineer a constant product. The equality condition then states the ratio the variables must satisfy: each term should equal the others. This ratio is what lets you check whether the bound is attained, and it is the optimal point you will report or verify.

Homogenisation is a related idea. If a constraint such as xy=Pxy=P is given, an expression that mixes degrees can be rescaled so that every term has the same degree, after which AM-GM applies without any constraint. Many weighted problems are secretly about ratios, and this viewpoint explains why.

Common mistakes: writing 2P2\sqrt{P} instead of 2αβP2\sqrt{\alpha\beta P}, which forgets the coefficients; taking x=yx=y as the equality case when the correct rule is αx=βy\alpha x=\beta y; and applying the constant-product trick to a product that is not constant. Always confirm the product of your two terms is genuinely fixed before writing the bound.

KEY FACTS
  • Weighted AM-GM: px+qyp+q≥xpp+qyqp+q\frac{px+qy}{p+q}\ge x^{\frac{p}{p+q}}y^{\frac{q}{p+q}}
  • If xy=Pxy=P, then αx+βy≥2αβP\alpha x+\beta y\ge 2\sqrt{\alpha\beta P}
  • Equality for αx+βy\alpha x+\beta y holds exactly when αx=βy\alpha x=\beta y

Spot it: A linear combination of two variables must be minimised under a fixed product, or the exponents of a weighted mean appear in the problem.

COMMON MISTAKES
  • Writing 2P2\sqrt{P} instead of 2αβP2\sqrt{\alpha\beta P}, which drops the coefficients.
  • Taking x=yx=y as the equality case when the correct rule is αx=βy\alpha x=\beta y.
  • Applying the constant-product trick without checking that the product really is fixed.
TRY IT

Positive reals x,yx,y satisfy xy=16xy=16. Find the minimum of x+4yx+4y.

Practise this lesson (5 problems) →

5.Constrained products: splitting into equal pieces

Many AM-GM problems ask for the maximum of a product of powers under a linear constraint, such as x2y3zx^2y^3z with x+y+z=6x+y+z=6. The product is not a plain AM-GM of the variables, because the exponents differ. The fix is splitting: write each variable as a sum of equal pieces, with the number of pieces matching its exponent, and then apply AM-GM to the pieces. Every piece is positive, the pieces add up to the constraint, and their product is the target product, up to constant factors.

The general setup. Suppose we maximise x1a1⋯xkakx_1^{a_1}\cdots x_k^{a_k} subject to x1+⋯+xk=Sx_1+\cdots+x_k=S, with positive integer exponents summing to NN. Split each xix_i into aia_i equal parts xi/aix_i/a_i, repeated aia_i times. This gives NN pieces whose sum is SS and whose product is ∏i(xi/ai)ai\prod_i (x_i/a_i)^{a_i}. AM-GM on the pieces yields ∏i(xi/ai)ai≤(S/N)N\prod_i (x_i/a_i)^{a_i}\le (S/N)^N, so ∏ixiai≤(S/N)N∏iaiai\prod_i x_i^{a_i}\le (S/N)^N\prod_i a_i^{a_i}. The bound is attained when all pieces are equal, that is xi=aiSNx_i=\frac{a_iS}{N}.

Example. Let x+y=9x+y=9 and maximise xy2xy^2. Split yy into two halves: the pieces are xx, y2\frac y2, y2\frac y2. They sum to 99, so their average is 33, and their product x⋅y24x\cdot\frac{y^2}{4} is at most 33=273^3=27. Hence xy2≤108xy^2\le 108, with equality when x=y2=3x=\frac y2=3, that is x=3x=3 and y=6y=6. Check: 3⋅36=1083\cdot 36=108 and 3+6=93+6=9.

Why the method is trustworthy. The equality condition of AM-GM says all pieces are equal, and that single fact produces the optimal ratio xi:xj=ai:ajx_i : x_j = a_i : a_j of the variables. This ratio is more valuable than the bound itself, because it tells you which values to substitute when you check the answer, and whether the optimum lies inside the domain at all.

The same technique handles other shapes of constraint. If the expression contains x2yx^2y and the constraint is on x+yx+y, the splitting still works, because only the exponents and the linear constraint matter. For a constraint on a product rather than a sum, take logarithms, or reduce to this case by a substitution.

Traps. Splitting into the wrong number of pieces (treating x2x^2 as a single piece) gives a bound that is not attained, and the bound is then useless. Forgetting to divide by the exponent inside each piece means the pieces no longer multiply to the target. Finally, confirm that the equality configuration has every variable positive and inside the domain before you report it.

KEY FACTS
  • With x1+⋯+xk=Sx_1+\cdots+x_k=S and exponents aia_i summing to NN: ∏xiai≤(SN)N∏aiai\prod x_i^{a_i}\le\left(\frac{S}{N}\right)^N\prod a_i^{a_i}
  • Equality holds when every piece is equal, that is xi=aiSNx_i=\frac{a_iS}{N}
  • Splitting a variable with exponent aa into aa equal parts removes the exponent from the AM-GM step

Spot it: A product of powers of positive variables is to be maximised under a linear constraint on their sum.

COMMON MISTAKES
  • Treating x2x^2 as one piece instead of two equal pieces, which gives a bound that is not attained.
  • Forgetting to divide each variable by its exponent, so the pieces do not multiply to the target product.
  • Reporting the bound without computing the equality point xi=aiSNx_i=\frac{a_iS}{N} and checking that it satisfies the constraint.
TRY IT

Positive reals x,y,zx,y,z satisfy x+y+z=12x+y+z=12. Find the maximum of xy2zxy^2z.

Practise this lesson (2 problems) →

6.Cauchy–Schwarz and Titu's lemma

The Cauchy–Schwarz inequality states that for real numbers a1,…,ana_1,\dots,a_n and b1,…,bnb_1,\dots,b_n, (∑i=1naibi)2≤(∑ai2)(∑bi2)\left(\sum_{i=1}^n a_ib_i\right)^2\le\left(\sum a_i^2\right)\left(\sum b_i^2\right), with equality if and only if the two sequences are proportional. It is the second great workhorse of this topic, and unlike AM-GM it does not care about signs.

Proof by a discriminant. For any real tt, Q(t)=∑(ait−bi)2≥0Q(t)=\sum (a_it-b_i)^2\ge 0. Expanding gives Q(t)=(∑ai2)t2−2(∑aibi)t+∑bi2Q(t)=\left(\sum a_i^2\right)t^2-2\left(\sum a_ib_i\right)t+\sum b_i^2. A quadratic that is nonnegative for all tt has discriminant at most zero, so 4(∑aibi)2−4(∑ai2)(∑bi2)≤04\left(\sum a_ib_i\right)^2-4\left(\sum a_i^2\right)\left(\sum b_i^2\right)\le 0, which is the inequality. Equality means QQ has a double root, so some tt makes every ait−bia_it-b_i vanish, that is bi=taib_i=ta_i for all ii.

Titu's lemma (Engel form). Apply Cauchy–Schwarz with ai=xiyia_i=\frac{x_i}{\sqrt{y_i}} and bi=yib_i=\sqrt{y_i}, where yi>0y_i>0. Then (∑xi)2≤(∑xi2yi)(∑yi)\left(\sum x_i\right)^2\le\left(\sum\frac{x_i^2}{y_i}\right)\left(\sum y_i\right), which rearranges to ∑xi2yi≥(∑xi)2∑yi\sum\frac{x_i^2}{y_i}\ge\frac{\left(\sum x_i\right)^2}{\sum y_i}. Equality holds when xiyi\frac{x_i}{y_i} is constant. Titu is the form you will use most, because many optimisation problems contain numerators that are squares or can be written as squares.

Example. Let x,y>0x,y>0 with x+y=3x+y=3 and minimise 1x+4y\frac1x+\frac4y. Write the expression as 12x+22y\frac{1^2}{x}+\frac{2^2}{y}. Titu gives the bound (1+2)2x+y=93=3\frac{(1+2)^2}{x+y}=\frac{9}{3}=3. Equality needs 1x=2y\frac{1}{x}=\frac{2}{y}, so y=2xy=2x, which with x+y=3x+y=3 gives x=1x=1 and y=2y=2. Check: 1+42=31+\frac{4}{2}=3.

Choosing the numerators. To apply Titu, write each term as a square over a positive denominator. A term 4y\frac{4}{y} becomes 22y\frac{2^2}{y}, and a term xy\frac{x}{y} becomes (x)2y\frac{(\sqrt x)^2}{y} when a square root is harmless. The equality condition xi/yix_i/y_i constant then pins down the optimal ratio, which you should verify at the end.

The weighted version. If the numerators are not squares, use Cauchy–Schwarz in the form (∑ai)(∑wiai)≥(∑wi)2\left(\sum a_i\right)\left(\sum \frac{w_i}{a_i}\right)\ge\left(\sum\sqrt{w_i}\right)^2 for positive ai,wia_i,w_i. This is the right tool for constraints on sums of weighted reciprocals, and its equality case ai∝wia_i\propto\sqrt{w_i} is the same proportionality principle in disguise.

Common mistakes. Applying Titu with a denominator that is not positive. Grouping the terms so that the numerator and denominator sums do not match the lemma's form. And forgetting that equality needs proportionality, which may be impossible if a variable is forced to zero or to infinity. Check the equality point numerically before trusting the bound.

KEY FACTS
  • (∑aibi)2≤(∑ai2)(∑bi2)\left(\sum a_ib_i\right)^2\le\left(\sum a_i^2\right)\left(\sum b_i^2\right)
  • Titu's lemma: ∑xi2yi≥(∑xi)2∑yi\sum\frac{x_i^2}{y_i}\ge\frac{\left(\sum x_i\right)^2}{\sum y_i} for yi>0y_i>0
  • Equality in Cauchy–Schwarz holds if and only if ai/bia_i/b_i is constant
  • (∑ai)(∑wiai)≥(∑wi)2\left(\sum a_i\right)\left(\sum\frac{w_i}{a_i}\right)\ge\left(\sum\sqrt{w_i}\right)^2 for positive ai,wia_i,w_i

Spot it: The expression is a sum of squares, a sum of terms whose numerators are squares over positive denominators, or a constraint on a sum of squares.

COMMON MISTAKES
  • Applying Titu with a denominator that is zero or negative.
  • Grouping terms so that the numerator and denominator sums do not match the lemma's form.
  • Forgetting that equality needs proportionality, and never checking the equality point.
TRY IT

Positive reals a,ba,b satisfy a+b=2a+b=2. Find the minimum of 1a+9b\frac1a+\frac9b.

Practise this lesson (8 problems) →

7.The QM–AM–GM–HM chain

For positive reals x1,…,xnx_1,\dots,x_n define the quadratic mean QM=∑xi2n\mathrm{QM}=\sqrt{\frac{\sum x_i^2}{n}}, the arithmetic mean AM=∑xin\mathrm{AM}=\frac{\sum x_i}{n}, the geometric mean GM=∏xin\mathrm{GM}=\sqrt[n]{\prod x_i}, and the harmonic mean HM=n∑1/xi\mathrm{HM}=\frac{n}{\sum 1/x_i}. Then QM≥AM≥GM≥HM\mathrm{QM}\ge\mathrm{AM}\ge\mathrm{GM}\ge\mathrm{HM}, with equality throughout exactly when all the xix_i are equal. Each step is a standard inequality you have already met, so the chain is a summary of tools rather than a new theorem.

Why each link holds. QM ≥\ge AM is ∑xi2≥(∑xi)2n\sum x_i^2\ge\frac{(\sum x_i)^2}{n}, which is Cauchy–Schwarz with every bi=1b_i=1; both sides are nonnegative, so squaring is safe. AM ≥\ge GM is the AM-GM inequality. GM ≥\ge HM comes from AM-GM applied to the reciprocals: GM(1/xi)=1/GM(xi)\mathrm{GM}(1/x_i)=1/\mathrm{GM}(x_i) and AM(1/xi)=1/HM(xi)\mathrm{AM}(1/x_i)=1/\mathrm{HM}(x_i), so AM-GM on the reciprocals, then taking reciprocals, reverses to give GM≥HM\mathrm{GM}\ge\mathrm{HM}.

For two positive numbers there is a useful identity: AM⋅HM=GM2\mathrm{AM}\cdot\mathrm{HM}=\mathrm{GM}^2. Indeed a+b2⋅2aba+b=ab\frac{a+b}{2}\cdot\frac{2ab}{a+b}=ab. So if you know the GM and the HM, you know the AM at once, and conversely. This is the fastest way to handle two-variable mean problems, and it is worth memorising.

The chain is used in two directions. To bound a quantity from above, identify which mean it is: a sum of squares is controlled by the QM, and a sum of reciprocals by the HM. To bound from below, use the other end of the chain. For example, given ∑xi2=20\sum x_i^2=20 with four positive numbers, the QM bound gives ∑xi≤45\sum x_i\le 4\sqrt5, attained when all four numbers equal 5\sqrt5.

Contest pattern. A constraint is stated on one mean and a question concerns another. Convert between them: the AM can be bounded from the QM using the Cauchy–Schwarz step, and the HM can be handled by applying the chain to reciprocals. Writing the four means side by side is a reliable way to see which link you need.

Caution. The chain needs positivity. Geometric and harmonic means are meaningless or misleading for numbers with negative entries, and the inequalities can fail. The inequalities also point one way only: an upper bound on the GM says nothing about the AM from above, and a lower bound on the QM says nothing about the HM.

KEY FACTS
  • HM≤GM≤AM≤QM\mathrm{HM}\le\mathrm{GM}\le\mathrm{AM}\le\mathrm{QM} for positive reals, with equality throughout exactly when all are equal
  • For two positive numbers, AM⋅HM=GM2\mathrm{AM}\cdot\mathrm{HM}=\mathrm{GM}^2
  • ∑xi2≥(∑xi)2n\sum x_i^2\ge\frac{\left(\sum x_i\right)^2}{n}, which is Cauchy–Schwarz with all bi=1b_i=1

Spot it: A bound is needed on a sum of squares, a sum, a product or a sum of reciprocals, and the given constraint is stated in terms of a different mean.

COMMON MISTAKES
  • Applying the chain to numbers that include zero or negatives, where GM and HM are undefined or the inequalities fail.
  • Reversing the direction: AM-GM bounds the AM from below by the GM, so an upper bound on the GM says nothing about the AM.
  • Confusing the HM with the average of the reciprocals; the HM is the reciprocal of that average.
TRY IT

Two positive numbers have geometric mean 66 and harmonic mean 92\frac92. What is their arithmetic mean?

Practise this lesson (2 problems) →

8.The rearrangement inequality

Take two lists of real numbers and pair their entries in some order. The sum of the products depends on the pairing. The rearrangement inequality says that the sum is largest when the two lists are sorted in the same order, pairing the largest with the largest and so on, and smallest when they are sorted in opposite order. In words: big with big maximises the total, and big with small minimises it. No sign assumption is needed, which distinguishes it from AM-GM.

Two-term proof. Let a1≤a2a_1\le a_2 and b1≤b2b_1\le b_2. Compare a1b1+a2b2a_1b_1+a_2b_2 with the mismatched pairing a1b2+a2b1a_1b_2+a_2b_1. Their difference is a1b1+a2b2−a1b2−a2b1=(a1−a2)(b1−b2)≥0a_1b_1+a_2b_2-a_1b_2-a_2b_1=(a_1-a_2)(b_1-b_2)\ge 0, because both factors are ≤0\le 0 or both are ≥0\ge 0. So the matched pairing is never worse. Any pairing can be improved by swapping an inverted pair, and each swap does not decrease the sum, so the maximum occurs at the sorted pairing.

Application. The rearrangement inequality gives a quick bound on any sum of the form ∑aibσ(i)\sum a_i b_{\sigma(i)} over permutations σ\sigma, without enumerating them. It is also the engine behind Chebyshev's sum inequality, which compares averages of similarly and oppositely ordered sequences, so it appears in several classical olympiad arguments.

Worked pattern. Let a=(1,4,6)a=(1,4,6) and let bb be a permutation of (2,3,5)(2,3,5). The largest sum comes from sorted pairing: 1⋅2+4⋅3+6⋅5=441\cdot 2+4\cdot 3+6\cdot 5=44. The smallest comes from reversing: 1⋅5+4⋅3+6⋅2=291\cdot 5+4\cdot 3+6\cdot 2=29. Every one of the six permutations gives a value in the interval from 2929 to 4444, and the extremes are attained, so the range is settled without a full enumeration.

Pitfalls. The inequality concerns a fixed pair of lists, and the maximum and minimum are the two extremes of the same family of pairings. The usual error is to match the largest of one list with the smallest of the other when the question asks for the maximum. Another is to forget that the inequality applies to any real numbers, so no positivity check is needed, but ordering is essential.

KEY FACTS
  • Similarly ordered pairing maximises ∑aibσ(i)\sum a_ib_{\sigma(i)}; oppositely ordered pairing minimises it
  • a1b1+a2b2−a1b2−a2b1=(a1−a2)(b1−b2)a_1b_1+a_2b_2-a_1b_2-a_2b_1=(a_1-a_2)(b_1-b_2)
  • The rearrangement inequality holds for arbitrary real numbers, with no sign assumption

Spot it: A sum of products of two lists is to be maximised or minimised over all pairings of their entries.

COMMON MISTAKES
  • Pairing the largest with the largest when the question asks for the minimum.
  • Forgetting that the inequality is about a fixed pair of lists, so the answer must be checked against the actual permutations.
  • Assuming positivity is needed; the rearrangement inequality does not require positive numbers.
TRY IT

Let a=(1,2,3)a=(1,2,3) and b=(4,5,6)b=(4,5,6). Over all ways of pairing the entries of aa with a permutation of bb, what is the minimum of ∑aibσ(i)\sum a_i b_{\sigma(i)}?

Practise this lesson (1 problem) →

9.Bounding arguments for counting integer solutions

Counting integer solutions of an equation is hopeless by eye, but inequalities make the solution set finite and small. The strategy has three steps: use an inequality to bound each variable, reduce the search to a short finite list, and check the candidates. The art lies in the first step. Most equations have families of solutions that grow with the variables, and an inequality shows that large variables throw the equation off balance.

Reciprocal bounds. Count the positive integer pairs (x,y)(x,y) with 1x+1y=12\frac1x+\frac1y=\frac12. Since 1y>0\frac1y>0, we get 1x<12\frac1x<\frac12, so x≥3x\ge 3, and symmetrically y≥3y\ge 3. Assume x≤yx\le y, which we will undo at the end. Then 1y≤1x\frac1y\le\frac1x, so 12≤2x\frac12\le\frac2x, giving x≤4x\le 4. Thus x∈{3,4}x\in\{3,4\}. For x=3x=3, 1y=16\frac1y=\frac16 gives y=6y=6; for x=4x=4, 1y=14\frac1y=\frac14 gives y=4y=4. Counting orders, the solutions are (3,6),(4,4),(6,3)(3,6),(4,4),(6,3), three in total.

Quadratic bounds. A quadratic inequality traps an integer variable in a finite interval, because its roots are the endpoints. For instance n2−3n−40<0n^2-3n-40<0 factors as (n−8)(n+5)<0(n-8)(n+5)<0, so −5<n<8-5<n<8, and among the positive integers only 1,…,71,\dots,7 remain. The same principle works for products: if xy=Nxy=N with positive integers, every divisor of NN is a candidate, and there are finitely many.

Symmetry and ordering. When the equation is symmetric in its variables, assume a≤b≤ca\le b\le c, derive a bound on the smallest variable, then bound the rest. At the end, convert each sorted solution into ordered ones: 66 orderings if all entries are distinct, 33 if exactly two agree, and 11 if all three agree. Forgetting this count is the most common reason an otherwise correct solution gives a wrong total.

AM-GM as a bound on a product. If a,b,ca,b,c are positive, AM-GM gives a+b+c≥3abc3a+b+c\ge 3\sqrt[3]{abc}, which limits how large the variables can be at a given product. Combined with a factorisation of the remaining equation, this often reduces a three-variable count to a short case check.

Traps. A bound derived from one variable may be loose. A loose bound is harmless, because you then check a few extra cases, but an overly tight bound silently loses solutions, so always test the boundary values. Remember also that positive integers exclude zero, which changes which bounds are valid, and that repeated entries reduce the number of orderings.

KEY FACTS
  • If positive integers satisfy 1x+1y=12\frac1x+\frac1y=\frac12, then x,y∈{3,4,6}x,y\in\{3,4,6\}
  • Ordered triples: 66 for distinct entries, 33 when exactly two entries agree, 11 when all agree
  • A quadratic inequality (n−p)(n−q)≤0(n-p)(n-q)\le 0 bounds nn to the interval between pp and qq

Spot it: A count of integer solutions is requested for an equation whose variables an inequality can bound, typically a reciprocal sum, a product, or a quadratic.

COMMON MISTAKES
  • Forgetting that solutions with repeated entries have fewer orderings than distinct ones.
  • Forgetting that positive integers exclude zero, which changes which bounds are valid.
  • Stopping the bound too early, so a valid case is missed.
TRY IT

How many positive integers nn satisfy n2<3n+40n^2<3n+40?

Practise this lesson (4 problems) →

Find the equality case before doing the algebra.

A proposed bound is incomplete until its equality conditions are checked against the constraints. For a fixed sum, balanced variables often minimise a sum of squares or reciprocals. That is a clue, not a proof: use a square, Cauchy–Schwarz, or AM–GM to certify the bound.

In rational cyclic expressions, try Cauchy–Schwarz in the form ∑ai2/bi≥(∑ai)2/(∑bi)\sum a_i^2/b_i\ge(\sum a_i)^2/(\sum b_i) with positive denominators. The condition on the denominators matters. Applying it to arbitrary signed numbers is invalid.

Before you commit to a method

  • State positivity wherever you use AM–GM or divide by a variable.
  • Record both the bound and the conditions for equality.
  • A numerical example can disprove a bound; it cannot prove one.

Two problems to work through

Try the question on paper before opening its solution. For each step, explain why it follows from the previous one.

A fixed-sum reciprocal bound

For positive x,yx,y with x+y=10x+y=10, find the minimum of 1/x+1/y1/x+1/y.

Show the full reasoning
  1. Combine the fractions: 1/x+1/y=10/(xy)1/x+1/y=10/(xy).
  2. The identity (x−y)2≥0(x-y)^2\ge0 implies (x+y)2≥4xy(x+y)^2\ge4xy, so xy≤25xy\le25.
  3. The numerator is positive and fixed. A larger positive denominator makes the fraction smaller.
  4. Thus 10/(xy)≥10/25=2/510/(xy)\ge10/25=2/5, attained at x=y=5x=y=5.

Answer: 2/52/5

Check or vary it: If the variables were allowed to be negative or zero, the denominator argument would require a fresh domain analysis.

A cyclic quotient

For positive x+y+z=1x+y+z=1, find the minimum of x2/y+y2/z+z2/xx^2/y+y^2/z+z^2/x.

Show the full reasoning
  1. Apply Cauchy–Schwarz to x/yx/\sqrt y, y/zy/\sqrt z, z/xz/\sqrt x paired with y\sqrt y, z\sqrt z, x\sqrt x.
  2. It gives (x2/y+y2/z+z2/x)(y+z+x)≥(x+y+z)2(x^2/y+y^2/z+z^2/x)(y+z+x)\ge(x+y+z)^2.
  3. The sum constraint makes the lower bound exactly 11.
  4. The admissible choice x=y=z=1/3x=y=z=1/3 gives three terms of 1/31/3, so the bound is attained.

Answer: 1

Check or vary it: For x+y+z=s>0x+y+z=s>0, the same argument gives a minimum of ss. Scaling is a useful check on the units of a claimed bound.

Make the method stick

Close the solutions and rewrite both arguments from memory. In the topic practice below, begin with an untimed warm-up, then work through the medium problems. If you miss one, write down the first step you could not justify before checking the solution. Retry it on another day without your notes.

Complete the square first

Whenever an expression is quadratic in one or more variables, rewrite it as squares plus a constant before anything else. The minimum or maximum is then immediate, and the point where the squares vanish tells you the optimum.

Find the equality case before the inequality

Guess the optimum by symmetry or by equal weights, meaning every term equal or every ratio fixed. Knowing where equality holds tells you which inequality to use, and a bound is only useful if equality can occur under the constraints.

Engineer a constant product or sum

AM-GM bounds a sum from below only when the product of its terms is fixed. Rewrite the expression, for instance by pairing the summands so that their product is constant, until one of the two quantities is fixed.

Split unequal exponents into equal pieces

For a product xaybx^a y^b under a constraint on x+yx+y, split xx into aa equal parts and yy into bb equal parts. The pieces then number a+ba+b and AM-GM applies directly, with the equality ratio read off from the pieces.

Use Titu when numerators are squares

Write each term as a square over a positive denominator and apply Titu's lemma. Equality means each ratio of numerator root to denominator is constant, which pins down the optimal point.

Bound first, then enumerate

To count integer solutions, use an inequality to bound the smallest variable, then the others, and list the finite remainder. Finally multiply each unordered solution by its number of orderings.

Sort the sequences

For a sum of products over a permutation, match the largest with the largest to maximise and the largest with the smallest to minimise. The rearrangement inequality justifies both directions.

Check the claimed optimum numerically

After finding an answer, evaluate the expression at the claimed equality point and at a few nearby points. A grid over rational values is a fast check that the bound is achieved and not beaten.

Try each one first. “How do I start?” gives the way in; then reveal the solution one step at a time.

Example 1: Minimum of a quadratic by completing the square

Warm-up · #1–5

What is the minimum value of x2+10x+31x^2+10x+31 over all real numbers xx?

  1. (A)1
  2. (B)6
  3. (C)9
  4. (D)21
  5. (E)31
How do I start?

The expression is quadratic with leading coefficient 1>01>0, so it has a minimum. Complete the square.

Example 2: Rectangle of fixed area with least perimeter

Easy · #6–10

A rectangle has area 3636. What is the smallest possible perimeter of such a rectangle, if its side lengths are positive real numbers?

  1. (A)12
  2. (B)18
  3. (C)24
  4. (D)36
  5. (E)72
How do I start?

The perimeter is a sum of two sides whose product is fixed, which is exactly the setting for AM-GM.

Example 3: Dividing first to expose a reciprocal pair

Medium · #11–15

For x>0x>0, what is the minimum of x2+2x+9x\frac{x^2+2x+9}{x}?

  1. (A)6
  2. (B)8
  3. (C)10
  4. (D)11
  5. (E)14
How do I start?

The fraction has a term in xx and a term in 1x\frac{1}{x} once you divide, which is the shape AM-GM needs.

Example 4: Titu's lemma with square numerators

Hard · #16–20

Positive reals a,ba,b satisfy a+b=1a+b=1. What is the minimum of 4a+9b\frac{4}{a}+\frac{9}{b}?

  1. (A)16
  2. (B)20
  3. (C)25
  4. (D)30
  5. (E)36
How do I start?

Numerators 44 and 99 are the squares 222^2 and 323^2, so Titu's lemma applies directly with denominators aa and bb.

Example 5: Splitting a variable with exponent two

Hard · #16–20

Positive reals x,yx,y satisfy x+y=12x+y=12. What is the maximum of x2yx^2y?

  1. (A)128
  2. (B)144
  3. (C)192
  4. (D)256
  5. (E)512
How do I start?

The exponent 22 on xx suggests splitting xx into two equal halves, so the three pieces x2,x2,y\frac{x}{2},\frac{x}{2},y have sum x+y=12x+y=12.

Example 6: Two-step AM-GM for a symmetric bound

Final five · #21–25

Let u,vu,v be positive reals. What is the minimum of (u+1)2v+(v+1)2u\frac{(u+1)^2}{v}+\frac{(v+1)^2}{u}?

  1. (A)8
  2. (B)10
  3. (C)12
  4. (D)16
  5. (E)24
How do I start?

Clear denominators, then apply AM-GM to the two resulting terms and finish with the inequality (s+1)2≥4s(s+1)^2\ge 4s.

Inequalities Tutorial #1 - Intro to AM-GM
little fermat
A first walk through AM-GM and its equality case, a good start before the weighted and splitting techniques.
Prove the Inequality of Arithmetic and Geometric Means (AM-GM inequality)
The Math Sorcerer
A proof-focused treatment of AM-GM, useful for seeing the standard argument written out in full.
Proof of Cauchy Schwarz Inequality and Titu's Lemma: Introduction to Inequalities 6/28/20
Alphademic Learning
Derives Cauchy–Schwarz and Titu's lemma, the two tools behind the Titu and reciprocal-sum problems in this topic.
Inequalities Tutorial #17 -Intro to Rearrangement
little fermat
An introduction to the rearrangement inequality with example problems, to pair with the sorting strategy.

30 problems, easy to hard

6 × Warm-up · #1–56 × Easy · #6–108 × Medium · #11–156 × Hard · #16–204 × Final five · #21–25
30 problems
All 30 problemsWarm-up (#1–10)Medium (#11–15)Hard (#16–25)

Next topic: Functions, Exponents & Logarithms →