Multivariate calculus · EC3304

The Hessian, concavity
& convexity

Curvature decides everything in optimisation. Whether a first-order condition delivers a maximum, a minimum, or neither depends on the second derivatives of the objective, and in several variables those are packaged into the Hessian matrix. This page defines the Hessian, states Young's theorem, defines concave and convex functions, and shows how the definiteness of the Hessian tests for them, with a full worked leading-principal-minor calculation.

Second-order partial derivatives

Each first-order partial derivative \(\partial f/\partial y_i\) of a multivariate function \(f\) is itself a function on \(\mathbb{R}^n\), so it has its own partial derivatives. These are the second-order partial derivatives:

$$\frac{\partial^2 f(\mathbf y)}{\partial y_j\,\partial y_i}:=\frac{\partial}{\partial y_j}\!\left(\frac{\partial f(\mathbf y)}{\partial y_i}\right),$$

sometimes written \(f_{ji}(\mathbf y)\) for brevity. A function \(f\) is \(C^1\) if all its first partial derivatives are continuous throughout its domain, and \(C^2\) if all its second-order partial derivatives are continuous as well. \(C^2\) is the natural setting for second-order optimisation conditions.

The Hessian matrix and Young's theorem

Definition — Hessian matrix

The Hessian of a function \(f:\mathbb{R}^n\to\mathbb{R}\) is the \(n\times n\) matrix of its second-order partial derivatives,

$$H^f(\mathbf y):=\left(\frac{\partial^2 f(\mathbf y)}{\partial y_i\,\partial y_j}\right)_{n\times n}=\big(f_{ij}(\mathbf y)\big)_{n\times n}.$$

Young's theorem (symmetry of the Hessian)

If \(f:S\subset\mathbb{R}^n\to\mathbb{R}\) is a \(C^2\) function, then at every point \(\mathbf y\in S\),

$$\frac{\partial^2 f(\mathbf y)}{\partial y_i\,\partial y_j}=\frac{\partial^2 f(\mathbf y)}{\partial y_j\,\partial y_i}\quad\text{for all }i,j,$$

so the order of differentiation does not matter and the Hessian \(H^f(\mathbf y)\) is a symmetric matrix.

Symmetry is not a technicality: it is what lets us apply the theory of symmetric-matrix definiteness (real eigenvalues, principal-minor tests) to curvature questions.

Worked example: computing a Hessian

Worked example

Let

$$f(y_1,y_2,y_3)=100-2y_1^2-y_2^2-3y_3-y_1y_2-e^{y_1+y_2+y_3}.$$

The first-order partials are \(f_1=-4y_1-y_2-e^{y_1+y_2+y_3}\), \(f_2=-2y_2-y_1-e^{y_1+y_2+y_3}\) and \(f_3=-3-e^{y_1+y_2+y_3}\). Differentiating again and writing \(e:=e^{y_1+y_2+y_3}\),

$$H^f(y_1,y_2,y_3)=\begin{pmatrix}-4-e & -1-e & -e\\ -1-e & -2-e & -e\\ -e & -e & -e\end{pmatrix}.$$

The matrix is symmetric, as Young's theorem guarantees. We return to this example below to test concavity.

Concave and convex functions

Concavity and convexity are defined by comparing the function to the chords joining its points. They are defined on convex sets: a set \(S\) is convex if, whenever \(\mathbf y_1,\mathbf y_2\in S\), the whole line segment \(\lambda\mathbf y_1+(1-\lambda)\mathbf y_2\) lies in \(S\) for all \(\lambda\in[0,1]\).

Definition — concave and convex

A function \(f:S\subset\mathbb{R}^n\to\mathbb{R}\) on a convex set \(S\) is concave if

$$f\big(\lambda\mathbf y+(1-\lambda)\mathbf x\big)\ge \lambda f(\mathbf y)+(1-\lambda)f(\mathbf x)\quad\text{for all }\mathbf y,\mathbf x\in S,\ \lambda\in[0,1],$$

and convex if the inequality is reversed:

$$f\big(\lambda\mathbf y+(1-\lambda)\mathbf x\big)\le \lambda f(\mathbf y)+(1-\lambda)f(\mathbf x)\quad\text{for all }\mathbf y,\mathbf x\in S,\ \lambda\in[0,1].$$

In words, a concave function lies on or above every chord (it bulges upward, like a hill), while a convex function lies on or below every chord (it bulges downward, like a bowl). Concavity of the objective is exactly what makes a critical point a global maximum; convexity makes it a global minimum.

The Hessian test for concavity and convexity

For \(C^2\) functions, curvature is entirely captured by the definiteness of the Hessian.

Curvature ⇔ definiteness

