# Convexity of a function and constraint

Consider the quadratic function $f(x_1,x_2,x_3,x_4)=x_1+2x_2+4x_4+x_1^2+5x_2^2+3x_3^2x_4^2-4x_1x_2-2x_2x_3+2x_3x_4$. Is f a convex function?

Consider a constraint defined using the above function f: $f(x_1,x_2,x_3,x_4)\le6$. Is is a convex constraint?

I think f is a convex function when I write the function in matrix notation I have the sum of a positive definite matrix and a linear vector. How do I show that a constraint is convex?

-
Sorry, but what is a convex constraint? – Tomás Oct 5 '12 at 11:19

\begin{align*} f'({\bf x}) &:= \begin{bmatrix} \partial_1f, \partial_2f, \partial_3f, \partial_4f \end{bmatrix} \\ f''({\bf x})&:=[\partial_i\partial_jf]_{i,j} \end{align*} and conclude whether this symmetric matrix $f''({\bf x})$ is positive semidefinit or not.
As written the function is not quadratic. It is not convex either: Consider the restriction $$\phi(u,v):=f(0,0,u,v)=4u+3u^2v^2+2uv=4u+u v(2+3uv)\ .$$ The linear term $4u$ is irrelevant, and the degree $2$ term $2uv$ assumes both signs in the immediate neighborhood of $(0,0)$. It follows that the graph of $f$ intersects its tangent plane at $(0,0,0,0)$.