This is a beta course, so its structure, chapters, and examples may continue to change.
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 and Convex Functions
Convention note : different textbooks use “concave” and “convex” in opposite ways. Here we follow the common Chinese convention: a concave function bends downward (like
ln x \ln x ln x ), and a convex function bends upward (like
x 2 x^2 x 2 ). When reading other books, always check their convention.
Concave Function
定义
定义是对概念、术语或对象含义的精确描述。理解定义是学习任何知识领域的基础,每个概念都有其明确的定义。
Definition of a Concave Function Let f ( x ) f(x) f ( x ) be continuous on an interval I I I . If for every x 1 , x 2 ∈ I x_1, x_2 \in I x 1 , x 2 ∈ I and every λ ∈ [ 0 , 1 ] \lambda \in [0,1] λ ∈ [ 0 , 1 ] ,
f ( λ x 1 + ( 1 − λ ) x 2 ) ≥ λ f ( x 1 ) + ( 1 − λ ) f ( x 2 ) f(\lambda x_1 + (1-\lambda)x_2) \geq \lambda f(x_1) + (1-\lambda)f(x_2) f ( λ x 1 + ( 1 − λ ) x 2 ) ≥ λ f ( x 1 ) + ( 1 − λ ) f ( x 2 ) then f ( x ) f(x) f ( x ) is said to be concave on I I I .
几何解释The graph bends downward; the chord between any two points lies below the graph.
符号说明
Symbol Type Reading/Explanation Meaning in This Article λ \lambda λ Greek letter Lambda Parameter used for convex combinations
Convex Function
定义
定义是对概念、术语或对象含义的精确描述。理解定义是学习任何知识领域的基础,每个概念都有其明确的定义。
Definition of a Convex Function Let f ( x ) f(x) f ( x ) be continuous on an interval I I I . If for every x 1 , x 2 ∈ I x_1, x_2 \in I x 1 , x 2 ∈ I and every λ ∈ [ 0 , 1 ] \lambda \in [0,1] λ ∈ [ 0 , 1 ] ,
f ( λ x 1 + ( 1 − λ ) x 2 ) ≤ λ f ( x 1 ) + ( 1 − λ ) f ( x 2 ) f(\lambda x_1 + (1-\lambda)x_2) \leq \lambda f(x_1) + (1-\lambda)f(x_2) f ( λ x 1 + ( 1 − λ ) x 2 ) ≤ λ f ( x 1 ) + ( 1 − λ ) f ( x 2 ) then f ( x ) f(x) f ( x ) is said to be convex on I I I .
几何解释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) f ( x ) be twice differentiable on an interval I I I :
If f ′ ′ ( x ) > 0 f''(x) > 0 f ′′ ( x ) > 0 on I I I , then f ( x ) f(x) f ( x ) is convex on I I I
If f ′ ′ ( x ) < 0 f''(x) < 0 f ′′ ( x ) < 0 on I I I , then f ( x ) f(x) f ( x ) is concave on I I I
First-Derivative Test
数学定理
定理是数学中经过严格证明的命题,是数学推理的基础。定理通常包含条件和结论,是数学知识体系的重要组成部分。
定理 2
Let f ( x ) f(x) f ( x ) be differentiable on an interval I I I :
If f ′ ( x ) f'(x) f ′ ( x ) is monotonically increasing on I I I , then f ( x ) f(x) f ( x ) is convex on I I I
If f ′ ( x ) f'(x) f ′ ( x ) is monotonically decreasing on I I I , then f ( x ) f(x) f ( x ) is concave on I I I
Convexity of Common Functions
Quadratic Functions
For f ( x ) = a x 2 + b x + c f(x) = ax^2 + bx + c f ( x ) = a x 2 + b x + c (a ≠ 0 a \neq 0 a = 0 ):
When a > 0 a > 0 a > 0 , f ′ ′ ( x ) = 2 a > 0 f''(x) = 2a > 0 f ′′ ( x ) = 2 a > 0 , so the function is convex
When a < 0 a < 0 a < 0 , f ′ ′ ( x ) = 2 a < 0 f''(x) = 2a < 0 f ′′ ( x ) = 2 a < 0 , so the function is concave
Exponential Functions
For f ( x ) = e x f(x) = e^x f ( x ) = e x :
f ′ ( x ) = e x > 0 f'(x) = e^x > 0 f ′ ( x ) = e x > 0 , monotonically increasing
f ′ ′ ( x ) = e x > 0 f''(x) = e^x > 0 f ′′ ( x ) = e x > 0 , convex
Logarithmic Functions
For f ( x ) = ln x f(x) = \ln x f ( x ) = ln x (x > 0 x > 0 x > 0 ):
f ′ ( x ) = 1 x > 0 f'(x) = \frac{1}{x} > 0 f ′ ( x ) = x 1 > 0 , monotonically increasing
f ′ ′ ( x ) = − 1 x 2 < 0 f''(x) = -\frac{1}{x^2} < 0 f ′′ ( x ) = − x 2 1 < 0 , concave
Power Functions
For f ( x ) = x n f(x) = x^n f ( x ) = x n :
When n > 1 n > 1 n > 1 , f ′ ′ ( x ) = n ( n − 1 ) x n − 2 f''(x) = n(n-1)x^{n-2} f ′′ ( x ) = n ( n − 1 ) x n − 2
For x > 0 x > 0 x > 0 , f ′ ′ ( x ) > 0 f''(x) > 0 f ′′ ( x ) > 0 , convex
For x < 0 x < 0 x < 0 and n n n even, f ′ ′ ( x ) > 0 f''(x) > 0 f ′′ ( x ) > 0 , convex
For x < 0 x < 0 x < 0 and n n n odd, f ′ ′ ( x ) < 0 f''(x) < 0 f ′′ ( x ) < 0 , concave
Applications and Examples
Example 1 : Determine the convexity of f ( x ) = x 3 − 3 x 2 + 2 f(x) = x^3 - 3x^2 + 2 f ( x ) = x 3 − 3 x 2 + 2 .
Solution :
f ′ ( x ) = 3 x 2 − 6 x f'(x) = 3x^2 - 6x f ′ ( x ) = 3 x 2 − 6 x
f ′ ′ ( x ) = 6 x − 6 = 6 ( x − 1 ) f''(x) = 6x - 6 = 6(x-1) f ′′ ( x ) = 6 x − 6 = 6 ( x − 1 )
When x < 1 x < 1 x < 1 , f ′ ′ ( x ) < 0 f''(x) < 0 f ′′ ( x ) < 0 , so the function is concave
When x > 1 x > 1 x > 1 , f ′ ′ ( x ) > 0 f''(x) > 0 f ′′ ( x ) > 0 , so the function is convex
Example 2 : Determine the convexity of f ( x ) = 1 x f(x) = \frac{1}{x} f ( x ) = x 1 (x ≠ 0 x \neq 0 x = 0 ).
Solution :
f ′ ( x ) = − 1 x 2 f'(x) = -\frac{1}{x^2} f ′ ( x ) = − x 2 1
f ′ ′ ( x ) = 2 x 3 f''(x) = \frac{2}{x^3} f ′′ ( x ) = x 3 2
When x < 0 x < 0 x < 0 , f ′ ′ ( x ) < 0 f''(x) < 0 f ′′ ( x ) < 0 , so the function is concave
When x > 0 x > 0 x > 0 , f ′ ′ ( x ) > 0 f''(x) > 0 f ′′ ( x ) > 0 , so the function is convex
Jensen’s Inequality
For a convex function f f f and weights λ i ≥ 0 \lambda_i \geq 0 λ i ≥ 0 with ∑ i λ i = 1 \sum_i \lambda_i = 1 ∑ i λ i = 1 :
f ( ∑ i = 1 n λ i x i ) ≤ ∑ i = 1 n λ i f ( x i ) f\left(\sum_{i=1}^{n} \lambda_i x_i\right) \leq \sum_{i=1}^{n} \lambda_i f(x_i) f ( i = 1 ∑ n λ i x i ) ≤ i = 1 ∑ n λ i f ( x i )
For a concave function, the inequality is reversed:
f ( ∑ i = 1 n λ i x i ) ≥ ∑ i = 1 n λ i f ( x i ) f\left(\sum_{i=1}^{n} \lambda_i x_i\right) \geq \sum_{i=1}^{n} \lambda_i f(x_i) f ( i = 1 ∑ n λ i x i ) ≥ i = 1 ∑ n λ i f ( x i )
Exercises
Exercise 1
Determine the convexity of f ( x ) = x 4 − 4 x 3 + 6 x 2 − 4 x + 1 f(x) = x^4 - 4x^3 + 6x^2 - 4x + 1 f ( x ) = x 4 − 4 x 3 + 6 x 2 − 4 x + 1 .
Answer and Explanation (3 个标签)
convexity second derivative polynomial
Approach : Differentiate twice and analyze the sign.
Detailed steps :
f ′ ( x ) = 4 x 3 − 12 x 2 + 12 x − 4 f'(x) = 4x^3 - 12x^2 + 12x - 4 f ′ ( x ) = 4 x 3 − 12 x 2 + 12 x − 4
f ′ ′ ( x ) = 12 x 2 − 24 x + 12 = 12 ( x 2 − 2 x + 1 ) = 12 ( x − 1 ) 2 f''(x) = 12x^2 - 24x + 12 = 12(x^2 - 2x + 1) = 12(x-1)^2 f ′′ ( x ) = 12 x 2 − 24 x + 12 = 12 ( x 2 − 2 x + 1 ) = 12 ( x − 1 ) 2
For all x ≠ 1 x \neq 1 x = 1 , f ′ ′ ( x ) > 0 f''(x) > 0 f ′′ ( x ) > 0 , so the function is convex
At x = 1 x = 1 x = 1 , f ′ ′ ( 1 ) = 0 f''(1) = 0 f ′′ ( 1 ) = 0 , which needs further analysis
Answer : The function is convex on both ( − ∞ , 1 ) (-\infty, 1) ( − ∞ , 1 ) and ( 1 , + ∞ ) (1, +\infty) ( 1 , + ∞ ) .
Exercise 2
Determine the convexity of f ( x ) = sin x f(x) = \sin x f ( x ) = sin x .
Answer and Explanation (3 个标签)
convexity trigonometric function second derivative
Approach : Differentiate twice and analyze the sign.
Detailed steps :
f ′ ( x ) = cos x f'(x) = \cos x f ′ ( x ) = cos x
f ′ ′ ( x ) = − sin x f''(x) = -\sin x f ′′ ( x ) = − sin x
When sin x > 0 \sin x > 0 sin x > 0 (i.e. x ∈ ( 2 k π , ( 2 k + 1 ) π ) x \in (2k\pi, (2k+1)\pi) x ∈ ( 2 k π , ( 2 k + 1 ) π ) ), f ′ ′ ( x ) < 0 f''(x) < 0 f ′′ ( x ) < 0 , so the function is concave
When sin x < 0 \sin x < 0 sin x < 0 (i.e. x ∈ ( ( 2 k − 1 ) π , 2 k π ) x \in ((2k-1)\pi, 2k\pi) x ∈ (( 2 k − 1 ) π , 2 k π ) ), f ′ ′ ( x ) > 0 f''(x) > 0 f ′′ ( x ) > 0 , so the function is convex
Answer : The function is concave on ( 2 k π , ( 2 k + 1 ) π ) (2k\pi, (2k+1)\pi) ( 2 k π , ( 2 k + 1 ) π ) and convex on ( ( 2 k − 1 ) π , 2 k π ) ((2k-1)\pi, 2k\pi) (( 2 k − 1 ) π , 2 k π ) , where k k k is an integer.
Exercise 3
Determine the convexity of f ( x ) = e − x 2 f(x) = e^{-x^2} f ( x ) = e − x 2 .
Answer and Explanation (3 个标签)
convexity exponential function second derivative
Approach : Differentiate twice and analyze the sign.
Detailed steps :
f ′ ( x ) = − 2 x e − x 2 f'(x) = -2x e^{-x^2} f ′ ( x ) = − 2 x e − x 2
f ′ ′ ( x ) = − 2 e − x 2 + 4 x 2 e − x 2 = 2 e − x 2 ( 2 x 2 − 1 ) f''(x) = -2 e^{-x^2} + 4x^2 e^{-x^2} = 2e^{-x^2}(2x^2 - 1) f ′′ ( x ) = − 2 e − x 2 + 4 x 2 e − x 2 = 2 e − x 2 ( 2 x 2 − 1 )
When 2 x 2 − 1 > 0 2x^2 - 1 > 0 2 x 2 − 1 > 0 (i.e. ∣ x ∣ > 1 2 |x| > \frac{1}{\sqrt{2}} ∣ x ∣ > 2 1 ), f ′ ′ ( x ) > 0 f''(x) > 0 f ′′ ( x ) > 0 , so the function is convex
When 2 x 2 − 1 < 0 2x^2 - 1 < 0 2 x 2 − 1 < 0 (i.e. ∣ x ∣ < 1 2 |x| < \frac{1}{\sqrt{2}} ∣ x ∣ < 2 1 ), f ′ ′ ( x ) < 0 f''(x) < 0 f ′′ ( x ) < 0 , so the function is concave
Answer : The function is convex on ( − ∞ , − 1 2 ) (-\infty, -\frac{1}{\sqrt{2}}) ( − ∞ , − 2 1 ) and ( 1 2 , + ∞ ) (\frac{1}{\sqrt{2}}, +\infty) ( 2 1 , + ∞ ) , and concave on ( − 1 2 , 1 2 ) (-\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}) ( − 2 1 , 2 1 ) .
Summary
Symbols Used in This Article
Symbol Type Reading/Explanation Meaning in This Article f ( x ) f(x) f ( x ) Math symbol f of x A function of variable x x x x 1 , x 2 x_1, x_2 x 1 , x 2 Math symbol x one, x two Two points inside the interval λ \lambda λ Greek letter Lambda A parameter with λ ∈ [ 0 , 1 ] \lambda \in [0, 1] λ ∈ [ 0 , 1 ] f ′ ( x ) f'(x) f ′ ( x ) Math symbol f prime of x The first derivative f ′ ′ ( x ) f''(x) f ′′ ( x ) Math symbol f double prime of x The second derivative I I I Math symbol I An interval
English–Chinese Glossary
English term Chinese term Phonetic Explanation 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