Is the function $f(x)=x^TAx$ convex when $A \in S^n,A\geq0$,$x\in R^n$?

6.8k Views Asked by At

Is the function $f(x)=x^TAx$ convex when $A \in S^n,A\geq0$,$x\in R^n$?

Notation

$S^n$: Symmetric $n$ x $n$ matrix.

$R^n$: Column vector $n$x$1$

$A \geq 0$: $A$ is positive semi-definite matrix

  • I know that $x^TAx$ is convex when $A \in S^n,S\geq0$,$x\in R^n$ but I not sure why exactly this is happening. Can somebody elaborate on it?
  • Is it safe to say that when $A\geq 0$ and $x$ is non negative the function $x^TAx$ is a parabola in $R^n$ towards $+\infty$. I mean in $R^2$ $f(x)=ax^2+bx+c$ is a parabola. But is there parabola in $R^n$ for example in $R^3$, is $f(x,y)=ax^2+by^2+cxy +d$ a parabola on $R^3$ or there is no such thing?
2

There are 2 best solutions below

3
On BEST ANSWER

Yes, $f$ is convex. This follows from the fact that the Hessian of $f$ is positive semidefinite: \begin{equation*} \nabla^2 f(x) = 2A \geq 0 \end{equation*} for all $x$.

0
On

We can check the convexity of $f$ directly. First, we observe that for all $p\in[0,1]$ and $q=1-p$ and $r,s\in\mathbb{R}$, we have $$ p^2r^2+2pqrs+q^2s^2\leq pr^2+qs^2 $$ because $\text{RHS}-\text{LHS}=pq(r-s)^2$. Now let's use this: for $x,y\in\mathbb{R}^n$, $p\in[0,1]$, and $q=1-p$, we can write $s^2=x'Ax$, $r^2=y'Ay$ and have the following: $$ f(px+qy)\leq p^2r^2+2pqrs+q^2s^2\leq pr^2+qs^2=pf(x)+qf(y). $$ The first inequality above is a simple application of the Cauchy-Schwarz inequality. The claim follows.