Convex function

A con­vex func­tion “only curves up­wards.” To check whether a func­tion is con­vex, use the fol­low­ing pro­ce­dure:

  1. Draw the graph of the func­tion.

graph of a function

  1. Select any two points in the graph.

graph with two points

  1. Draw a line seg­ment con­nect­ing the two points.

graph with two points connected

  1. See whether this line seg­ment is ever lower than the graph.

graph with part of line segment highlighted

If the line seg­ment is ever lower than the graph, the func­tion is not con­vex. The func­tion graphed above is not con­vex, as can be seen by look­ing at the red part of the line seg­ment. On the other hand, if the line seg­ment never goes be­low the graph (no mat­ter which two ini­tial points you se­lected), then the func­tion is con­vex.

Equiv­a­lently, a func­tion is con­vex if its epi­graph is a con­vex set.