Lemma › Guides › The tangent line trick for inequalities: when it works and fails
Guide

The tangent line trick for inequalities: when it works and fails

The tangent line trick is what you do when an inequality is a sum of the same one-variable expression over each variable, and the variables have a fixed total. You replace each term by a straight line that touches it, add up the lines, and the constraint does the rest. When it works it is the shortest proof available. When it does not work, there is a precise reason, and the reason is the useful part.

The idea

Say the problem is to show f(x1)+⋯+f(xn)≥n f(m)f(x_1) + \cdots + f(x_n) \ge n\,f(m) whenever x1+⋯+xn=nmx_1 + \cdots + x_n = nm, and equality should hold at x1=⋯=xn=mx_1 = \cdots = x_n = m.

  1. Write the tangent line to ff at mm: ℓ(x)=f(m)+f′(m)(x−m)\ell(x) = f(m) + f'(m)(x - m).
  2. Prove f(x)≥ℓ(x)f(x) \ge \ell(x) for every xx in the allowed range.
  3. Add up. The linear part of ℓ\ell sums to n f(m)+f′(m)(∑xi−nm)n\,f(m) + f'(m)(\sum x_i - nm), and the second piece is zero by the constraint. So ∑f(xi)≥n f(m)\sum f(x_i) \ge n\,f(m).

Step 2 is the entire proof. Almost always it factors as f(x)−ℓ(x)=(x−m)2⋅(something positive)f(x) - \ell(x) = (x - m)^2 \cdot (\text{something positive}), because a tangent line touches with a double root.

If ff is convex on the whole range, step 2 is automatic, and the trick is Jensen's inequality in disguise. The reason to know the trick separately is that it also works when ff is not convex, as long as the line stays under ff on the range you use.

The signals

Example: Nesbitt with the constraint a+b+c=1a + b + c = 1

Nesbitt's inequality is homogeneous, so for positive a,b,ca, b, c you may scale them so that a+b+c=1a + b + c = 1. Then ab+c=a1−a\dfrac{a}{b+c} = \dfrac{a}{1-a}, and the claim becomes

f(a)+f(b)+f(c)≥32,f(x)=x1−x.f(a) + f(b) + f(c) \ge \frac32, \qquad f(x) = \frac{x}{1-x}.

Equality is at a=b=c=13a = b = c = \tfrac13, where f=12f = \tfrac12 and f′(x)=1/(1−x)2=94f'(x) = 1/(1-x)^2 = \tfrac94. The tangent line is ℓ(x)=12+94(x−13)=9x−14\ell(x) = \tfrac12 + \tfrac94(x - \tfrac13) = \dfrac{9x - 1}{4}.

To show f(x)≥ℓ(x)f(x) \ge \ell(x) on (0,1)(0,1), multiply by 4(1−x)4(1-x), which is positive: the claim is 4x≥(9x−1)(1−x)4x \ge (9x-1)(1-x). The difference is 4x−(9x−1)(1−x)=9x2−6x+1=(3x−1)2≥04x - (9x-1)(1-x) = 9x^2 - 6x + 1 = (3x-1)^2 \ge 0.

Add the three lines: ∑ℓ(a)=9(a+b+c)−34=64=32\sum \ell(a) = \dfrac{9(a+b+c) - 3}{4} = \dfrac64 = \dfrac32. Done. This ff is convex on (0,1)(0,1), so Jensen would give the same result.

Example: an upper bound, ∑aa2+1≤910\sum \dfrac{a}{a^2+1} \le \dfrac{9}{10}

Take a,b,c>0a, b, c > 0 with a+b+c=1a + b + c = 1 and prove aa2+1+bb2+1+cc2+1≤910\dfrac{a}{a^2+1} + \dfrac{b}{b^2+1} + \dfrac{c}{c^2+1} \le \dfrac{9}{10}.

