2

Since we can't use the same method to differentiate a function twice since it's not a linear function, how can one prove that this function is convex or concave? I checked the graph of this function on wolfram and it's concave.

I tried this but it seems wrong:

A function is convex if:

$\forall x,y\in \Bbb R^n,\forall \lambda \in [0,1]: f(\lambda x+(1-\lambda) y) \le \lambda f(x) + (1-\lambda) f(y).$

$$f(x,y)=3-(x^2+y^2), (x,y)\in\Bbb R^2$$

$$f(x)=3- \begin{pmatrix} 1 \\ 1 \end{pmatrix}^Tx, x\in\Bbb R^2 $$

$$f(y)=3- \begin{pmatrix} 1 \\ 1 \end{pmatrix}^Ty, y\in\Bbb R^2 $$

$$\forall x,y\in\Bbb R^2, \forall \lambda\in[0,1]:f(\lambda x+(1-\lambda)y) = 3- \begin{pmatrix} 1 \\ 1 \end{pmatrix}^T(\lambda x+(1-\lambda)y)$$

$$3\lambda x + 3(1-\lambda)y - \lambda \begin{pmatrix} 1 \\ 1 \\ \end{pmatrix}^Tx -(1-\lambda )\begin{pmatrix} 1 \\ 1 \\ \end{pmatrix}^Ty$$

$$3\lambda x - \lambda f(x)+3(1-\lambda) y-(1-\lambda)f(y)$$

So it's not convex? But how can I prove that it's concave?

  • Hi, welcome to math.se. I've fixed your MathJax for $\Bbb R$, but we'll done on getting the basics right. You can get $\Bbb R$ with \Bbb R or \mathbb{R}. – J.G. Jun 13 '20 at 20:59
  • Who says you cannot differentiate twice? It is a twice differential function whose Hessian matrix you can check. Linearity is not a precondition for a function to be twice differentiable. – FakeAnalyst56 Jun 13 '20 at 21:00
  • So if I find that the second partial derivatives are negative then it's concave? – Ahhh Physics Jun 13 '20 at 21:04
  • @AhhhPhysics Not exactly, see my answer. In this case, yes, but you have to check the mixed partials as well. Google "Second order conditions for convexity" – FakeAnalyst56 Jun 13 '20 at 21:06
  • “Convex” is defined by the inequality that you stated. The definition of “concave” is the same except that instead of $\text{“}\le\text{''}$ you have $\text{“}\ge\text{''}.$ The definition does not involve derivatives even if in some cases the proof makes use of derivatives. – Michael Hardy Jun 14 '20 at 00:00

2 Answers2

1

The Hessian matrix is given by $$H=\begin{bmatrix} \partial_{xx} f & \partial_{xy} f \\ \partial_{yx} f & \partial_{yy} f\end{bmatrix}=\begin{bmatrix}-2 & 0 \\ 0 & -2\end{bmatrix}.$$ For any $\vec{v}=[u,w]^T$, we have $$\vec{v}^T H\vec{v} = [u,w]\cdot \begin{bmatrix}-2 & 0 \\ 0 & -2\end{bmatrix}\begin{bmatrix} u \\ w\end{bmatrix}=[u,w]\cdot \begin{bmatrix} -2u \\ -2w\end{bmatrix}=-2u^2-2w^2=-2(u^2+w^2)\le 0.$$ Thus, the function is concave.

1

The problem is equivalent to showing $x^2+y^2$ is convex. I'll provide a variant on @FakeAnalyst56's answer that doesn't require familiarity with Hessian matrices. Differentiating in an arbitrary direction uses an operator of the form $a\partial_x+b\partial_y$ for constants $a,\,b$. (These constants play the same role as $u,\,w$ in their answer.) And an arbitrary twice-differentiable function $f(x,\,y)$ has second derivative$$(a\partial_x+b\partial_y)^2f=(a^2\partial_x^2+2ab\partial_x\partial_y+b^2\partial_y^2)f$$in that direction. If we can show this $\ge0$ for $f=x^2+y^2$ regardless of the choice of $a,\,b$, we're done. In fact$$(a^2\partial_x^2+2ab\partial_x\partial_y+b^2\partial_y^2)(x^2+y^2)=2a^2+2b^2$$includes no $\partial_x\partial_y$ contribution.

J.G.
  • 115,835