[Math] Concavity/convexity of a two variable function

multivariable-calculusoptimization

Here is my question:

Determine for which values of a the following is concave, convex or neither:

$$f(x,y) = -9x^2 + axy – y^2 + 4ay$$

What I have so far is that the Hessian matrix of this is

$$\left(\begin{array}{cc}
-18 & a \\
a & -2
\end{array}\right)$$

I want to find if it is negative definite or negative semidefinite to prove its concavity.

The first principal minor is obviously negative, yet the second principal minor is negative only if $|a| > 6$. But I find on WolframAlpha that the function has a max (and is thus concave) only if $|a| < 6$, not greater than.

I'm not sure what I'm doing wrong here.

Best Answer

Because of the negative square terms it will never be concave up. So you need to check if it is convex everywhere and for all directions. Let y=mx+b then check if d^2 / dm^2 is negative for all x,b.