Calculus

Convex Function

Students stretch a straight string above the upward curve of a wooden bowl.

Convex Function definition

A function is convex on a convex domain when the line segment between any two points on its graph lies on or above the graph.

In Spanish
función convexa
Topic
Optimization and constraints

Convex Function in a picture

Convex Function diagramThe chord connecting (−1, 1) to (1, 1) lies above the curve y = x² between the endpoints.(−1, 1)(1, 1)The chord is above the graph
The chord connecting (−1, 1) to (1, 1) lies above the curve y = x² between the endpoints.

How it works

For 0 ≤ t ≤ 1, convexity requires f((1 − t)x + ty) ≤ (1 − t)f(x) + tf(y). For a twice-differentiable function on an open interval, a nonnegative second derivative is equivalent to convexity. In convex minimization, any local minimum is also a global minimum.

Worked examples

Is f(x) = x² convex on the real line?

Yes. Its second derivative is 2 everywhere.

Is f(x) = −x² convex on the real line?

No. The second derivative is −2 and its chords lie below the curve.

Is an affine function convex?

Yes. Its graph and the chord coincide, so the inequality holds with equality.

Common mistake

Check the entire stated domain. A function may be convex on one interval and fail to be convex on another.

Quick check

Where does the chord between two graph points lie for a convex function?

What sign of the second derivative supports convexity on an interval?

Show answer

Nonnegative.

Can a straight-line function be convex?

Show answer

Yes. Every chord coincides with the graph.

Sources

Flashcard

Convex Function

Reveal the definition

A function is convex on a convex domain when the line segment between any two points on its graph lies on or above the graph.

Effortless Math. “Convex Function.” Math Dictionary.