0% found this document useful (0 votes)
84 views4 pages

Difference Between Concave and Convex Function

Convex functions are 'bowl-shaped' and can hold water, while concave functions are 'hill-shaped' and will spill water. Key differences include that a convex function has a non-negative second derivative and any local minimum is a global minimum, whereas a concave function has a non-positive second derivative and any local maximum is a global maximum. Additionally, a function is concave if its negative is convex, illustrating their relationship.

Uploaded by

anjalipandeyap45
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views4 pages

Difference Between Concave and Convex Function

Convex functions are 'bowl-shaped' and can hold water, while concave functions are 'hill-shaped' and will spill water. Key differences include that a convex function has a non-negative second derivative and any local minimum is a global minimum, whereas a concave function has a non-positive second derivative and any local maximum is a global maximum. Additionally, a function is concave if its negative is convex, illustrating their relationship.

Uploaded by

anjalipandeyap45
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

difference between concave and convex functions.

The simplest way to think about it is by their shape:


●​ A convex function is "bowl-shaped" or "U-shaped."1 It can hold water.​

Shutterstock
●​ A concave function is "hill-shaped" or "n-shaped." It will spill water.

A function that is a straight line (like 2$f(x) = 2x + 3$) is the only type that is considered both
convex and concave.3
Key Differences

Here is a side-by-side comparison of their properties.

Property Convex Function (like Concave Function (like


f(x)=x2) f(x)=−x2)

Graphical Test A line segment (chord) A line segment (chord)


connecting any two points connecting any two points
on the graph lies above or on the graph lies below or
on the graph. on the graph.

Shape U-shape, "valley" n-shape, "hill"

Second Derivative The second derivative is The second derivative is


non-negative ($f''(x) \ge non-positive ($f''(x) \le 0$).
0$). This means the slope This means the slope of the
of the function is always function is always
increasing. decreasing.

Tangent Line Any tangent line to the Any tangent line to the
graph lies below or on the graph lies above or on the
function. function.

Mathematical Definition $f(\lambda x + (1 - $f(\lambda x + (1 -


\lambda)y) \le \lambda f(x) \lambda)y) \ge \lambda f(x)
+ (1 - \lambda)f(y)$ + (1 - \lambda)f(y)$

Optimization Any local minimum is a Any local maximum is a


global minimum. This global maximum.
makes them easy to
optimize.

Deeper Explanation
1. The Graphical Test (Chord)

This is the formal definition. Imagine picking any two points on the function's curve and
drawing a straight line between them.
●​ Convex: The curve will always bend under that line.
●​ Concave: The curve will always bend above that line.

2. The Second Derivative Test

This is the easiest way to check for a function of one variable.


1.​ Find the first derivative $f'(x)$ (the slope).
2.​ Find the second derivative 4$f''(x)$ (the rate of change of the slope).5​

●​ If 6$f''(x) \ge 0$ (positive or zero): The slope is always increasing.7 This forces the
graph to curve upwards, making it convex.​

○​ Example: $f(x) = x^2 \implies f'(x) = 2x \implies f''(x) = 2$. Since $2 > 0$, the function
is convex.
●​ If $f''(x) \le 0$ (negative or zero): The slope is always decreasing.9 This forces the
8

graph to curve downwards, making it concave.​

○​ Example: $f(x) = \log(x) \implies f'(x) = 1/x \implies f''(x) = -1/x^2$. Since $x^2$ is
always positive, $-1/x^2$ is always negative. Thus, 10$\log(x)$ is concave.11​

3. Mathematical Definition (Jensen's Inequality)

The inequality $f(\lambda x + (1 - \lambda)y) \le \lambda f(x) + (1 - \lambda)f(y)$ is just a


mathematical way of stating the "chord test."
●​ $f(\lambda x + (1 - \lambda)y)$ is the value of the function at a point between $x$ and
$y$.
●​ $\lambda f(x) + (1 - \lambda)f(y)$ is the value of the chord at that same point.

So, for a convex function, this inequality says:


(The function's value) $\le$ (The chord's value)
For a concave function, the inequality is reversed.12

4. The Relationship Between Them

A function $f(x)$ is concave if and only if its negative, $-f(x)$, is convex.


For example:
●​ $f(x) = -x^2$ (a "hill") is concave.
●​ $-f(x) = -(-x^2) = x^2$ (a "valley") is convex.

You might also like