How can we prove that $3-(x^2+y^2)$ is concave? 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?
 A: 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.
A: 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.
