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)

凸函数 (Convex)

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,x2Ix_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.

几何解释

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

符号说明
SymbolTypeReading/ExplanationMeaning in This Article
λ\lambdaGreek letterLambdaParameter used for convex combinations

Convex Function

Definition of a Convex Function

Let f(x)f(x) be continuous on an interval II. If for every x1,x2Ix_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.

几何解释

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

Tests for Convexity

Second-Derivative Test

定理1

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

定理2

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 (a0a \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)=lnxf(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(n1)xn2f''(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)=x33x2+2f(x) = x^3 - 3x^2 + 2.

Solution:

  • f(x)=3x26xf'(x) = 3x^2 - 6x
  • f(x)=6x6=6(x1)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} (x0x \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 λi0\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)=x44x3+6x24x+1f(x) = x^4 - 4x^3 + 6x^2 - 4x + 1.

Answer and Explanation(3 个标签)
convexitysecond derivativepolynomial

Approach: Differentiate twice and analyze the sign.

Detailed steps:

  1. f(x)=4x312x2+12x4f'(x) = 4x^3 - 12x^2 + 12x - 4
  2. f(x)=12x224x+12=12(x22x+1)=12(x1)2f''(x) = 12x^2 - 24x + 12 = 12(x^2 - 2x + 1) = 12(x-1)^2
  3. For all x1x \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)=sinxf(x) = \sin x.

Answer and Explanation(3 个标签)
convexitytrigonometric functionsecond derivative

Approach: Differentiate twice and analyze the sign.

Detailed steps:

  1. f(x)=cosxf'(x) = \cos x
  2. f(x)=sinxf''(x) = -\sin x
  3. When sinx>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 sinx<0\sin x < 0 (i.e. x((2k1)π,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 ((2k1)π,2kπ)((2k-1)\pi, 2k\pi), where kk is an integer.

Exercise 3

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

Answer and Explanation(3 个标签)
convexityexponential functionsecond derivative

Approach: Differentiate twice and analyze the sign.

Detailed steps:

  1. f(x)=2xex2f'(x) = -2x e^{-x^2}
  2. f(x)=2ex2+4x2ex2=2ex2(2x21)f''(x) = -2 e^{-x^2} + 4x^2 e^{-x^2} = 2e^{-x^2}(2x^2 - 1)
  3. When 2x21>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 2x21<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

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

English–Chinese Glossary

English termChinese termPhoneticExplanation
concavity/convexity凹凸性/ˌkɒnkəˈvɪti/ /ˌkɒnvekˈsɪti/The bending direction of a function’s graph
concave function凹函数/kɒnˈkeɪv ˈfʌŋkʃən/A function whose graph bends downward
convex function凸函数/ˈkɒnveks ˈfʌŋkʃən/A function whose graph bends upward
second derivative二阶导数/ˈsekənd dɪˈrɪvətɪv/The derivative of the first derivative
first derivative一阶导数/fɜːst dɪˈrɪvətɪv/The derivative of the function
monotonically increasing单调递增/ˌmɒnəʊˈtɒnɪkli ɪnˈkriːsɪŋ/Values grow as the input grows
monotonically decreasing单调递减/ˌmɒnəʊˈtɒnɪkli dɪˈkriːsɪŋ/Values shrink as the input grows