A \(C^2\) function \(f:S\subset\mathbb{R}^n\to\mathbb{R}\) is

  • concave on \(S\) if and only if \(H^f(\mathbf y)\) is negative semidefinite for all \(\mathbf y\in S\);
  • convex on \(S\) if and only if \(H^f(\mathbf y)\) is positive semidefinite for all \(\mathbf y\in S\).

For a univariate function this reduces to the familiar sign test: \(f''(y)\le 0\) everywhere gives concavity, \(f''(y)\ge 0\) gives convexity. For example \(-2x^2\) is concave and \(y^2+y+2\) is convex. If the relevant definiteness is strict (negative or positive definite) then the function is strictly concave or strictly convex.

Testing definiteness with leading principal minors

For a symmetric \(n\times n\) matrix, let \(D_k^*\) denote the \(k\)-th leading principal minor (the determinant of the top-left \(k\times k\) block). The standard tests are:

  • Negative definite (⇒ strictly concave): the leading principal minors alternate in sign, starting negative — \(D_1^*<0,\ D_2^*>0,\ D_3^*<0,\dots\), i.e. \((-1)^kD_k^*>0\).
  • Positive definite (⇒ strictly convex): all leading principal minors are positive — \(D_1^*>0,\ D_2^*>0,\dots\).

Worked example: checking concavity

Worked example

Take the same function as before, \(f(y_1,y_2,y_3)=100-2y_1^2-y_2^2-3y_3-y_1y_2-e^{y_1+y_2+y_3}\), with Hessian (\(e:=e^{y_1+y_2+y_3}>0\))

$$H^f=\begin{pmatrix}-4-e & -1-e & -e\\ -1-e & -2-e & -e\\ -e & -e & -e\end{pmatrix}.$$

Compute the leading principal minors:

$$D_1^*=-4-e<0,$$

$$D_2^*=(-4-e)(-2-e)-(-1-e)^2=(8+6e+e^2)-(1+2e+e^2)=7+4e>0,$$

$$D_3^*=\det H^f=-7e<0.$$

The signs run \(-,+,-\), alternating and starting negative, so \(H^f\) is negative definite for every \((y_1,y_2,y_3)\). Therefore \(f\) is (strictly) concave on all of \(\mathbb{R}^3\).

Why curvature matters in economics

Economic application

Curvature assumptions are everywhere in economic theory. A concave utility function encodes diminishing marginal utility and risk aversion; a concave production function encodes diminishing returns. Because a concave objective over a convex constraint set has any critical point as a global maximum, concavity is what makes utility- and profit-maximisation problems well behaved and their first-order conditions sufficient. Convexity plays the mirror role: convex cost functions (rising marginal cost) and convex preferences (mixtures preferred to extremes) make cost-minimisation and expenditure-minimisation problems tractable. Checking the Hessian is therefore not an abstract exercise, it is how you verify that a model's optimisation problem has a sensible, unique solution.

Check your understanding

Is \(f(x,y)=-x^2-4y^2+xy\) concave, convex, or neither? Justify with the Hessian.

The second partials are \(f_{xx}=-2\), \(f_{yy}=-8\), \(f_{xy}=1\), so

$$H^f=\begin{pmatrix}-2 & 1\\ 1 & -8\end{pmatrix}.$$

Leading principal minors: \(D_1^*=-2<0\) and \(D_2^*=(-2)(-8)-1^2=16-1=15>0\). The signs alternate starting negative, so \(H^f\) is negative definite, and \(f\) is (strictly) concave everywhere.

State Young's theorem and explain why the symmetry it gives is useful for the Hessian test.

Young's theorem says that if \(f\) is \(C^2\) then \(\partial^2 f/\partial y_i\partial y_j=\partial^2 f/\partial y_j\partial y_i\) for all \(i,j\), so the Hessian is symmetric. This matters because the whole definiteness toolkit, real eigenvalues, orthogonal diagonalisation, and the leading-principal-minor sign tests, is built for symmetric matrices. Without symmetry, "negative semidefinite" would not neatly characterise concavity, and the minor tests would not apply.

A Hessian has leading principal minors \(D_1^*=3\), \(D_2^*=-2\). What can you conclude about the function's curvature?

For positive definiteness (convexity) we need all leading principal minors positive; here \(D_2^*=-2<0\), so the matrix is not positive definite. For negative definiteness (concavity) we need alternating signs starting negative, i.e. \(D_1^*<0\); here \(D_1^*=3>0\), so it is not negative definite either. With \(D_2^*=\det<0\) the two eigenvalues have opposite signs, so the Hessian is indefinite and the function is neither concave nor convex at that point, a saddle-type curvature.

Download the full lecture slides

These notes cover the Hessian and concavity strand of the multivariate calculus material. The full deck also covers the implicit function theorem, Taylor series and integration.

Related notes

Studying this for a
university module?

I tutor economics, econometrics and mathematics at university and postgraduate level, including mathematical economics modules such as EC3304. First consultation is free.

Book a consultation How sessions work & pricing