Convexity and Concavity of Functions

Basic Idea of Convexity

Convexity describes the bending direction of a function’s graph—an important property that reflects how the function changes across intervals.

Concave function

Convex function

Concave and Convex Functions

Concave Function

Definition of a Concave Function

Let f(x)f(x) be continuous on an interval II. If for every x1,x2∈Ix_1, x_2 \in I and every λ∈[0,1]\lambda \in [0,1],

f(λx1+(1−λ)x2)≥λf(x1)+(1−λ)f(x2)f(\lambda x_1 + (1-\lambda)x_2) \geq \lambda f(x_1) + (1-\lambda)f(x_2)

then f(x)f(x) is said to be concave on II.

SymbolTypeReading/ExplanationMeaning in This Article
λ\lambdaGreek letterLambdaParameter used for convex combinations
Geometric interpretation

The graph bends downward; the chord between any two points lies below the graph.

Convex Function

Definition of a Convex Function

Let f(x)f(x) be continuous on an interval II. If for every x1,x2∈Ix_1, x_2 \in I and every λ∈[0,1]\lambda \in [0,1],

f(λx1+(1−λ)x2)≤λf(x1)+(1−λ)f(x2)f(\lambda x_1 + (1-\lambda)x_2) \leq \lambda f(x_1) + (1-\lambda)f(x_2)

then f(x)f(x) is said to be convex on II.

Geometric interpretation

The graph bends upward; the chord between any two points lies above the graph.

Tests for Convexity

Second-Derivative Test

Theorem1

Let f(x)f(x) be twice differentiable on an interval II:

  1. If f′′(x)>0f''(x) > 0 on II, then f(x)f(x) is convex on II
  2. If f′′(x)<0f''(x) < 0 on II, then f(x)f(x) is concave on II

First-Derivative Test

Theorem2

Let f(x)f(x) be differentiable on an interval II:

  1. If f′(x)f'(x) is monotonically increasing on II, then f(x)f(x) is convex on II
  2. If f′(x)f'(x) is monotonically decreasing on II, then f(x)f(x) is concave on II

Convexity of Common Functions

Quadratic Functions

For f(x)=ax2+bx+cf(x) = ax^2 + bx + c (a≠0a \neq 0):

  • When a>0a > 0, f′′(x)=2a>0f''(x) = 2a > 0, so the function is convex
  • When a<0a < 0, f′′(x)=2a<0f''(x) = 2a < 0, so the function is concave

Exponential Functions

For f(x)=exf(x) = e^x:

  • f′(x)=ex>0f'(x) = e^x > 0, monotonically increasing
  • f′′(x)=ex>0f''(x) = e^x > 0, convex

Logarithmic Functions

For f(x)=ln⁡xf(x) = \ln x (x>0x > 0):

  • f′(x)=1x>0f'(x) = \frac{1}{x} > 0, monotonically increasing
  • f′′(x)=−1x2<0f''(x) = -\frac{1}{x^2} < 0, concave

Power Functions

For f(x)=xnf(x) = x^n:

  • When n>1n > 1, f′′(x)=n(n−1)xn−2f''(x) = n(n-1)x^{n-2}
    • For x>0x > 0, f′′(x)>0f''(x) > 0, convex
    • For x<0x < 0 and nn even, f′′(x)>0f''(x) > 0, convex
    • For x<0x < 0 and nn odd, f′′(x)<0f''(x) < 0, concave

Applications and Examples

Example 1: Determine the convexity of f(x)=x3−3x2+2f(x) = x^3 - 3x^2 + 2.

Solution:

  • f′(x)=3x2−6xf'(x) = 3x^2 - 6x
  • f′′(x)=6x−6=6(x−1)f''(x) = 6x - 6 = 6(x-1)
  • When x<1x < 1, f′′(x)<0f''(x) < 0, so the function is concave
  • When x>1x > 1, f′′(x)>0f''(x) > 0, so the function is convex

Example 2: Determine the convexity of f(x)=1xf(x) = \frac{1}{x} (x≠0x \neq 0).

Solution:

  • f′(x)=−1x2f'(x) = -\frac{1}{x^2}
  • f′′(x)=2x3f''(x) = \frac{2}{x^3}
  • When x<0x < 0, f′′(x)<0f''(x) < 0, so the function is concave
  • When x>0x > 0, f′′(x)>0f''(x) > 0, so the function is convex

