How to prove that $x \mapsto \log(1+e^{-x})$ is a convex function?
I have tried with the basic definition of convex function, i.e., $f(ax+by) \leq af(x)+bf(y)$, but was not able to solve further.
How to prove that $x \mapsto \log(1+e^{-x})$ is a convex function?
I have tried with the basic definition of convex function, i.e., $f(ax+by) \leq af(x)+bf(y)$, but was not able to solve further.
Hint: it is a fact that if a function is twice differentiable and has positive second derivative everywhere, then it is convex.
$$\frac{d}{dx}\log(1+e^{-x}) = \frac{-e^{-x}}{1+e^{-x}} = -\frac{1}{e^x+1} $$ is an increasing function, since $e^x$ is an increasing function.
This gives that $\log(1+e^{-x})$ is a convex function.
$\def\me{{\rm e}}$Actually, it is a strictly convex function, since its second derivative $f''(x)=\me^x/(1+\me^x)^2$, is positive everywhere.
If you want to prove its strict convexity by the definition, you need to play with the mean value theorem several times, following the same routine to prove that positivity of the second derivative is sufficient (but not necessary) for strict convexity.