HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
Convexity, Jensen and Inequality Techniques
  1. 1Convex functions and Jensen's inequality
  2. 2The tangent line trick and sums of squares
  3. 3The triangle inequality and polynomial bounds
  1. Mathematics
  2. /Convexity, Jensen and Inequality Techniques
  3. /The tangent line trick and sums of squares

Course 29.3·Lesson 2 of 3

The tangent line trick and sums of squares

When a sum of values f(x1)+⋯+f(xn)f(x_1) + \dots + f(x_n)f(x1​)+⋯+f(xn​)

Lesson 2 of 3Show all lessonsHide
Convexity, Jensen and Inequality Techniques
  1. 1Convex functions and Jensen's inequality
  2. 2The tangent line trick and sums of squares
  3. 3The triangle inequality and polynomial bounds

Try the code and the simulations beside the lesson.

What you will be able to do

  • use the tangent line trick on sums with a fixed total;
  • write symmetric expressions as sums of squares;
  • state, prove and use Schur's inequality.

When Jensen is not enough

Positive aaa, bbb and ccc add up to 333. Is a4+b4+c4≥a3+b3+c3a^4 + b^4 + c^4 \ge a^3 + b^3 + c^3a4+b4+c4≥a3+b3+c3?

Try f(x)=x4−x3f(x) = x^4 - x^3f(x)=x4−x3. Then f′′(x)=12x2−6xf''(x) = 12x^2 - 6xf′′(x)=12x2−6x, which is negative for 0<x<120 < x < \dfrac{1}{2}0<x<21​. So fff is not convex on the whole range, and Jensen cannot be used directly. Yet the claim is true.

The tangent line trick

Equality should be at a=b=c=1a = b = c = 1a=b=c=1. Take the tangent to fff at x=1x = 1x=1: f(1)=0f(1) = 0f(1)=0 and f′(1)=4−3=1f'(1) = 4 - 3 = 1f′(1)=4−3=1, so the tangent is y=x−1y = x - 1y=x−1. Now check that the curve stays above it for x>0x > 0x>0:

x4−x3−(x−1)=(x−1)(x3−1)=(x−1)2(x2+x+1) ≥ 0.\displaystyle x^4 - x^3 - (x - 1) = (x - 1)(x^3 - 1) = (x - 1)^2(x^2 + x + 1) \ \ge\ 0.x4−x3−(x−1)=(x−1)(x3−1)=(x−1)2(x2+x+1) ≥ 0.

Add this for x=a,b,cx = a, b, cx=a,b,c:

∑(a4−a3) ≥ ∑(a−1)=(a+b+c)−3=0.\displaystyle \sum (a^4 - a^3) \ \ge\ \sum (a - 1) = (a + b + c) - 3 = 0.∑(a4−a3) ≥ ∑(a−1)=(a+b+c)−3=0.

The tangent line works because its terms add up to a constant. The curve may bend the wrong way somewhere, as long as it stays above the line on the allowed range.

The curve y = x to the power 4 minus x cubed in blue for x from 0 to 2, and its tangent line y = x - 1 at x = 1 in red. The curve touches the line at (1, 0) and stays above it everywhere else, even near x = 0.3 where the curve bends downwards. The space between curve and line is shaded pale orange.

Sums of squares

A square is never negative. So if an expression can be written as a sum of squares with positive coefficients, it is never negative. This is the SOS method. Two identities are used again and again:

a2+b2+c2−ab−bc−ca\displaystyle a^2 + b^2 + c^2 - ab - bc - caa2+b2+c2−ab−bc−ca
=12[(a−b)2+(b−c)2\displaystyle = \dfrac{1}{2}\big[(a - b)^2 + (b - c)^2=21​[(a−b)2+(b−c)2
+(c−a)2],\displaystyle \quad + (c - a)^2\big],+(c−a)2],

and

a3+b3+c3−3abc\displaystyle a^3 + b^3 + c^3 - 3abca3+b3+c3−3abc
=(a+b+c)⋅12[(a−b)2\displaystyle = (a + b + c) \cdot \dfrac{1}{2}\big[(a - b)^2=(a+b+c)⋅21​[(a−b)2
+(b−c)2+(c−a)2].\displaystyle \quad + (b - c)^2 + (c - a)^2\big].+(b−c)2+(c−a)2].

The second one proves AM-GM for three numbers: put a=x3a = \sqrt[3]{x}a=3x​, b=y3b = \sqrt[3]{y}b=3y​, c=z3c = \sqrt[3]{z}c=3z​ with x,y,z>0x, y, z > 0x,y,z>0, and the right side is not negative.

Schur's inequality

For a,b,c≥0a, b, c \ge 0a,b,c≥0,

a(a−b)(a−c)+b(b−a)(b−c)+c(c−a)(c−b) ≥ 0.\displaystyle a(a - b)(a - c) + b(b - a)(b - c) + c(c - a)(c - b) \ \ge\ 0.a(a−b)(a−c)+b(b−a)(b−c)+c(c−a)(c−b) ≥ 0.

Proof. The expression is symmetric, so we may assume a≥b≥ca \ge b \ge ca≥b≥c. The last term c(c−a)(c−b)c(c - a)(c - b)c(c−a)(c−b) is a product of c≥0c \ge 0c≥0 and two numbers that are not positive, so it is not negative. The first two terms add up to

(a−b)[a(a−c)−b(b−c)],\displaystyle (a - b)\big[a(a - c) - b(b - c)\big],(a−b)[a(a−c)−b(b−c)],

