# How to show the Hessian matrix of such functions are positive semi-definite?

Let $f:R\to R$, $g:R^n\to R$. Thus $f\circ g:R^n\to R$. Now suppose $f$ is non-decreasing and convex while $g$ is convex. In additon, $f,g$ are of $C^2$. I want to show that their composition is convex by proving its Hessian matrix is positive semi-definite.

I know there are easier way to prove convexity which does not even need $C^2$ by following definition. But I just want to know how to prove it using Hessian matrix.

I tried to write down each entry of the Hessian matrix using chain rule, but it turned out to be messy, and I don't see where to use their convexity and $f's$ non-decreasing property.

Any help would be appreciated.

• You should write down the Hessian via the chain rule as a matrix (and not entry-wise). Then it becomes quite obvious where to use the assumptions.
– gerw
Commented Jan 28, 2016 at 7:47
• @gerw Could you elaborate a bit on how to write down the Hessian matrix via chain rule as a matrix?
– jack
Commented Jan 28, 2016 at 18:54

You have $\nabla(f\circ g)(x) = f'(g(x)) \, \nabla g(x)$. Consequently $$\nabla^2(f \circ g)(x) = f''(g(x)) \, \nabla g(x) \, \nabla g(x)^\top + f'(g(x)) \, \nabla^2 g(x).$$ Then, it is easy to check the definiteness of the Hessian.