Open In App

Convex and Concave Functions

Last Updated : 03 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

In mathematics, convex and concave functions describe how curves behave in terms of their curvature. A convex function curves upwards, meaning that a straight line between any two points on the graph will lie above or on the graph. A concave function curves downwards, meaning that the line segment between any two points lies below or on the graph.

Convex Functions

A function f(x) is called convex on an interval if, for any two points x_1 and x_2 in the interval and any \lambda \in [0, 1] , the following holds:

f(\lambda x_1 + (1-\lambda) x_2) \leq \lambda f(x_1) + (1-\lambda) f(x_2)

This means that the function’s graph lies below or on the line segment (chord) connecting any two points on the graph. This property is important in optimization: for convex functions, any local minimum is also a global minimum.

Examples of Convex Functions

Some examples of convex functions are:

  • f(x) = x2
  • f(x) = ex
  • f(x) = |x|

Graphical Representation of Convex Functions

Key graphical features of a convex function:

  • Tangent Line: At any point on the graph, the tangent line lies below curve.
  • Chord: The line segment connecting any two points on the graph lies above or on the graph.
conacve-and-convex-function-01
These features visually demonstrate the upward curvature of convex functions.

Concave Functions

A function g(x) is called concave on an interval if, for any two points x_1 and x_2 in the interval and any \lambda \in [0, 1] , the following holds:

g(\lambda x_1 + (1-\lambda) x_2) \geq \lambda g(x_1) + (1-\lambda) g(x_2)

This implies the graph of the function lies above or on the line segment joining any two points indicating downward curvature.

Examples of Concave Functions

Some examples of concave functions are:

  • g(x) = - x2
  • g(x) = log x
  • g(x) = -ex

Graphical Representation of Concave Functions

Graphical features of a concave function:

  • Tangent Line: At any point on the graph, the tangent line lies above the curve.
  • Chord: The line segment connecting any two points on the graph lies below or on the graph.
conacve-and-convex-function-02

Some common properties related to Concave and Convex Functions are:

First Derivative Test for Convexity/Concavity

  • A function f(x) is convex, If f′(x) is non-decreasing i.e., f′(x) ≥ 0.
  • A function f(x) is concave, If f′(x) is non-increasing i.e., f′(x) ≤ 0.

Second Derivative Test

For a function f(x):

  • If f′′(x) > 0 at a particular point, the function is convex at that point.
  • If f′′(x) < 0 at a particular point, the function is concave at that point.
  • If f′′(x) = 0, the second derivative test is inconclusive, and other methods are needed to determine the behavior.

Jensen's Inequality

  • If ϕ is a convex function and X is a random variable, then: ϕ(E[X]) ≤ E[ϕ(X)].
  • If ϕ is concave, the inequality is reversed: ϕ(E[X]) ≥ E[ϕ(X)].

Convex vs. Concave Functions

Some of the key differences between convex and concave functions are:

FeatureConvex FunctionConcave Function
DefinitionLies below or on the chordLies above or on the chord
Mathematical ConditionFor f(λx1 ​+ (1 − λ)x2​) ≤ λf(x1​) + (1 − λ)f(x2​) where λ∈[0, 1].For f(λx1​ + (1 − λ)x2​) ≥ λf(x1​) + (1 − λ)f(x2​) where λ∈[0, 1].
First Derivativenon-decreasing.non-increasing.
Second Derivativef′′(x) ≥ 0.f′′(x) ≤ 0.
Graphical RepresentationThe graph "bends upwards" or is U-shaped.The graph "bends downwards" or is inverted U-shaped.
ApplicationMinimization problemsMaximization problems
Tangent LineLies below or on the graph.Lies above or on the graph.

Solved Problems on Convex and Concave Functions

Problem 1: Show that f(x) = ex is a convex function.

Solution:

First, compute the second derivative of f(x):

f'(x) = ex and f''(x) = ex

Since f''(x) = ex ≥ 0 for all x , f(x) is convex.

Problem 2:Determine if g(x) = -x2 is concave or convex.

Solution:

First, compute the second derivative:

g'(x) = -2x and g''(x) = -2

Since g'(x) = -2 < 0 for all x.

Thus, g(x) is concave.

Problem 3: Minimize f(x) = x^2 + 4x + 6 .

Solution:

Given: f(x) = x^2 + 4x + 6

Now, f'(x) = 2x + 4

Set f'(x) = 0 to find the critical point:

2x + 4 = 0 \quad \Rightarrow \quad x = -2

The second derivative is:

f''(x) = 2

Since f''(x) > 0 , the function is convex, and x = -2 is the global minimum. Thus, the minimum value of f(x) is f(-2) = 2 .

Problem 4: Prove that the function f(x) = x^2 is convex using the definition of convexity.

Solution:

By the definition, a function f(x) is convex if for any \lambda \in [0, 1] and for any two points x_1, x_2 \in \mathbb{R} , we have:

f(\lambda x_1 + (1-\lambda) x_2) \leq \lambda f(x_1) + (1-\lambda) f(x_2)

Consider \( f(x) = x^2 \), then:

f(\lambda x_1 + (1-\lambda) x_2) = (\lambda x_1 + (1-\lambda) x_2)^2

Expanding this expression:

(\lambda x_1 + (1-\lambda) x_2)^2 = \lambda^2 x_1^2 + 2\lambda(1-\lambda)x_1x_2 + (1-\lambda)^2 x_2^2

On the other hand, we have:

\lambda f(x_1) + (1-\lambda) f(x_2) = \lambda x_1^2 + (1-\lambda) x_2^2

Now, comparing both sides:

\lambda^2 x_1^2 + 2\lambda(1-\lambda)x_1x_2 + (1-\lambda)^2 x_2^2 \leq \lambda x_1^2 + (1-\lambda) x_2^2

Since \ 2\lambda(1-\lambda) x_1 x_2 \geq 0 , the inequality holds. Thus, f(x) = x^2 is convex.

Problem 5: Show that the function f(x) = -x^3 is concave using the first derivative test.

Solution:

First, calculate the first and second derivatives of f(x) :

f'(x) = -3x^2 \quad \text{and} \quad f''(x) = -6x

  • For x \geq 0 , f''(x) = -6x \leq 0 , so the function is concave for x \geq 0 .
  • For x < 0 , f''(x) = -6x \geq 0 , but since f(x) = -x^3 , the function is still concave overall.

Practice Problems: Convex and Concave Functions

Problem 1: Determine if f(x) = x^4 is convex or concave.

Problem 2: Prove that f(x) = -e^x is concave.

Problem 3: Identify whether the function f(x) = \log(x)is convex or concave. f(x) = \log(x)

Problem 4: For f(x) = x^2 - 4x + 4 , find the minimum and check if it's convex or concave.

Problem 5: Determine the intervals of convexity and concavity for f(x) = x^3 - 3x^2 + 4x .

Problem 6: Check if the function f(x) = |x| is convex.

Problem 7: Prove that f(x) = \cos(x) is concave on the interval (0, \pi)

Problem 8: Find the critical points and the nature of the function f(x) = x^3 + 3x^2 - 9x + 1 .

Read More


Similar Reads