# Intuition behind convex functions

For me, possibly the most out-of-nowhere definition of the first semester of Calculus was the following definition of a convex function and its equivalents.

Function $f$ is convex on the interval $J$ if for $\forall x,y\in J$ and $\forall\lambda\in (0,1)$ is $$f(\lambda x + (1-\lambda )y)\leq\lambda f(x) + (1-\lambda )f(y)\tag1$$

Equivalently if $\forall u,v,w\in J:u<v<w$ $$f(v)(w-u)\leq f(w)(v-u)+f(u)(w-v)\tag2$$

or

$$\frac{f(v)-f(u)}{v-u}\leq \frac{f(w)-f(v)}{w-v}\tag3$$

I'm looking for an intuition, or visual representation of what these three definitions "actually" mean.

(3), being very similar to the definition of a derivative, is the only one that makes sense to me, that is: a function is convex if the slope between points $(u,f(u))$ and $(v,f(v))$ is lesser than the slope between $(v,f(v))$ and $(w,f(w))$.

(2) seems to look at areas of rectangles, however, that is about everything I could say about it.

(1) Got it! $f(\lambda x + (1-\lambda )y)$ is the functional value of a point between $x$ and $y$ and $\lambda f(x) + (1-\lambda )f(y)$ is a point between $f(x)$ and $f(y)$ on a slope between the two points, thus represented by the fact that the slope is never below the functional value. I can now see that it represents the fact that the slope between $x$ and $y$ is always above the function, I don't see, however, how $\lambda f(x) + (1-\lambda )f(y)$ is a point on the slope.

Thanks for any help!

-
(1) is this figure at the top of the Wikipedia article. – Rahul Jan 17 '13 at 7:57
Replace the inequality by an equality and you get a linear function. Thus, you could say that convexity is a form of "sublinearity". – Raskolnikov Jan 17 '13 at 8:00
Note that the inequalities (2) and (3) are exactly equivalent. You can easily show that (3) holds if and only if (2) holds. In other words, they should have the same intuitive meaning. – JavaMan Jan 17 '13 at 8:01
Thanks all. I should've perhaps mentioned that I did indeed observe the wikipedia picture before, but as it often happens, I wasn't able to make sense of it until somebody wiser points me towards it, saying "look at it, it's simple". @JavaMan I'll try to do that now. – Dahn Jahn Jan 17 '13 at 8:10
It looks to me like you have answered the question yourself, with just a little help from the comments. I suggest you summarize what you have learned as an answer. You can even accept your own answer (thought you don't get the usual reputation boost from that). – Harald Hanche-Olsen Jan 17 '13 at 10:00

I have a little time now, I'll try to elaborate more later:

(1) Is very well visualised on this picture from wikipedia. $\lambda x + (1-\lambda )y$ is a value that for $\lambda\in (0,1)$ always is between $x$ and $y$ and so $f(\lambda x + (1-\lambda )y)$ is the functional value of a point between $x$ and $y$ and $\lambda f(x) + (1-\lambda )f(y)$ is a point between $f(x)$ and $f(y)$ on a line between the two points, thus representing the fact that the line joining any two points on the function is never below the functional value.

(3) Can be best understood through derivatives. It is an inequality of two slopes , saying that a function is convex if the slope between points $(u,f(u))$ and $(v,f(v))$ is lesser than the slope between $(v,f(v))$ and $(w,f(w))$.

(2) As JavaMan pointed out, "the inequalities (2) and (3) are exactly equivalent", "In other words, they should have the same intuitive meaning"

Further comment on the intuition of convexity was given by Raskolnikov, who said

Replace the inequality by an equality and you get a linear function. Thus, you could say that convexity is a form of "sublinearity"

Thanks to all for help.

-
"You could say that convexity is a form of sublinearity." Not really. It would be better to say that it is a form of "subaffinity." – goblin Oct 20 '14 at 17:35