Convexity of affine function nested in log-sum-exp

convex optimizationconvex-analysisreal-analysis

Suppose there is a function $f (a,b) = \log \Big(e^{a – b} + e^{-a + b} \Big)$, we know that log-sum-exp is convex (related link), and I want to show whether $f(a,b)$ is also convex.

My answer (probability not correct) is that $f(a,b)$ is a convex function because $a-b$ and $-a+b$ are both affine, and they are composed in the convex log-sum-exp function, so $f(a,b)$ is also convex. Is my answer correct? If not, how to show whether $f(a,b)$ is convex or not?

Best Answer

The answer in general is no. Composition preserves convexity only if the inner function (in your case $g(a,b) = a-b$) is convex and non-decreasing. $g(a,b) = a-b$ is affine, but it's not non-decreasing. This means you can't use the composition argument to prove convexity, but the function might still be convex.

Since this is a relatively simply 2-D function, you can plot it to "see" if it's convex or not. If it "looks" convex, you can try proving convexity using the Hessian test, which will be a 2x2 matrix. This test will also allow you to show it's not convex (in case the Hessian is not PSD).