Now the line has to be above ff, because it is an upper bound. At m=13m = \tfrac13 we have f(m)=310f(m) = \tfrac{3}{10} and f′(m)=1−m2(1+m2)2=1825f'(m) = \dfrac{1 - m^2}{(1+m^2)^2} = \dfrac{18}{25}. The tangent line is

ℓ(x)=310+1825(x−13)=18x25+350.\ell(x) = \frac{3}{10} + \frac{18}{25}\left(x - \frac13\right) = \frac{18x}{25} + \frac{3}{50}.

The gap is ℓ(x)−f(x)=(3x−1)2(4x+3)50(x2+1)\ell(x) - f(x) = \dfrac{(3x-1)^2(4x+3)}{50(x^2+1)}, which is non-negative for every x>−34x > -\tfrac34. In particular it holds on (0,1)(0,1). Summing the lines gives 1825+3⋅350=36+950=910\tfrac{18}{25} + 3\cdot\tfrac{3}{50} = \tfrac{36 + 9}{50} = \tfrac{9}{10}.

This ff is concave on (0,1)(0,1), so Jensen gives the same bound. The line gets there with one factorisation and no second derivative, and that factorisation is the only place you need to be careful.

When it fails: a true inequality with no tangent line

Take a,b,c≥0a, b, c \ge 0 with a+b+c=3a + b + c = 3 and the claim ∑(4a2−a3)≥9\sum (4a^2 - a^3) \ge 9. Equality is at (1,1,1)(1,1,1), so set f(x)=4x2−x3f(x) = 4x^2 - x^3. Then f(1)=3f(1) = 3 and f′(1)=5f'(1) = 5, and the tangent line is 5x−25x - 2.

The gap is f(x)−(5x−2)=−(x−1)2(x−2)f(x) - (5x - 2) = -(x-1)^2(x-2). That is negative for x>2x > 2. At x=3x = 3, f(3)=9f(3) = 9 but the line says 1313. The line is not under the curve on the whole range, so step 2 is false and the trick stops.

The inequality itself is true. Write p=a+b+c=3p = a+b+c = 3, q=ab+bc+caq = ab+bc+ca, r=abcr = abc. Then ∑a2=p2−2q=9−2q\sum a^2 = p^2 - 2q = 9 - 2q and ∑a3=p3−3pq+3r=27−9q+3r\sum a^3 = p^3 - 3pq + 3r = 27 - 9q + 3r, so the excess over 99 is 4(9−2q)−(27−9q+3r)−9=q−3r4(9-2q) - (27 - 9q + 3r) - 9 = q - 3r. That is non-negative because (a+b+c)(ab+bc+ca)≥9abc(a+b+c)(ab+bc+ca) \ge 9abc by AM-GM, and with a+b+c=3a + b + c = 3 it reads 3q≥9r3q \ge 9r, that is q≥3rq \ge 3r. And it is zero at (3,0,0)(3, 0, 0) as well as at (1,1,1)(1,1,1), a second equality case at the boundary.

That second equality case is the signature. A tangent line meets ff only at one point, so it cannot account for an inequality that is also tight somewhere else. When you see two equality cases, expect to need a different tool, as with Schur's inequality.

Where it goes wrong

What to do with this

Pick the next inequality on your list that has a fixed sum, rewrite each term as a function of one variable, and compute the tangent line at the equal point before you try anything else. If the gap factors as a square times a positive, you have a proof. If it does not, you have learned that the inequality needs another tool, and the second equality case will usually tell you which. The Jensen technique page covers the convex case, and the guide to proving an olympiad inequality shows where the tangent line sits among the other methods. The problem archive has more inequalities to practise on.

Related guides

Techniques in this guide

Competitions this guide helps with

Train it on Lemma

Every technique here is taught explicitly, in order. 128 lessons, 1237 curated problems and unlimited generated practice at six difficulties. Free to start, no card, and the paid plan opens with 3 free days.

Find your level