$e^{|t|} - |t| -1 , t \in \mathbb{R}$ is convex

Consider the function $e^{|t|} - |t| - 1, t \in \mathbb{R}$. I want to show that such function is convex. I am trying to use that $e^x - x - 1, x>0$ is convex (this follows by the test of the second derivative) but I am getting anywhere . Someone could help me?

• Try to find some thing about composition of two convex functions. That can be use to prove the result which you need. – Bumblebee Sep 15 '16 at 18:25
• Hint: $e^x - x - 1$ is convex and non-decreasing for $x \ge 0$, and $|x|$ is convex on $\mathbb{R}$. – dxiv Sep 15 '16 at 18:25

If $f(x)$ is a convex function on $\mathbb{R}^+$, $g(x)=f(\left|x\right|)$ is a convex function on $\mathbb{R}$, since it is the composition of two convex functions. As you noticed, the convexity of $f(x)=e^x-x-1$ on $\mathbb{R}^+$ is trivial since $$e^x-1-x = \frac{x^2}{2}+\frac{x^3}{6}+\ldots$$ obviously has a positive second derivative on $\mathbb{R}^+$.

A small variation: since $g$ is a continuous function (as a composition of two continuous functions) in order to prove its convexity it is enough to prove its midpoint-convexity. On the other hand, $$g\left(\frac{x+y}{2}\right)=f\left(\frac{|x+y|}{2}\right)\stackrel{(1)}{\leq}f\left(\frac{|x|+|y|}{2}\right)\stackrel{(2)}{\leq} \frac{f(|x|)+f(|y|)}{2}=\frac{g(x)+g(y)}{2}$$ holds, since $(1)$ follows from the fact that $|\cdot|$ is convex on $\mathbb{R}$ and $f$ is increasing on $\mathbb{R}^+$ and $(2)$ follows from the fact that $f$ is (midpoint-)convex on $\mathbb{R}^+$.

Let $f(x) = e^{x} - x - 1$ and $g(x) = f(|x|)$

by the chain rule:

$$g'(x) = f'(|x|) \frac{d|x|}{dx}$$

by the chain and product rules:

$$g''(x) = f''(|x|) \left ( \frac{d|x|}{dx} \right )^2 + f'(|x|)\frac{d|x|}{dx} \frac{d^2|x|}{dx^2}$$

now $\frac{d|x|}{dx}$ is just $-1$ if $x$ is negative and $1$ if $x$ is positive, so $\frac{d^2|x|}{dx^2} = 0$ and $\left ( \frac{d|x|}{dx} \right )^2 = 1$, so

$$g''(x) = f''(|x|)$$

so your second derivative test works for $g$ as well as $f$

Note: this reasoning breaks down at $x=0$ so you still need to check the value of $g''(0)$

$f$ isn't just convex, it's monotonically increasing for $x\ge0$. So mirroring it around the $y$ axis is convex.
• Did you mean to say $f(x) = e^x - x -1$? – Alex Sep 15 '16 at 20:56
• +1 for Answer 2. Answer 1 is not accurate for the reason that you mentioned. $g$ has infinite curvature at $x=0$. – Alt Sep 15 '16 at 21:26
• @Alt infinite curvature? $g$ is twice differentiable at 0. $g''(0) = 1$ – Larry D'Anna Sep 15 '16 at 21:40
• Sorry, I meant $\frac{\partial^2|x|}{\partial^2x}$ not $g$. – Alt Sep 15 '16 at 21:45