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?
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.