Prove this function is convex

convex optimizationconvex-analysis

I should prove this is convex:
$$f(x_1,x_2,x_3) = \max(\sqrt{x_1^2+x_2^2+20x_3^2-x_1x_2-4x_2x_3+1}~,(x_1^2+x_2^2+x_1+x_2+2)^2)$$
If two functions are convex, then the composition is also convex. So as we know, the $\max$ function is convex; if we can prove the two functions in it are also convex, we are done.
I proved that the second function $$(x_1^2+x_2^2+x_1+x_2+2)^2$$ is convex using the second derivative.

The problem I have is with the first one$$\sqrt{x_1^2+x_2^2+20x_3^2-x_1x_2-4x_2x_3+1}$$ proving it using the second derivative is very complex, and I think there is an easier way to prove it.
Any ideas?

Best Answer

Thanks to Stinking Bishop I think this should be the proof of the convexity:$$\sqrt{x_1^2+x_2^2+20x_3^2-x_1x_2-4x_2x_3+1}$$$$=\sqrt{(x_1-\frac{1}{2}x_2)^2+\frac{3}{4}(x_2-\frac{8}{3}x_3)^2+\frac{44}{3}x_3^2+1}$$
so that's a norm:$$||(x_1-\frac{1}{2}x_2),\frac{\sqrt{3}}{2}(x_2-\frac{8}{3}x_3),(2\sqrt{\frac{11}{3}}x_3),1||$$
also we know every norm is convex so we're done.