Jensen's Inequality Explained with Worked Examples

For a convex function and weights with : . For concave functions the inequality reverses.

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

What Jensen's inequality means

For , with equal weights: ; the gap 1 is the variance of the values (variance). For with : . For on positive numbers : . Convexity is explained in convex functions and concavity and inflection.

In probability it reads : since is convex, , which is the statement that variance is non-negative (expectation and variance). Applied to the concave logarithm it proves the AM–GM inequality, and it underlies the non-negativity of the KL divergence (KL divergence).

It also bounds financial and physical averages (the average of a convex payoff is at least the payoff at the average) and gives Bernoulli's inequality for . Equality holds only when all are equal (for strictly convex ).

What is it used for?

For a convex function the value at the average is below the average of the values.

How to use jensen's inequality

  1. Check that is convex (second derivative non-negative).
  2. Compute at the weighted mean.
  3. Compute the weighted mean of the .
  4. Compare: the first is not larger than the second.

Graph

f(x) = x² and the chord from (1, 1) to (3, 9)f(2) = 4chord at 2: 500.511.522.533.540246810121416f(x) = x² and the chord from (1, 1) to (3, 9)xyf(x) = x²chordGraph with x from 0 to 4 and y from 0 to 16. Shows the curve f(x) = x²; the curve chord; point f(2) = 4 at (2, 4); point chord at 2: 5 at (2, 5).

The chord lies above the curve, so f(mean) ≤ mean of f.

Worked examples

These examples are worked by hand, step by step, so you can compare your own working.

Example 1: f = x²

Compare with the average of and .

Worked example
Answer
4≤54\le5
  1. Left
  2. Right

Example 2: f = eˣ

Compare with the average of and .

Worked example
Answer
2.718≤4.1952.718\le4.195
  1. Left
  2. Right

Example 3: f = x³

Compare with the average of .

Worked example
Answer
8≤128\le12
  1. Left
  2. Right

Special cases

A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.

f = x², values 1, 3

f(mean) = 4, mean of f = 5

4 ≤ 5.

f = eˣ, values 0, 2

e¹ = 2.7183 ≤ 4.1945

Convex.

f = ln, values 1, 9

ln 5 = 1.6094 ≥ 1.0986

Concave reverses.

Gap for x²

5 − 4

Equals the variance.

Word problems

For convex f, f(E X) ≤ E f(X); for concave f the inequality reverses. Equality holds iff X is constant (or f is linear).

f of the mean

f = x², values 1 and 3. Find f(2).

  1. 2²
  2. Check: ✓4

Mean of f

Find (1 + 9)/2.

  1. 5
  2. Check: 4 ≤ 5 ✓5

Exponential Higher

Find e¹ and compare with (1 + e²)/2.

  1. 2.7183 vs 4.1945
  2. Check: ✓2.7183

Logarithm Higher

Find ln 5 for values 1 and 9.

  1. 1.6094
  2. Check: ≥ (ln 1 + ln 9)/2 = 1.0986 ✓1.6094

Common mistakes

Wrong direction for concave

f(E X) ≤ E f ✗

f(E X) ≥ E f ✓

Reverse.

Applying to non-convex f

any f ✗

check f″ ≥ 0 ✓

Convex only.

Equal always

f(E X) = E f(X) ✗

only if constant ✓

Strict otherwise.

Mean of squares vs square of mean

same ✗

differ by variance ✓

Var X = E X² − (E X)².

Exam tips

  1. Convex: f(mean) ≤ mean f.
  2. Concave: reversed.
  3. Check f″.
  4. Variance is the gap for x².
  5. AM–GM from ln.

Practice questions

Try each one on paper, then open the answer. Use the solver above to see the full working.

1. Mean of x² for 2 and 4 Foundation

10

2. Square of mean for 2 and 4 Foundation

9

3. Gap (variance) for 2 and 4 Foundation

1

4. ln of mean of 2 and 8 Higher

1.6094

5. Mean of ln for 2 and 8 Higher

1.3863

6. e^(mean) for 0 and 2 to 4 d.p. Higher

2.7183

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

Jensen’s inequality
f(E X) vs E f(X).
Convex function
Chord above the curve.
Concave function
Chord below the curve.
Expectation
Weighted mean.
Variance
E X² − (E X)².
AM–GM
Consequence for ln.

Frequently asked questions

What is Jensen’s inequality?

For convex f, f(E X) ≤ E f(X).

What if f is concave?

The inequality reverses.

When is it an equality?

When X is constant or f linear.

How is it linked to variance?

For f = x² the gap is Var X.

Which page covers Bernoulli?

Bernoulli’s inequality.

Which page covers Cauchy–Schwarz?

integral Cauchy–Schwarz.

More in Analysis, algebra and topology and the formula sheets.