and a(a−c)≥b(b−c)a(a - c) \ge b(b - c)a(a−c)≥b(b−c) because a≥ba \ge ba≥b and a−c≥b−c≥0a - c \ge b - c \ge 0a−c≥b−c≥0. So the sum is not negative. Equality holds when a=b=ca = b = ca=b=c, or when two are equal and the third is 000.

Expanded, Schur reads a3+b3+c3+3abc≥ab(a+b)+bc(b+c)+ca(c+a)a^3 + b^3 + c^3 + 3abc \ge ab(a + b) + bc(b + c) + ca(c + a)a3+b3+c3+3abc≥ab(a+b)+bc(b+c)+ca(c+a). It is not a sum of squares, which is why it is worth knowing.

Homogenising. When a condition such as a+b+c=3a + b + c = 3a+b+c=3 is given, you may replace a constant by an expression of the right degree, for example 3=a+b+c3 = a + b + c3=a+b+c, so that every term has the same degree. Then SOS or Schur can be applied.

Practise with new numbers

Try it in Python

The program checks Schur's inequality on many random triples and prints the smallest value it finds. It then checks the second SOS identity at one triple.

Read it first. Then run it. Is Schur's expression ever negative?

1. Allow negative numbers by changing the range to random.uniform(-3, 3). Is Schur still true? Why does the proof need c≥0c \ge 0c≥0?

Common mistakes

  • A tangent at the wrong point. Take the tangent where equality should hold, usually at the equal point.
  • Forgetting to check the whole range. The curve must stay above the line for every allowed value, not only near the point.
  • Dropping the 12\dfrac{1}{2}21​ in the SOS identity.
  • Using Schur with negative numbers. It needs a,b,c≥0a, b, c \ge 0a,b,c≥0.

Remember these

  • Tangent line trick: f(x)≥f(m)+f′(m)(x−m)f(x) \ge f(m) + f'(m)(x - m)f(x)≥f(m)+f′(m)(x−m) on the range, then add.
  • a2+b2+c2−ab−bc−ca=12∑(a−b)2a^2 + b^2 + c^2 - ab - bc - ca = \dfrac{1}{2}\sum (a - b)^2a2+b2+c2−ab−bc−ca=21​∑(a−b)2.
  • a3+b3+c3−3abc=(a+b+c)⋅12∑(a−b)2a^3 + b^3 + c^3 - 3abc = (a + b + c) \cdot \dfrac{1}{2}\sum (a - b)^2a3+b3+c3−3abc=(a+b+c)⋅21​∑(a−b)2.
  • Schur: ∑a(a−b)(a−c)≥0\sum a(a - b)(a - c) \ge 0∑a(a−b)(a−c)≥0 for a,b,c≥0a, b, c \ge 0a,b,c≥0.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. Find the tangent line of f(x)=x2f(x) = x^2f(x)=x2 at x=1x = 1x=1, and check that x2x^2x2 is never below it.
  1. Work out a3+b3+c3−3abca^3 + b^3 + c^3 - 3abca3+b3+c3−3abc for a=1a = 1a=1, b=2b = 2b=2, c=3c = 3c=3 in two ways.
  1. Evaluate Schur's expression for a=2a = 2a=2, b=1b = 1b=1, c=0c = 0c=0.
  1. If real aaa, bbb, ccc satisfy a2+b2+c2=ab+bc+caa^2 + b^2 + c^2 = ab + bc + caa2+b2+c2=ab+bc+ca, what can you say about them?
  1. Why can Jensen not prove a4+b4+c4≥a3+b3+c3a^4 + b^4 + c^4 \ge a^3 + b^3 + c^3a4+b4+c4≥a3+b3+c3 for a+b+c=3a + b + c = 3a+b+c=3 directly?

References

  • Engel, Problem-Solving Strategies, Chapter 7, on inequalities, including Schur's inequality.
  • Steele, The Cauchy-Schwarz Master Class, Chapter 6, on convexity and tangent lines.

Enroll free in Convexity, Jensen and Inequality Techniques

Every lesson is open to read. Enrolling also lets you:

  • Mark lessons done and carry on where you stopped.
  • Take the tests of this lesson and its course.
  • Count the course towards the certificate for its chapter.
No payment. You can leave at any time.

Problems (3)

Non-negative numbers a, b, c and d add up to 4…Hard · High School (11–12) · by StemPy Lab
The identity a³ + b³ + c³ - 3abc; = (a + b + c) · 1/2big[(a - b)²; + (b - c)² + (c - a)²big]; holds…Hard · High School (11–12) · by StemPy Lab
Schur's inequality says that for non-negative a, b, c, a(a - b)(a - c) + b(b - a)(b - c) + c(c…Advanced · High School (11–12) · by StemPy Lab
Next: lesson 3The triangle inequality and polynomial bounds
← Convexity, Jensen and Inequality Techniques
← Convex functions and Jensen's inequalityThe triangle inequality and polynomial bounds →

Discussion (0)

Log in to join the discussion.

Loading…

has a fixed
∑xi\sum x_i∑xi​
, compare
fff
with its tangent line at the point of equality: if
f(x)≥f(m)+f′(m)(x−m)f(x) \ge f(m) + f'(m)(x - m)f(x)≥f(m)+f′(m)(x−m)
on the allowed range, adding gives the bound, even when
fff
is not convex. Many symmetric inequalities reduce to a sum of squares, such as
a2+b2+c2−ab−bc−ca=12∑(a−b)2a^2 + b^2 + c^2 - ab - bc - ca = \tfrac{1}{2}\sum (a - b)^2a2+b2+c2−ab−bc−ca=21​∑(a−b)2
. Schur's inequality covers the cases squares cannot.
about 25 min1 simulation1 practice question1 Python program5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.