Jensen’s Inequality

For a convex function ff and weights λi≥0\lambda_i \geq 0 with ∑iλi=1\sum_i \lambda_i = 1:

f(∑i=1nλixi)≤∑i=1nλif(xi)f\left(\sum_{i=1}^{n} \lambda_i x_i\right) \leq \sum_{i=1}^{n} \lambda_i f(x_i)

For a concave function, the inequality is reversed:

f(∑i=1nλixi)≥∑i=1nλif(xi)f\left(\sum_{i=1}^{n} \lambda_i x_i\right) \geq \sum_{i=1}^{n} \lambda_i f(x_i)

Exercises

Exercise 1

Determine the convexity of f(x)=x4−4x3+6x2−4x+1f(x) = x^4 - 4x^3 + 6x^2 - 4x + 1.

convexitysecond derivativepolynomial

Approach:

Differentiate twice and analyze the sign.

Steps:

  1. f′(x)=4x3−12x2+12x−4f'(x) = 4x^3 - 12x^2 + 12x - 4
  2. f′′(x)=12x2−24x+12=12(x2−2x+1)=12(x−1)2f''(x) = 12x^2 - 24x + 12 = 12(x^2 - 2x + 1) = 12(x-1)^2
  3. For all x≠1x \neq 1, f′′(x)>0f''(x) > 0, so the function is convex
  4. At x=1x = 1, f′′(1)=0f''(1) = 0, which needs further analysis

Answer:

The function is convex on both (−∞,1)(-\infty, 1) and (1,+∞)(1, +\infty).

Exercise 2

Determine the convexity of f(x)=sin⁡xf(x) = \sin x.

convexitytrigonometric functionsecond derivative

Approach:

Differentiate twice and analyze the sign.

Steps:

  1. f′(x)=cos⁡xf'(x) = \cos x
  2. f′′(x)=−sin⁡xf''(x) = -\sin x
  3. When sin⁡x>0\sin x > 0 (i.e. x∈(2kπ,(2k+1)π)x \in (2k\pi, (2k+1)\pi)), f′′(x)<0f''(x) < 0, so the function is concave
  4. When sin⁡x<0\sin x < 0 (i.e. x∈((2k−1)π,2kπ)x \in ((2k-1)\pi, 2k\pi)), f′′(x)>0f''(x) > 0, so the function is convex

Answer:

The function is concave on (2kπ,(2k+1)π)(2k\pi, (2k+1)\pi) and convex on ((2k−1)π,2kπ)((2k-1)\pi, 2k\pi), where kk is an integer.

Exercise 3

Determine the convexity of f(x)=e−x2f(x) = e^{-x^2}.

convexityexponential functionsecond derivative

Approach:

Differentiate twice and analyze the sign.

Steps:

  1. f′(x)=−2xe−x2f'(x) = -2x e^{-x^2}
  2. f′′(x)=−2e−x2+4x2e−x2=2e−x2(2x2−1)f''(x) = -2 e^{-x^2} + 4x^2 e^{-x^2} = 2e^{-x^2}(2x^2 - 1)
  3. When 2x2−1>02x^2 - 1 > 0 (i.e. ∣x∣>12|x| > \frac{1}{\sqrt{2}}), f′′(x)>0f''(x) > 0, so the function is convex
  4. When 2x2−1<02x^2 - 1 < 0 (i.e. ∣x∣<12|x| < \frac{1}{\sqrt{2}}), f′′(x)<0f''(x) < 0, so the function is concave

Answer:

The function is convex on (−∞,−12)(-\infty, -\frac{1}{\sqrt{2}}) and (12,+∞)(\frac{1}{\sqrt{2}}, +\infty), and concave on (−12,12)(-\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}).


Summary

Symbols Used in This Article

SymbolTypePronunciation/ExplanationMeaning in This Article
f(x)f(x)Mathematical symbolf of xA function of variable xx
x1,x2x_1, x_2Mathematical symbolx one, x twoTwo points inside the interval
λ\lambdaGreek letterLambdaA parameter with λ∈[0,1]\lambda \in [0, 1]
f′(x)f'(x)Mathematical symbolf prime of xThe first derivative
f′′(x)f''(x)Mathematical symbolf double prime of xThe second derivative
IIMathematical symbolIAn interval

Found an issue with this content?

Tell us what could be improved.