# Monotone function which is separately convex but not convex

I am looking for a function $$f\,:\,\mathbb{R}^n\to\mathbb{R}$$ which is separately convex and increasing but not convex.

That is to say, the function is convex and increasing in each coordinate while the others variables are fixed but (globally) the function is not convex on $$\mathbb{R}^n$$.

A example in $$\mathbb{R}^n$$ would be nice but $$\mathbb{R}^2$$ will be ok.

Edit : the monotonicity assumption has been replaced by the fact that $$f$$ need to be increasing.

• Does $f(x,y) = xy$ work, or am I missing a restriction somewhere? – Nathaniel Johnston Jun 18 '19 at 16:58
• Nice, so simple that I did not think about it ! Do you have any idea if we assume furthermore that the function is increasing in each coordinate ? – Kevin Tanguy Jun 18 '19 at 17:02
• I already tried the function $f(x,y)=\frac{x^2}{2}+2xy+y^2$ when $x\geq 0$ and $y\geq 0$ but it would be better to find a function on the whole space. – Kevin Tanguy Jun 18 '19 at 17:05
• In fact, the function $f(x,y)=xy$ is not monotone (for instance $\partial_xf=y$ depends on the sign of $y$) – Kevin Tanguy Jun 20 '19 at 12:45

Let $$f(x)$$ be as follow $$f(x)=\left\{ \begin{array}{ll} x+1 \quad \text{when}\quad x\geq 0,\\ e^x\quad \text{otherwise}.\\ \end{array} \right.$$
Then, set $$g(x,y)=f(x)^2+22f(x)f(y)+f(y)^2$$. It is a simple matter to check that $$g$$ satisfy the wanted properties. Besides, $$g$$ is not convex on $$\mathbb{R}^2$$ since $${\rm Det}\big({\rm Hess}\, g(x,y)\big)<0$$ on $$\mathbb{R}_+^2$$.