Easy way to check if multi-variable function is convex I know that a function with one variable has to have continuous positive second order derivative for every $x$. Is there an easy way like that to check convexity for multi-variable functions? For example let's consider the function $f(x_1,x_2)=\frac{1}{3}x_1^3-4x_1+\frac{1}{3}x_2^3-16x_2$
 A: When dealing with bivariate functions, one may be able to decide whether a given function is convex merely by plotting it. For example, the function you give is clearly non-convex:

which is unsurprising, as the function is defined by a bivariate polynomial of degree $3$, which is odd.
When dealing with more general multivariate polynomial functions... it's complicated:


*

*Amir Ali Ahmadi, Alex Olshevsky, Pablo A. Parrilo, John N. Tsitsiklis, NP-hardness of Deciding Convexity of Quartic Polynomials and Related Problems, December 2010.



We show that unless P=NP, there exists no polynomial time (or even pseudo-polynomial time) algorithm that can decide whether a multivariate polynomial of degree four (or higher even degree) is globally convex. This solves a problem that has been open since 1992 when N. Z. Shor asked for the complexity of deciding convexity for quartic polynomials. We also prove that deciding strict convexity, strong convexity, quasiconvexity, and pseudoconvexity of polynomials of even degree four or higher is strongly NP-hard. By contrast, we show that quasiconvexity and pseudoconvexity of odd degree polynomials can be decided in polynomial time.

